diff --git a/src/vendorcode/google/chromeos/chromeos.c b/src/vendorcode/google/chromeos/chromeos.c index e294196d0f..0ee7e2f634 100644 --- a/src/vendorcode/google/chromeos/chromeos.c +++ b/src/vendorcode/google/chromeos/chromeos.c @@ -86,6 +86,12 @@ void __attribute__((weak)) save_chromeos_gpios(void) { // Can be implemented by a mainboard } + +int __attribute((weak)) vboot_get_sw_write_protect(void) +{ + // Can be implemented by a platform / mainboard + return 0; +} #endif #if CONFIG_VBOOT_VERIFY_FIRMWARE diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index dbbe54e348..d877f7a469 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -47,6 +47,9 @@ int recovery_mode_enabled(void); void init_chromeos(int bootmode); struct romstage_handoff; + +/* TODO(shawnn): Remove these CONFIGs and define default weak functions + * that can be overridden in the platform / MB code. */ #if CONFIG_VBOOT_VERIFY_FIRMWARE void vboot_verify_firmware(struct romstage_handoff *handoff); void *vboot_get_payload(int *len); @@ -60,6 +63,7 @@ static inline int vboot_get_handoff_info(void **addr, uint32_t *size) return -1; } #endif +int vboot_get_sw_write_protect(void); #include "gnvs.h" struct device; diff --git a/src/vendorcode/google/chromeos/vboot_loader.c b/src/vendorcode/google/chromeos/vboot_loader.c index 4fe02c9fe5..6e7367b4b5 100644 --- a/src/vendorcode/google/chromeos/vboot_loader.c +++ b/src/vendorcode/google/chromeos/vboot_loader.c @@ -93,6 +93,8 @@ static void vboot_invoke_wrapper(struct vboot_handoff *vboot_handoff) *iflags |= VB_INIT_FLAG_REC_BUTTON_PRESSED; if (get_write_protect_state()) *iflags |= VB_INIT_FLAG_WP_ENABLED; + if (vboot_get_sw_write_protect()) + *iflags |= VB_INIT_FLAG_SW_WP_ENABLED; if (CONFIG_VIRTUAL_DEV_SWITCH) *iflags |= VB_INIT_FLAG_VIRTUAL_DEV_SWITCH; if (CONFIG_EC_SOFTWARE_SYNC) {