summaryrefslogtreecommitdiff
path: root/include/fsl_sec.h
diff options
context:
space:
mode:
authorLukas Auer <lukas.auer@aisec.fraunhofer.de>2018-01-25 14:11:17 +0100
committerYork Sun <york.sun@nxp.com>2018-02-09 08:34:34 -0800
commitdfaec76029f27ae6831babc0cdcf2816ee491f74 (patch)
treeaef79e6d053863156d99b82d2efeacaab7f7bace /include/fsl_sec.h
parentc883f351e61f425f72d110375eaa80d5ecb5ee64 (diff)
downloadu-boot-dfaec76029f27ae6831babc0cdcf2816ee491f74.tar.gz
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 <lukas.auer@aisec.fraunhofer.de> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'include/fsl_sec.h')
-rw-r--r--include/fsl_sec.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/fsl_sec.h b/include/fsl_sec.h
index a2f5f5a5f1..4cbdb2d65a 100644
--- a/include/fsl_sec.h
+++ b/include/fsl_sec.h
@@ -67,6 +67,9 @@ struct rng4tst {
};
u32 rsvd1[40];
#define RNG_STATE0_HANDLE_INSTANTIATED 0x00000001
+#define RNG_STATE1_HANDLE_INSTANTIATED 0x00000002
+#define RNG_STATE_HANDLE_MASK \
+ (RNG_STATE0_HANDLE_INSTANTIATED | RNG_STATE1_HANDLE_INSTANTIATED)
u32 rdsta; /*RNG DRNG Status Register*/
u32 rsvd2[15];
};