chromeos: vboot_loader: Add support for SW_WP_ENABLED flag
Set VB_INIT_FLAG_SW_WP_ENABLED according to the status returned by an optional platform / mainboard function vboot_get_sw_write_protect(). BUG=chrome-os-partner:26777 TEST=Manual on Rambi with all patches in sequence: `crossystem sw_wpsw_boot` prints 0 `flashrom --wp-enable` and reboot `crossystem sw_wpsw_boot` prints 1 BRANCH=Rambi Change-Id: Ifb852d75cc106d10120cfee0a396b0662282051a Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/190096 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
edf12f441a
commit
c4668fc8a9
3 changed files with 12 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue