diff options
author | Saksham Jain <saksham.jain@nxp.com> | 2016-03-23 16:24:45 +0530 |
---|---|---|
committer | York Sun <york.sun@nxp.com> | 2016-03-29 08:46:23 -0700 |
commit | 85bb38965431424d4e4a7b5030cc589a3401a988 (patch) | |
tree | ac6e57f1dcca2d95c204075995909fba403e657d /board/freescale/common/cmd_esbc_validate.c | |
parent | c4666cf6954a28ade5a8550505d5bc25dc7f92d7 (diff) | |
download | u-boot-imx-85bb38965431424d4e4a7b5030cc589a3401a988.zip u-boot-imx-85bb38965431424d4e4a7b5030cc589a3401a988.tar.gz u-boot-imx-85bb38965431424d4e4a7b5030cc589a3401a988.tar.bz2 |
SECURE BOOT: Change fsl_secboot_validate func to pass image addr
Use a pointer to pass image address to fsl_secboot_validate(),
instead of using environmental variable "img_addr".
Signed-off-by: Aneesh Bansal <aneesh.bansal@nxp.com>
Signed-off-by: Saksham Jain <saksham.jain@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'board/freescale/common/cmd_esbc_validate.c')
-rw-r--r-- | board/freescale/common/cmd_esbc_validate.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/board/freescale/common/cmd_esbc_validate.c b/board/freescale/common/cmd_esbc_validate.c index 375bc24..cefe3cc 100644 --- a/board/freescale/common/cmd_esbc_validate.c +++ b/board/freescale/common/cmd_esbc_validate.c @@ -29,6 +29,8 @@ static int do_esbc_validate(cmd_tbl_t *cmdtp, int flag, int argc, char *hash_str = NULL; uintptr_t haddr; int ret; + uintptr_t img_addr = 0; + char buf[20]; if (argc < 2) return cmd_usage(cmdtp); @@ -43,7 +45,15 @@ static int do_esbc_validate(cmd_tbl_t *cmdtp, int flag, int argc, * part of header. So, the function is called * by passing this argument as 0. */ - ret = fsl_secboot_validate(haddr, hash_str, 0); + ret = fsl_secboot_validate(haddr, hash_str, &img_addr); + + /* Need to set "img_addr" even if validation failure. + * Required when SB_EN in RCW set and non-fatal error + * to continue U-Boot + */ + sprintf(buf, "%lx", img_addr); + setenv("img_addr", buf); + if (ret) return 1; |