summaryrefslogtreecommitdiff
path: root/drivers/crypto/fsl/jr.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2020-06-27 23:58:53 +0300
committerPriyanka Jain <priyanka.jain@nxp.com>2020-07-27 11:46:29 +0300
commitea95f2142e94bfb68c61e5724616f9949b974a4c (patch)
treefb916a55959c59d0407cb515cea9402567c6a958 /drivers/crypto/fsl/jr.c
parentb980f9e2597b52ce71247e79d534349f7d174b38 (diff)
downloadu-boot-ea95f2142e94bfb68c61e5724616f9949b974a4c.tar.xz
crypto/fsl: add RNG support
Register the random number generator with the rng subsystem in u-boot. This way it can be used by EFI as well as for the 'rng' command. Signed-off-by: Michael Walle <michael@walle.cc> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'drivers/crypto/fsl/jr.c')
-rw-r--r--drivers/crypto/fsl/jr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/crypto/fsl/jr.c b/drivers/crypto/fsl/jr.c
index c5802f7d51..44273c345f 100644
--- a/drivers/crypto/fsl/jr.c
+++ b/drivers/crypto/fsl/jr.c
@@ -20,6 +20,7 @@
#include <asm/cache.h>
#include <asm/fsl_pamu.h>
#endif
+#include <dm/lists.h>
#define CIRC_CNT(head, tail, size) (((head) - (tail)) & (size - 1))
#define CIRC_SPACE(head, tail, size) CIRC_CNT((tail), (head) + 1, (size))
@@ -721,6 +722,14 @@ int sec_init_idx(uint8_t sec_idx)
printf("SEC%u: RNG instantiation failed\n", sec_idx);
return -1;
}
+
+ if (IS_ENABLED(CONFIG_DM_RNG)) {
+ ret = device_bind_driver(NULL, "caam-rng", "caam-rng",
+ NULL);
+ if (ret)
+ printf("Couldn't bind rng driver (%d)\n", ret);
+ }
+
printf("SEC%u: RNG instantiated\n", sec_idx);
}
#endif