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 <scott.worley@microchip.corp-partner.google.com>
This commit is contained in:
Scott Worley
2017-12-20 14:37:31 -05:00
committed by chrome-bot
parent 940dd625b9
commit f8dc461712
3 changed files with 14 additions and 1 deletions

View File

@@ -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
/**

View File

@@ -2253,6 +2253,7 @@
/* Select any of the following SPI flash configs that your board uses. */
#undef CONFIG_SPI_FLASH_GD25LQ40
#undef CONFIG_SPI_FLASH_GD25Q41B
#undef CONFIG_SPI_FLASH_W25Q128
#undef CONFIG_SPI_FLASH_W25Q40
#undef CONFIG_SPI_FLASH_W25Q64
#undef CONFIG_SPI_FLASH_W25Q80

View File

@@ -38,6 +38,11 @@
#define CONFIG_SPI_FLASH_HAS_SR2
#endif
/* W25Q128 16 Mbyte SPI flash for testing */
#ifdef CONFIG_SPI_FLASH_W25Q128
#define CONFIG_SPI_FLASH_HAS_SR2
#endif
/**
* Computes block write protection range from registers
* Returns start == len == 0 for no protection