From dfaec76029f27ae6831babc0cdcf2816ee491f74 Mon Sep 17 00:00:00 2001 From: Lukas Auer Date: Thu, 25 Jan 2018 14:11:17 +0100 Subject: crypto/fsl: instantiate all rng state handles Extend the instantiate_rng() function and the corresponding CAAM job descriptor to instantiate all RNG state handles. This moves the RNG instantiation code in line with the CAAM kernel driver. Previously, only the first state handle was instantiated. The second one was instantiated by the CAAM kernel driver. This works if the kernel runs in secure mode, but fails in non-secure mode since the kernel driver uses DEC0 directly instead of over the job ring interface. Instantiating all RNG state handles in u-boot removes the need for using DEC0 in the kernel driver, making it possible to use the CAAM in non-secure mode. Signed-off-by: Lukas Auer Tested-by: Bryan O'Donoghue Reviewed-by: York Sun --- drivers/crypto/fsl/jr.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/crypto/fsl/jr.h') diff --git a/drivers/crypto/fsl/jr.h b/drivers/crypto/fsl/jr.h index 8aab4c988d..ef515e74f8 100644 --- a/drivers/crypto/fsl/jr.h +++ b/drivers/crypto/fsl/jr.h @@ -41,6 +41,8 @@ #define JQ_DEQ_TO_ERR -2 #define JQ_ENQ_ERR -3 +#define RNG4_MAX_HANDLES 2 + struct op_ring { phys_addr_t desc; uint32_t status; -- cgit