From f131fc7f37329a4caa18a18c4ea999254fe21eee Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Wed, 23 Jan 2019 15:01:21 -0800 Subject: vendorcode/google/chromeos: Add mainboard hook before cr50 update In order to allow the mainboard to configure the system before a cr50 initiated update reset add a weak function that the mainboard can override if necessary. This will allow a board that would otherwise be configured to stay off after an EC reset to instead power up after the reset and not end up in a shut down state after a cr50 update. BUG=b:121380403 TEST=update cr50 firmware on sarien and reboot Change-Id: I11f9e8c9bfe810f69b4eaa2c633252c25004cbd0 Signed-off-by: Duncan Laurie Reviewed-on: https://review.coreboot.org/c/31057 Reviewed-by: Stefan Reinauer Tested-by: build bot (Jenkins) --- src/vendorcode/google/chromeos/chromeos.h | 3 +++ src/vendorcode/google/chromeos/cr50_enable_update.c | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'src/vendorcode/google/chromeos') diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index df61596684..f7e2ae9b8e 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -33,6 +33,9 @@ static inline void mark_watchdog_tombstone(void) { return; } static inline void reboot_from_watchdog(void) { return; } #endif /* CONFIG_CHROMEOS */ +/* Defined as weak function in cr50_enable_update.c */ +void mainboard_cr50_update_reset(void); + struct romstage_handoff; #include "gnvs.h" diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c index 06416bda76..da9a16d75f 100644 --- a/src/vendorcode/google/chromeos/cr50_enable_update.c +++ b/src/vendorcode/google/chromeos/cr50_enable_update.c @@ -21,6 +21,9 @@ #include #include #include +#include + +void __weak mainboard_cr50_update_reset(void) {} static void enable_update(void *unused) { @@ -52,6 +55,9 @@ static void enable_update(void *unused) if (!num_restored_headers) return; + /* Give mainboard a chance to take action */ + mainboard_cr50_update_reset(); + elog_add_event(ELOG_TYPE_CR50_UPDATE); /* clear current post code avoid chatty eventlog on subsequent boot*/ -- cgit v1.2.3