Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 471e59ed authored by Aparna Mallavarapu's avatar Aparna Mallavarapu Committed by Abhimanyu Kapur
Browse files

soc: qcom: Correct the logic to determine if device is secure boot or not.



Correct the logic to determine if device is secure boot or not
and accordingly disable the gladiator ERP driver for secure boot devices.

Change-Id: I7fc38983f293eb48abbeb3e4996bc3e03046b962
Signed-off-by: default avatarAparna Mallavarapu <aparnam@codeaurora.org>
parent 5a26d717
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -27,7 +27,9 @@
#define TZ_INFO_GET_SECURE_STATE	0x4

/* Secure State Check */
#define SEC_STATE_VALID(a) (a & (BIT(0) | BIT(2) | BIT(6)))
#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
@@ -616,9 +618,11 @@ static int scm_is_gladiator_erp_available(void)
	}

	if (SEC_STATE_VALID(desc.ret[0]))
		return 0;
		ret = SCM_SECURE_BOOT_DISABLED;
	else
		return -ENODEV;
		ret = SCM_SECURE_BOOT_ENABLED;

	return ret;
}

static struct platform_driver gladiator_erp_driver = {
@@ -636,7 +640,7 @@ static int init_gladiator_erp(void)

	ret = scm_is_gladiator_erp_available();
	if (ret) {
		pr_info("Gladiator Error Reporting not available\n");
		pr_info("Gladiator Error Reporting not available %d\n", ret);
		return -ENODEV;
	}