diff options
author | Bill Richardson <wfrichar@chromium.org> | 2012-03-13 10:07:48 -0700 |
---|---|---|
committer | Bill Richardson <wfrichar@chromium.org> | 2012-03-13 10:17:50 -0700 |
commit | a4f5e0c29cae6c998b14f5183aeaeab55a02fd51 (patch) | |
tree | 396ac652831d26c0a8f43dc804324e43a7bbfccf | |
parent | 186deea4c4388d0d019ae12b849ae1341dffe9fc (diff) | |
download | chrome-ec-a4f5e0c29cae6c998b14f5183aeaeab55a02fd51.tar.gz |
Add vboot_init() function in correct place, make it do the switching.
Jumping (currently rebooting, see crosbug.com/p/8100) to the RW image should
be done by vboot_init(), not vboot_pre_init().
As currently written, vboot_init() has to come AFTER these function calls:
task_init(); // sets up interrupts so that uart will work
watchdog_init(1100); // in case we fall over somewhere
uart_init(); // we'd REALLY like to see some debugging output
system_init(); // may go away with crosbug.com/p/8100
keyboard_scan_init(); // check for F3 to go to recovery mode
flash_init(); // maybe set RO regions (this should come earlier!)
eeprom_init(); // this is where the try_b flags are kept
BUG=chrome-os-partner:7459
TEST=none
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I0ec3f6bcc26a308bb1005a944990963853b88b60
-rw-r--r-- | common/main.c | 3 | ||||
-rw-r--r-- | common/vboot.c | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/common/main.c b/common/main.c index 50c5b6d63d..e8e736d155 100644 --- a/common/main.c +++ b/common/main.c @@ -72,6 +72,9 @@ int main(void) flash_init(); #endif eeprom_init(); + + vboot_init(); + #ifdef CONFIG_LPC port_80_init(); lpc_init(); diff --git a/common/vboot.c b/common/vboot.c index 6faf9cd470..307dfac2d0 100644 --- a/common/vboot.c +++ b/common/vboot.c @@ -124,7 +124,16 @@ DECLARE_HOST_COMMAND(EC_LPC_COMMAND_REBOOT_EC, vboot_command_reboot); int vboot_pre_init(void) { - /* Jump to a different image if necessary; this may not return */ + /* FIXME(wfrichar): crosbug.com/p/7453: should protect flash */ + return EC_SUCCESS; +} + + +int vboot_init(void) +{ + /* FIXME(wfrichar): placeholder for full verified boot implementation. + * TBD exactly how, but we may want to continue in RO firmware, jump + * directly to one of the RW firmwares, etc. */ jump_to_other_image(); return EC_SUCCESS; } |