summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorPrasad Sodagudi <psodagud@codeaurora.org>2016-02-07 12:24:47 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-25 16:03:18 -0700
commit95d451a7e03190803717c8de768eaa790cca4fb4 (patch)
treecc7c924699ad3f2b96b9d06d4d021888577ed73f /drivers/soc
parenta739b2a1f8a7ffccb1af6cc3927b3a7dece781b3 (diff)
soc: qcom: Use scm_is_secure_device() API to find secure boot or not
Currently gladiator error reporting driver is independently checking whether device in secure boot or not. So use generic API scm_is_secure_device() and take appropriate decision to enable certain features. Change-Id: I89a7bdd21373ffcfec6d90ffbdd29ce8ed3dde88 Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/gladiator_erp.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/drivers/soc/qcom/gladiator_erp.c b/drivers/soc/qcom/gladiator_erp.c
index 22c812444540..ab1e7e02c843 100644
--- a/drivers/soc/qcom/gladiator_erp.c
+++ b/drivers/soc/qcom/gladiator_erp.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -22,15 +22,6 @@
#define MODULE_NAME "gladiator_error_reporting"
-/* SCM call service and command ID */
-#define SCM_TZ_SVC_INFO 0x6
-#define TZ_INFO_GET_SECURE_STATE 0x4
-
-/* Secure State Check */
-#define SEC_STATE_VALID(a) (a & BIT(0))
-#define SCM_SECURE_BOOT_ENABLED 1
-#define SCM_SECURE_BOOT_DISABLED 0
-
/* Register Offsets */
#define GLADIATOR_ID_COREID 0x0
#define GLADIATOR_ID_REVISIONID 0x4
@@ -602,29 +593,6 @@ bail:
return ret;
}
-static int scm_is_gladiator_erp_available(void)
-{
- int ret;
- struct scm_desc desc = {0};
-
- desc.args[0] = 0;
- desc.arginfo = 0;
- ret = scm_call2(SCM_SIP_FNID(SCM_TZ_SVC_INFO,
- TZ_INFO_GET_SECURE_STATE),
- &desc);
- if (ret) {
- pr_err("gladiator_error_reporting: SCM call failed\n");
- return -ENODEV;
- }
-
- if (SEC_STATE_VALID(desc.ret[0]))
- ret = SCM_SECURE_BOOT_DISABLED;
- else
- ret = SCM_SECURE_BOOT_ENABLED;
-
- return ret;
-}
-
static struct platform_driver gladiator_erp_driver = {
.probe = gladiator_erp_probe,
.driver = {
@@ -638,8 +606,8 @@ static int init_gladiator_erp(void)
{
int ret;
- ret = scm_is_gladiator_erp_available();
- if (ret) {
+ ret = scm_is_secure_device();
+ if (!ret) {
pr_info("Gladiator Error Reporting not available %d\n", ret);
return -ENODEV;
}