summaryrefslogtreecommitdiff
path: root/board/freescale/common
diff options
context:
space:
mode:
authorGaurav Jain <gaurav.jain@nxp.com>2022-06-23 16:31:35 +0530
committerPeng Fan <peng.fan@nxp.com>2022-08-16 17:07:30 +0800
commit47465877a5b9d6dbc3a068faf24551e2cb3a4911 (patch)
tree6ea5e4c531ab043503980e6a6873d16e3878720b /board/freescale/common
parent20d4c6052fe5826b3421e86b2f0e76a6c22581a7 (diff)
ls1021atwr: caam: Enable Uboot validaion in SPL.
caam driver model enabled in spl for secure boot. fsl_rsa_mod_exp driver enabled in spl for validating uboot image. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Diffstat (limited to 'board/freescale/common')
-rw-r--r--board/freescale/common/fsl_chain_of_trust.c6
-rw-r--r--board/freescale/common/fsl_validate.c10
2 files changed, 10 insertions, 6 deletions
diff --git a/board/freescale/common/fsl_chain_of_trust.c b/board/freescale/common/fsl_chain_of_trust.c
index d31fb82181..ad72353440 100644
--- a/board/freescale/common/fsl_chain_of_trust.c
+++ b/board/freescale/common/fsl_chain_of_trust.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2015 Freescale Semiconductor, Inc.
+ * Copyright 2022 NXP
*/
#include <common.h>
@@ -114,11 +115,6 @@ void spl_validate_uboot(uint32_t hdr_addr, uintptr_t img_addr)
fsl_secboot_handle_error(ERROR_ESBC_PAMU_INIT);
#endif
-#ifdef CONFIG_FSL_CAAM
- if (sec_init() < 0)
- fsl_secboot_handle_error(ERROR_ESBC_SEC_INIT);
-#endif
-
/*
* dm_init_and_scan() is called as part of common SPL framework, so no
* need to call it again but in case of powerpc platforms which currently
diff --git a/board/freescale/common/fsl_validate.c b/board/freescale/common/fsl_validate.c
index f56e4e857a..7a23d8f4c7 100644
--- a/board/freescale/common/fsl_validate.c
+++ b/board/freescale/common/fsl_validate.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2015 Freescale Semiconductor, Inc.
- * Copyright 2021 NXP
+ * Copyright 2021-2022 NXP
*/
#include <common.h>
@@ -19,6 +19,7 @@
#ifdef CONFIG_ARCH_LS1021A
#include <asm/arch/immap_ls102xa.h>
#endif
+#include <dm/lists.h>
#define SHA256_BITS 256
#define SHA256_BYTES (256/8)
@@ -807,6 +808,13 @@ static int calculate_cmp_img_sig(struct fsl_secboot_img_priv *img)
prop.num_bits = key_len * 8;
prop.exp_len = key_len;
+#if defined(CONFIG_SPL_BUILD)
+ ret = device_bind_driver(NULL, "fsl_rsa_mod_exp", "fsl_rsa_mod_exp", NULL);
+ if (ret) {
+ printf("Couldn't bind fsl_rsa_mod_exp driver (%d)\n", ret);
+ return -EINVAL;
+ }
+#endif
ret = uclass_get_device(UCLASS_MOD_EXP, 0, &mod_exp_dev);
if (ret) {
printf("RSA: Can't find Modular Exp implementation\n");