diff options
author | Aaron Durbin <adurbin@chromium.org> | 2016-01-22 16:33:57 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2016-02-04 17:34:15 +0100 |
commit | 5dbefd9ff672dd9bbcbbf20441fcb7909137b584 (patch) | |
tree | a0365746b8f683bf07ff989f4286de5aa72b082c /src/vendorcode | |
parent | 87c9faeb4c7a94b2de1b2cf44d8db1383909ccc2 (diff) | |
download | coreboot-5dbefd9ff672dd9bbcbbf20441fcb7909137b584.tar.xz |
chromeos/vboot: allow platform to hook into vboot_reboot()
Sometimes it's necessary for the platform to perform clean up
tasks prior to reboot when employing vboot. For example, x86 systems
that resume and do vboot verification may need to clear their
sleep control register prior to doing a cold reset so that the
next boot doesn't appear to be a resume. Allow that hook by
introducing vboot_platform_prepare_reboot().
BUG=chrome-os-partner:46049
BRANCH=glados
TEST=Ensure vboot_platform_prepare_reboot() called from vboot_reboot().
Change-Id: I622c9181d9fa3048204e3df3223d5dd4b458abca
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: f31ffc40bde002dec398fd4dd9d2ee9d65df0d7b
Original-Change-Id: I97318cec34494a7fc4b1ecf2cb22715d20e730ff
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/323501
Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/13575
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/vendorcode')
-rw-r--r-- | src/vendorcode/google/chromeos/vboot_common.c | 5 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/vboot_common.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/vboot_common.c b/src/vendorcode/google/chromeos/vboot_common.c index 448aad6db0..eef54174f6 100644 --- a/src/vendorcode/google/chromeos/vboot_common.c +++ b/src/vendorcode/google/chromeos/vboot_common.c @@ -92,10 +92,15 @@ int vboot_recovery_reason(void) return sd->recovery_reason; } +void __attribute__((weak)) vboot_platform_prepare_reboot(void) +{ +} + void vboot_reboot(void) { if (IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART)) cbmem_dump_console(); + vboot_platform_prepare_reboot(); hard_reset(); die("failed to reboot"); } diff --git a/src/vendorcode/google/chromeos/vboot_common.h b/src/vendorcode/google/chromeos/vboot_common.h index a658d62ab4..250b0e50ac 100644 --- a/src/vendorcode/google/chromeos/vboot_common.h +++ b/src/vendorcode/google/chromeos/vboot_common.h @@ -64,6 +64,9 @@ int vboot_retrieve_hash(void *digest, size_t digest_size); */ int vboot_platform_is_resuming(void); +/* Allow the platform to do any clean up work when vboot requests a reboot. */ +void vboot_platform_prepare_reboot(void); + /* Main logic for verified boot. verstage() is the stage entry point * while the verstage_main() is just the core logic. */ void verstage_main(void); |