summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Neveux <cedric.neveux@nxp.com>2018-04-17 18:04:39 +0200
committerAymen Sghaier <aymen.sghaier@nxp.com>2018-04-30 16:41:31 +0200
commit5e23f9d6114784d77fd4ed5848953356c3575532 (patch)
tree36c5260292f83ef662b2ca4efd9c88bff595729e
parent25698f2d97e0152b47e6e70e62663ee257b5a940 (diff)
MLK-17909 RNG Instantation done in Secure Firmwarerel_imx_4.9.88_2.0.0_ga
- For i.MX 6 and 7 check if the Secure Firmware (OPTEE) is present. If present don't do the RNG instantation in the CAAM driver Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com> Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> (cherry picked from commit 2b9489d18b6eca5b1f72689602f0eed16e88db84)
-rw-r--r--drivers/crypto/caam/inst_rng.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/crypto/caam/inst_rng.c b/drivers/crypto/caam/inst_rng.c
index dff81786ceef..64c382604cc8 100644
--- a/drivers/crypto/caam/inst_rng.c
+++ b/drivers/crypto/caam/inst_rng.c
@@ -1,7 +1,7 @@
/*
* CAAM RNG instantiation driver backend
*
- * Copyright 2017 NXP
+ * Copyright 2017-2018 NXP
*/
#include <linux/device.h>
@@ -286,6 +286,17 @@ int inst_rng_imx6(struct platform_device *pdev)
ctrlpriv = dev_get_drvdata(ctrldev);
ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl;
+#ifndef CONFIG_ARM64
+ /*
+ * Check if the Secure Firmware is running,
+ * check only for i.MX6 and i.MX7
+ */
+ if (of_find_compatible_node(NULL, NULL, "linaro,optee-tz")) {
+ pr_info("RNG Instantation done by Secure Firmware\n");
+ return ret;
+ }
+#endif
+
cha_vid_ls = rd_reg32(&ctrl->perfmon.cha_id_ls);
/*
* If SEC has RNG version >= 4 and RNG state handle has not been