From f8dc4617128f72cdcef4aae33afd665d3fbc5a2f Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Wed, 20 Dec 2017 14:37:31 -0500 Subject: ec_flash: Add W25Q128 SPI flash Add W25Q128 flash device support. BRANCH=none BUG= TEST=Modify a board build for W25Q128 and check SPI code sets flash security bits correctly. Change-Id: I6173f4cf751f3fbf68af75983f44d357a0b954f6 Signed-off-by: Scott Worley --- common/spi_flash_reg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'common/spi_flash_reg.c') diff --git a/common/spi_flash_reg.c b/common/spi_flash_reg.c index 2e9fbbd469..1301e19dc5 100644 --- a/common/spi_flash_reg.c +++ b/common/spi_flash_reg.c @@ -72,7 +72,14 @@ static const struct protect_range spi_flash_protect_ranges[] = { { 0, 0, 1, { 0, 1, 1 }, 0, 0x40000 }, /* Lower 1/4 */ { 0, 0, 1, { 1, 0, 0 }, 0, 0x80000 }, /* Lower 1/2 */ }; - +#elif defined(CONFIG_SPI_FLASH_W25Q128) +static const struct protect_range spi_flash_protect_ranges[] = { + /* CMP = 0 */ + { 0, X, X, { 0, 0, 0 }, 0, 0 }, /* No protection */ + { 0, 0, 1, { 1, 0, 0 }, 0, 0x20000 }, /* Lower 1/8 */ + { 0, 0, 1, { 1, 0, 1 }, 0, 0x40000 }, /* Lower 1/4 */ + { 0, 0, 1, { 1, 1, 0 }, 0, 0x80000 }, /* Lower 1/2 */ +}; #endif /** -- cgit v1.2.1