summaryrefslogtreecommitdiff
path: root/drivers/auth/cryptocell/cryptocell_crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/auth/cryptocell/cryptocell_crypto.c')
-rw-r--r--drivers/auth/cryptocell/cryptocell_crypto.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/auth/cryptocell/cryptocell_crypto.c b/drivers/auth/cryptocell/cryptocell_crypto.c
index bf7dff4a..05462bea 100644
--- a/drivers/auth/cryptocell/cryptocell_crypto.c
+++ b/drivers/auth/cryptocell/cryptocell_crypto.c
@@ -55,6 +55,7 @@
static void init(void)
{
CCError_t ret;
+ uint32_t lcs;
/* Initialize CC SBROM */
ret = CC_BsvSbromInit((uintptr_t)PLAT_CRYPTOCELL_BASE);
@@ -62,6 +63,19 @@ static void init(void)
ERROR("CryptoCell CC_BsvSbromInit() error %x\n", ret);
panic();
}
+
+ /* Initialize lifecycle state */
+ ret = CC_BsvLcsGetAndInit((uintptr_t)PLAT_CRYPTOCELL_BASE, &lcs);
+ if (ret != CC_OK) {
+ ERROR("CryptoCell CC_BsvLcsGetAndInit() error %x\n", ret);
+ panic();
+ }
+
+ /* If the lifecyclestate is `SD`, then stop further execution */
+ if (lcs == CC_BSV_SECURITY_DISABLED_LCS) {
+ ERROR("CryptoCell LCS is security-disabled\n");
+ panic();
+ }
}
/*