summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPeng Fan <Peng.Fan@freescale.com>2015-03-07 20:53:50 +0800
committerPeng Fan <Peng.Fan@freescale.com>2015-04-29 14:56:08 +0800
commitd2ca1e24701a6a10578a133209c8233645a5755f (patch)
tree16deee4d2458ea52bbbe22e89f2de4c2a765f616 /common
parentc911d6ce1aba5ac669c4c0cfa86e4f9e83a37ba9 (diff)
downloadu-boot-imx-d2ca1e24701a6a10578a133209c8233645a5755f.zip
u-boot-imx-d2ca1e24701a6a10578a133209c8233645a5755f.tar.gz
u-boot-imx-d2ca1e24701a6a10578a133209c8233645a5755f.tar.bz2
MLK-10774-23 Add SECURE BOOT in cmd_bootm.c
Add SECURE BOOT in bootm Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bootm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 1825d70..6c5b600 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -127,6 +127,16 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return do_bootm_subcommand(cmdtp, flag, argc, argv);
}
+#ifdef CONFIG_SECURE_BOOT
+ extern uint32_t authenticate_image(
+ uint32_t ddr_start, uint32_t image_size);
+ if (authenticate_image(load_addr,
+ image_get_image_size((image_header_t *)load_addr)) == 0) {
+ printf("Authenticate uImage Fail, Please check\n");
+ return 1;
+ }
+#endif
+
return do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START |
BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER |
BOOTM_STATE_LOADOS |
@@ -582,6 +592,14 @@ static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc,
if (bootm_find_ramdisk_fdt(flag, argc, argv))
return 1;
+#ifdef CONFIG_SECURE_BOOT
+ extern uint32_t authenticate_image(
+ uint32_t ddr_start, uint32_t image_size);
+ if (authenticate_image(images->ep, zi_end - zi_start) == 0) {
+ printf("Authenticate zImage Fail, Please check\n");
+ return 1;
+ }
+#endif
return 0;
}