summaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos/vboot2
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2014-12-01 17:19:10 -0800
committerPatrick Georgi <pgeorgi@google.com>2015-04-18 08:56:36 +0200
commit23727ca424f30dc0fef3573d6ef49ccdf798e8c3 (patch)
tree52bd10db5001c618e62c9cbaf74f02914a42a731 /src/vendorcode/google/chromeos/vboot2
parent7c256405c35a0609dc03441f3fc698d9d578a3d6 (diff)
vboot: make vboot2_verify_firmware return
this allows each board to decide what to do after firmware verification is done. some board needs to return back to the previous stage and let the previous stage kick off the verified stage. this also makes it more visible what is going to happen in the verstage since stage_exit now resides in main(). BUG=none BRANCH=tot TEST=booted cosmos dev board. booted blaze in normal and recovery mode. built for all current boards. Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Change-Id: I3cb466cedf2a9c2b0d48fc4b0f73f76d0714c0c7 Original-Reviewed-on: https://chromium-review.googlesource.com/232517 (cherry picked from commit 495704f36aa54ba12231d396376f01289d083f58) Signed-off-by: Aaron Durbin <adurbin@chromium.org> Change-Id: Ic20dfd3fa93849befc2b37012a5e0907fe83e8e2 Reviewed-on: http://review.coreboot.org/9702 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/vendorcode/google/chromeos/vboot2')
-rw-r--r--src/vendorcode/google/chromeos/vboot2/misc.h2
-rw-r--r--src/vendorcode/google/chromeos/vboot2/verstub.c10
2 files changed, 4 insertions, 8 deletions
diff --git a/src/vendorcode/google/chromeos/vboot2/misc.h b/src/vendorcode/google/chromeos/vboot2/misc.h
index b97be49a31..d638cfadae 100644
--- a/src/vendorcode/google/chromeos/vboot2/misc.h
+++ b/src/vendorcode/google/chromeos/vboot2/misc.h
@@ -22,7 +22,7 @@
#include "../vboot_common.h"
-void vboot2_verify_firmware(void);
+void *vboot2_verify_firmware(void);
void *vboot2_load_ramstage(void);
void verstage_main(void);
void *vboot_load_stage(int stage_index,
diff --git a/src/vendorcode/google/chromeos/vboot2/verstub.c b/src/vendorcode/google/chromeos/vboot2/verstub.c
index 46f57ab08f..5630defc28 100644
--- a/src/vendorcode/google/chromeos/vboot2/verstub.c
+++ b/src/vendorcode/google/chromeos/vboot2/verstub.c
@@ -52,7 +52,7 @@ static struct vb2_working_data *init_vb2_working_data(void)
* 2) We're already in the verstage. Verify firmware, then load the romstage and
* exits to it.
*/
-void vboot2_verify_firmware(void)
+void *vboot2_verify_firmware(void)
{
void *entry;
struct vb2_working_data *wd;
@@ -66,7 +66,6 @@ void vboot2_verify_firmware(void)
if (entry == (void *)-1)
die("failed to load verstage");
- timestamp_add_now(TS_END_COPYVER);
/* verify and select a slot */
stage_exit(entry);
} else {
@@ -75,7 +74,7 @@ void vboot2_verify_firmware(void)
/* jump to the selected slot */
timestamp_add_now(TS_START_COPYROM);
- entry = NULL;
+ entry = (void *)-1;
if (vboot_is_slot_selected(wd)) {
/* RW A or B */
struct vboot_region fw_main;
@@ -93,8 +92,5 @@ void vboot2_verify_firmware(void)
}
timestamp_add_now(TS_END_COPYROM);
- if (entry != NULL && entry != (void *)-1)
- stage_exit(entry);
-
- die("failed to exit from stage\n");
+ return entry;
}