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 <dlaurie@google.com>
Reviewed-on: https://review.coreboot.org/c/31057
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c
index 06416bd..da9a16d 100644
--- a/src/vendorcode/google/chromeos/cr50_enable_update.c
+++ b/src/vendorcode/google/chromeos/cr50_enable_update.c
@@ -21,6 +21,9 @@
 #include <security/tpm/tss.h>
 #include <vb2_api.h>
 #include <security/vboot/vboot_common.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+
+void __weak mainboard_cr50_update_reset(void) {}
 
 static void enable_update(void *unused)
 {
@@ -52,6 +55,9 @@
 	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*/