From cad9f84d162328da5a0bf5a508c2e4e751322b9d Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Wed, 24 Sep 2014 09:38:34 -0700 Subject: [PATCH] armv7: branch to verstage for early firmware selection this change makes the bootblock jump to the verstage when VBOOT2_VERIFY_FIRMWARE is set. BUG=None TEST=Booted Veyron Pinky. Verified firmware selection in the log. BRANCH=None Signed-off-by: Daisuke Nojiri Change-Id: I868b2c1888a55fd181e10856fd0f58d01086355c Reviewed-on: https://chromium-review.googlesource.com/219626 Commit-Queue: Daisuke Nojiri Tested-by: Daisuke Nojiri Reviewed-by: Aaron Durbin --- src/arch/arm/armv7/bootblock_simple.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/arch/arm/armv7/bootblock_simple.c b/src/arch/arm/armv7/bootblock_simple.c index 2ea441336c..47a3c9fed0 100644 --- a/src/arch/arm/armv7/bootblock_simple.c +++ b/src/arch/arm/armv7/bootblock_simple.c @@ -27,11 +27,11 @@ #include #include #include +#include void main(void) { - const char *stage_name = "fallback/romstage"; - void *entry; + void *entry = (void *)-1; bootblock_cpu_init(); bootblock_mainboard_init(); @@ -41,8 +41,18 @@ void main(void) exception_init(); } - entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, stage_name); + if (IS_ENABLED(CONFIG_VBOOT2_VERIFY_FIRMWARE)) { + if (IS_ENABLED(CONFIG_RETURN_FROM_VERSTAGE)) + vboot2_verify_firmware(); /* doesn't return */ + else + entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, + CONFIG_CBFS_PREFIX "/verstage"); + } else { + entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, + CONFIG_CBFS_PREFIX "/romstage"); + } - if (entry) stage_exit(entry); + if (entry != (void *)-1) + stage_exit(entry); hlt(); }