vboot: Remove get_sw_write_protect_state callback

We've just decided to remove the only known use of the VBSD_SW_WP flag
in vboot (https://chromium-review.googlesource.com/c/575389), since it
was unused and never reliable on all platforms anyway. Therefore, we can
now also remove the coreboot infrastructure that supported it. It
doesn't really hurt anyone, but removing it saves a small bit of effort
for future platforms.

Change-Id: I6706eba2761a73482e03f3bf46343cf1d84f154b
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/20628
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Julius Werner 2017-07-17 17:47:31 -07:00
parent ff48b3b1ec
commit 959cab4f1f
8 changed files with 0 additions and 50 deletions

View File

@ -19,7 +19,6 @@
/* functions implemented per mainboard: */
void init_bootmode_straps(void);
int get_write_protect_state(void);
int get_sw_write_protect_state(void);
int get_developer_mode_switch(void);
int get_recovery_mode_switch(void);
int get_recovery_mode_retrain_switch(void);

View File

@ -37,12 +37,6 @@ int get_recovery_mode_switch(void)
return 0;
}
int get_sw_write_protect_state(void)
{
/* Not write protected */
return 0;
}
int get_write_protect_state(void)
{
/* Not write protected */

View File

@ -384,16 +384,3 @@ void mainboard_save_dimm_info(void)
{
printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__);
}
int get_sw_write_protect_state(void)
{
uint8_t status;
const struct spi_flash *flash;
flash = boot_device_spi_flash();
if (!flash)
return 0;
/* Return unprotected status if status read fails. */
return spi_flash_status(flash, &status) ? 0 : !!(status & 0x80);
}

View File

@ -326,10 +326,3 @@ static void *setup_stack_and_mttrs(void)
return slot;
}
int get_sw_write_protect_state(void)
{
u8 status;
/* Return unprotected status if status read fails. */
return (early_spi_read_wpsr(&status) ? 0 : !!(status & 0x80));
}

View File

@ -123,11 +123,4 @@ asmlinkage void romstage_after_car(void)
;
}
int get_sw_write_protect_state(void)
{
u8 status;
/* Return unprotected status if status read fails. */
return early_spi_read_wpsr(&status) ? 0 : !!(status & 0x80);
}
void __attribute__((weak)) mainboard_pre_console_init(void) {}

View File

@ -53,14 +53,6 @@ void soc_pre_ram_init(struct romstage_params *params)
soc_fill_pei_data(params->pei_data);
}
int get_sw_write_protect_state(void)
{
u8 status;
/* Return unprotected status if status read fails. */
return fast_spi_flash_read_wpsr(&status) ? 0 : !!(status & 0x80);
}
/* UPD parameters to be initialized before MemoryInit */
void soc_memory_init_params(struct romstage_params *params,
MEMORY_INIT_UPD *upd)

View File

@ -147,12 +147,6 @@ int __attribute__((weak)) clear_recovery_mode_switch(void)
return 0;
}
int __attribute__((weak)) get_sw_write_protect_state(void)
{
// Can be implemented by a platform / mainboard
return 0;
}
void __attribute__((weak)) log_recovery_mode_switch(void)
{
// Weak implementation. Nothing to do.

View File

@ -62,8 +62,6 @@ static void fill_vboot_handoff(struct vboot_handoff *vboot_handoff,
if (get_write_protect_state())
vb_sd->flags |= VBSD_BOOT_FIRMWARE_WP_ENABLED;
if (get_sw_write_protect_state())
vb_sd->flags |= VBSD_BOOT_FIRMWARE_SW_WP_ENABLED;
if (vb2_sd->recovery_reason) {
vb_sd->firmware_index = 0xFF;