summaryrefslogtreecommitdiffstats
path: root/board/freescale/common/cmd_esbc_validate.c
diff options
context:
space:
mode:
authorSaksham Jain <saksham.jain@nxp.com>2016-03-23 16:24:45 +0530
committerYork Sun <york.sun@nxp.com>2016-03-29 08:46:23 -0700
commit85bb38965431424d4e4a7b5030cc589a3401a988 (patch)
treeac6e57f1dcca2d95c204075995909fba403e657d /board/freescale/common/cmd_esbc_validate.c
parentc4666cf6954a28ade5a8550505d5bc25dc7f92d7 (diff)
downloadtalos-obmc-uboot-85bb38965431424d4e4a7b5030cc589a3401a988.tar.gz
talos-obmc-uboot-85bb38965431424d4e4a7b5030cc589a3401a988.zip
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.c12
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 375bc24968..cefe3cc531 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;
OpenPOWER on IntegriCloud