From 959cab4f1fd10901e64f2865fde240689201587c Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Mon, 17 Jul 2017 17:47:31 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/20628 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin --- src/include/bootmode.h | 1 - src/mainboard/intel/galileo/vboot.c | 6 ------ src/soc/intel/apollolake/romstage.c | 13 ------------- src/soc/intel/baytrail/romstage/romstage.c | 7 ------- src/soc/intel/broadwell/romstage/romstage.c | 7 ------- src/soc/intel/skylake/romstage/romstage.c | 8 -------- src/vboot/bootmode.c | 6 ------ src/vboot/vboot_handoff.c | 2 -- 8 files changed, 50 deletions(-) (limited to 'src') diff --git a/src/include/bootmode.h b/src/include/bootmode.h index db40a6de55..5650b3d271 100644 --- a/src/include/bootmode.h +++ b/src/include/bootmode.h @@ -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); diff --git a/src/mainboard/intel/galileo/vboot.c b/src/mainboard/intel/galileo/vboot.c index 70fe11338c..90d8f0a93e 100644 --- a/src/mainboard/intel/galileo/vboot.c +++ b/src/mainboard/intel/galileo/vboot.c @@ -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 */ diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c index 24e00df3fd..7c9268af14 100644 --- a/src/soc/intel/apollolake/romstage.c +++ b/src/soc/intel/apollolake/romstage.c @@ -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); -} diff --git a/src/soc/intel/baytrail/romstage/romstage.c b/src/soc/intel/baytrail/romstage/romstage.c index b6bc64c583..c163257ec0 100644 --- a/src/soc/intel/baytrail/romstage/romstage.c +++ b/src/soc/intel/baytrail/romstage/romstage.c @@ -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)); -} diff --git a/src/soc/intel/broadwell/romstage/romstage.c b/src/soc/intel/broadwell/romstage/romstage.c index b5e52292a4..1417b802cf 100644 --- a/src/soc/intel/broadwell/romstage/romstage.c +++ b/src/soc/intel/broadwell/romstage/romstage.c @@ -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) {} diff --git a/src/soc/intel/skylake/romstage/romstage.c b/src/soc/intel/skylake/romstage/romstage.c index cb704fd635..50c050ef45 100644 --- a/src/soc/intel/skylake/romstage/romstage.c +++ b/src/soc/intel/skylake/romstage/romstage.c @@ -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) diff --git a/src/vboot/bootmode.c b/src/vboot/bootmode.c index 23dec13396..120744837b 100644 --- a/src/vboot/bootmode.c +++ b/src/vboot/bootmode.c @@ -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. diff --git a/src/vboot/vboot_handoff.c b/src/vboot/vboot_handoff.c index b3a5c19641..64c8ca6ef7 100644 --- a/src/vboot/vboot_handoff.c +++ b/src/vboot/vboot_handoff.c @@ -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; -- cgit v1.2.3