From ad2268e7396abc6ff094376eedec2402b06f3b21 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Tue, 17 Jul 2012 13:51:44 -0700 Subject: Simplify flash protection, part 1 1. If the flash protection state is locked, RO firmware is explicitly locked. 2. Protecting flash now locks the entire flash. BUG=chrome-os-partner:11150 TEST=manual flashinfo -> nothing protected flashwp now flashinfo -> unlocked,applied; everything protected reboot flashinfo -> nothing protected flashwp lock -> flashinfo -> locked,applied; now has 40 Y's at start and 1 at end reboot flashinfo -> locked,applied; now has 40 Y's at start and 1 at end remove WP screw reboot flashinfo -> locked, not applied; nothing protected flashwp unlock flashinfo -> nothing protected Change-Id: I2cf0e8bfe82ab7a5bf88b9161b7a05b889cae71a Signed-off-by: Randall Spangler Reviewed-on: https://gerrit.chromium.org/gerrit/27717 --- chip/stm32/config-stm32l15x.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'chip/stm32/config-stm32l15x.h') diff --git a/chip/stm32/config-stm32l15x.h b/chip/stm32/config-stm32l15x.h index 15b37eb956..63d9b0d323 100644 --- a/chip/stm32/config-stm32l15x.h +++ b/chip/stm32/config-stm32l15x.h @@ -5,7 +5,8 @@ /* Memory mapping */ #define CONFIG_FLASH_BASE 0x08000000 -#define CONFIG_FLASH_SIZE 0x00020000 +#define CONFIG_FLASH_PHYSICAL_SIZE 0x00020000 +#define CONFIG_FLASH_SIZE CONFIG_FLASH_PHYSICAL_SIZE #define CONFIG_FLASH_BANK_SIZE 0x1000 #define CONFIG_RAM_BASE 0x20000000 #define CONFIG_RAM_SIZE 0x00004000 @@ -23,12 +24,13 @@ #define CONFIG_SECTION_RW_OFF CONFIG_FW_RW_OFF #define CONFIG_SECTION_RW_SIZE CONFIG_FW_RW_SIZE -/* no keys for now */ -#define CONFIG_VBOOT_ROOTKEY_OFF (CONFIG_FW_RO_OFF + CONFIG_FW_RO_SIZE) -#define CONFIG_VBLOCK_RW_OFF (CONFIG_FW_RW_OFF + CONFIG_FW_RW_SIZE) -#define CONFIG_VBOOT_ROOTKEY_SIZE 0 -#define CONFIG_VBLOCK_SIZE 0 - +/* + * The EC uses the top bank of flash to emulate a SPI-like write protect + * register with persistent state. Put that up at the top. + */ +#define CONFIG_SECTION_FLASH_PSTATE_SIZE (1 * CONFIG_FLASH_BANK_SIZE) +#define CONFIG_SECTION_FLASH_PSTATE_OFF (CONFIG_FLASH_SIZE \ + - CONFIG_SECTION_FLASH_PSTATE_SIZE) /* Number of IRQ vectors on the NVIC */ #define CONFIG_IRQ_COUNT 45 -- cgit v1.2.1