summaryrefslogtreecommitdiff
path: root/drivers/crypto/fsl/jobdesc.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2020-06-27 22:58:51 +0200
committerPriyanka Jain <priyanka.jain@nxp.com>2020-07-27 14:16:29 +0530
commitc269a970f23fabbb0d35708ff021bf2962780f9f (patch)
treee2168baa44310fd76c252bc1b548f7467b73f13c /drivers/crypto/fsl/jobdesc.c
parent0dc596127c55e5430bd8f213e41a24c8f440c01a (diff)
crypto/fsl: don't regenerate secure keys
The secure keys (TDKEK, JDKEK, TDSK) can only be generated once after a POR. Otherwise the RNG4 will throw an error. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Horia Geantă <horia.geanta@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'drivers/crypto/fsl/jobdesc.c')
-rw-r--r--drivers/crypto/fsl/jobdesc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/fsl/jobdesc.c b/drivers/crypto/fsl/jobdesc.c
index dbafb5b161..c30ea88cb0 100644
--- a/drivers/crypto/fsl/jobdesc.c
+++ b/drivers/crypto/fsl/jobdesc.c
@@ -258,7 +258,7 @@ void inline_cnstr_jobdesc_blob_decap(uint32_t *desc, uint8_t *key_idnfr,
* Descriptor to instantiate RNG State Handle 0 in normal mode and
* load the JDKEK, TDKEK and TDSK registers
*/
-void inline_cnstr_jobdesc_rng_instantiation(uint32_t *desc, int handle)
+void inline_cnstr_jobdesc_rng_instantiation(u32 *desc, int handle, int do_sk)
{
u32 *jump_cmd;
@@ -269,7 +269,7 @@ void inline_cnstr_jobdesc_rng_instantiation(uint32_t *desc, int handle)
(handle << OP_ALG_AAI_SHIFT) | OP_ALG_AS_INIT);
/* For SH0, Secure Keys must be generated as well */
- if (handle == 0) {
+ if (!handle && do_sk) {
/* wait for done */
jump_cmd = append_jump(desc, JUMP_CLASS_CLASS1);
set_jump_tgt_here(desc, jump_cmd);