diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2015-11-17 18:50:53 (GMT) |
---|---|---|
committer | Jagan Teki <jteki@openedev.com> | 2015-11-17 18:56:26 (GMT) |
commit | 5168721e584e1fc104ccc3b1a027e8973a18f65b (patch) | |
tree | 087d36f2844e24a8784ddd7a661a15a163ac7f5e /drivers/mtd | |
parent | 7693fb37564422b2e0ec9717deab7ca51a093f4e (diff) | |
download | u-boot-5168721e584e1fc104ccc3b1a027e8973a18f65b.tar.xz |
sf: Add lock ops for SST SPI NOR flash
SST SPI NOR flash has the same locking programming bits
as ST Micro - added support for it.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
[Minor change on commit message]
Signed-off-by: Jagan Teki <jteki@openedev.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/spi/sf_internal.h | 1 | ||||
-rw-r--r-- | drivers/mtd/spi/sf_ops.c | 4 | ||||
-rw-r--r-- | drivers/mtd/spi/sf_probe.c | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h index 8793f18..85c8a89 100644 --- a/drivers/mtd/spi/sf_internal.h +++ b/drivers/mtd/spi/sf_internal.h @@ -64,6 +64,7 @@ enum spi_nor_option_flags { #define SPI_FLASH_CFI_MFR_SPANSION 0x01 #define SPI_FLASH_CFI_MFR_STMICRO 0x20 #define SPI_FLASH_CFI_MFR_MACRONIX 0xc2 +#define SPI_FLASH_CFI_MFR_SST 0xbf #define SPI_FLASH_CFI_MFR_WINBOND 0xef /* Erase commands */ diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c index 384224d..4065520 100644 --- a/drivers/mtd/spi/sf_ops.c +++ b/drivers/mtd/spi/sf_ops.c @@ -583,7 +583,7 @@ int sst_write_bp(struct spi_flash *flash, u32 offset, size_t len, } #endif -#ifdef CONFIG_SPI_FLASH_STMICRO +#if defined(CONFIG_SPI_FLASH_STMICRO) || defined(CONFIG_SPI_FLASH_SST) static void stm_get_locked_range(struct spi_flash *flash, u8 sr, loff_t *ofs, u32 *len) { @@ -750,4 +750,4 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len) return 0; } -#endif /* CONFIG_SPI_FLASH_STMICRO */ +#endif diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index bc05d30..52dace4 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -184,8 +184,9 @@ static int spi_flash_validate_params(struct spi_slave *spi, u8 *idcode, /* lock hooks are flash specific - assign them based on idcode0 */ switch (idcode[0]) { -#ifdef CONFIG_SPI_FLASH_STMICRO +#if defined(CONFIG_SPI_FLASH_STMICRO) || defined(CONFIG_SPI_FLASH_SST) case SPI_FLASH_CFI_MFR_STMICRO: + case SPI_FLASH_CFI_MFR_SST: flash->flash_lock = stm_lock; flash->flash_unlock = stm_unlock; flash->flash_is_locked = stm_is_locked; |