summaryrefslogtreecommitdiff
path: root/board/freescale/common/cmd_esbc_validate.c
diff options
context:
space:
mode:
authorAneesh Bansal <aneesh.bansal@freescale.com>2015-12-08 08:44:15 (GMT)
committerYork Sun <york.sun@nxp.com>2016-01-25 16:24:16 (GMT)
commitb055a0fd867b11e40944b3414026d37ea00e0840 (patch)
treecb0f6e9a68c69aad67f0175387267d158e5f69db /board/freescale/common/cmd_esbc_validate.c
parent6629261ddd9d78c3cd8193b05c00a2a9bdc74796 (diff)
downloadu-boot-b055a0fd867b11e40944b3414026d37ea00e0840.tar.xz
SECURE BOOT: support for validation of dynamic image
Some images to be validated are relocated to a dynamic address at run time. So, these addresses cannot be known befor hand while signing the images and creating the header offline. So, support is required to pass the image address to the validate function as an argument. If an address is provided to the function, the address field in Header is not read and is treated as a reserved field. Signed-off-by: Saksham Jain <saksham@freescale.com> Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com> Acked-by: Ruchika Gupta <ruchika.gupta@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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/board/freescale/common/cmd_esbc_validate.c b/board/freescale/common/cmd_esbc_validate.c
index ae6a9af..ca7c737 100644
--- a/board/freescale/common/cmd_esbc_validate.c
+++ b/board/freescale/common/cmd_esbc_validate.c
@@ -22,7 +22,7 @@ static int do_esbc_validate(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
char *hash_str = NULL;
- ulong haddr;
+ uintptr_t haddr;
int ret;
if (argc < 2)
@@ -32,9 +32,13 @@ static int do_esbc_validate(cmd_tbl_t *cmdtp, int flag, int argc,
hash_str = argv[2];
/* First argument - header address -32/64bit */
- haddr = simple_strtoul(argv[1], NULL, 16);
+ haddr = (uintptr_t)simple_strtoul(argv[1], NULL, 16);
- ret = fsl_secboot_validate(haddr, hash_str);
+ /* With esbc_validate command, Image address must be
+ * part of header. So, the function is called
+ * by passing this argument as 0.
+ */
+ ret = fsl_secboot_validate(haddr, hash_str, 0);
if (ret)
return 1;