summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-11-30 01:32:39 -0600
committerYe Li <ye.li@nxp.com>2018-04-27 02:32:17 -0700
commit1e33f493a55dad7e016f948b932000ec295c6df4 (patch)
tree95a57f22472147de221217b122e25350d87a18a5 /cmd
parente31a75cc78ad2d5e6ab5d58851058ab57de1566d (diff)
MLK-17044-3 booti: Add kernel image authentication for secure boot
When secure boot is enabled, add authenticate_image in booti to authenticate kernel image. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit f29a143cdb8c74566113737e9be7e1bcd8c625f4)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/booti.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/booti.c b/cmd/booti.c
index fff9369763..b605e9492b 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -44,6 +44,16 @@ static int booti_start(cmd_tbl_t *cmdtp, int flag, int argc,
if (ret != 0)
return 1;
+#ifdef CONFIG_SECURE_BOOT
+ extern int authenticate_image(
+ uint32_t ddr_start, uint32_t raw_image_size);
+ if (authenticate_image(ld, image_size) != 0) {
+ printf("Authenticate Image Fail, Please check\n");
+ return 1;
+ }
+
+#endif
+
/* Handle BOOTM_STATE_LOADOS */
if (relocated_addr != ld) {
debug("Moving Image from 0x%lx to 0x%lx\n", ld, relocated_addr);