summaryrefslogtreecommitdiff
path: root/drivers/crypto/ccree/cc_pm.c
diff options
context:
space:
mode:
authorOfir Drang <ofir.drang@arm.com>2019-06-17 11:46:28 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-06-27 09:28:00 +0300
commitd84f6269ce24eb4c468e246b24fc0fdce34ab6f6 (patch)
treefc86b9da061c4bc7c0b7b2e1607e9e71a97ab49b /drivers/crypto/ccree/cc_pm.c
parent0b970d54772f08f56326b89db74cba2ca3c7c278 (diff)
downloadlinux-d84f6269ce24eb4c468e246b24fc0fdce34ab6f6.tar.xz
crypto: ccree - check that cryptocell reset completed
In case of driver probe and pm resume we need to check that the cryptocell hardware reset cycle is completed. during the reset cycle that Cryptocell provide read only access to the APB interface which allows to verify through the CC registers that the reset is completed. Until reset completion we assume that any write/crypto operation is blocked. Signed-off-by: Ofir Drang <ofir.drang@arm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree/cc_pm.c')
-rw-r--r--drivers/crypto/ccree/cc_pm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/crypto/ccree/cc_pm.c b/drivers/crypto/ccree/cc_pm.c
index 2dad9c9543c6..20f7f3d34e27 100644
--- a/drivers/crypto/ccree/cc_pm.c
+++ b/drivers/crypto/ccree/cc_pm.c
@@ -49,6 +49,11 @@ int cc_pm_resume(struct device *dev)
dev_err(dev, "failed getting clock back on. We're toast.\n");
return rc;
}
+ /* wait for Crytpcell reset completion */
+ if (!cc_wait_for_reset_completion(drvdata)) {
+ dev_err(dev, "Cryptocell reset not completed");
+ return -EBUSY;
+ }
cc_iowrite(drvdata, CC_REG(HOST_POWER_DOWN_EN), POWER_DOWN_DISABLE);
rc = init_cc_regs(drvdata, false);