]> git.sur5r.net Git - u-boot/commitdiff
sf: Add lock ops for SST SPI NOR flash
authorFabio Estevam <fabio.estevam@freescale.com>
Tue, 17 Nov 2015 18:50:53 +0000 (16:50 -0200)
committerJagan Teki <jteki@openedev.com>
Tue, 17 Nov 2015 18:56:26 +0000 (00:26 +0530)
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>
drivers/mtd/spi/sf_internal.h
drivers/mtd/spi/sf_ops.c
drivers/mtd/spi/sf_probe.c

index 8793f1865a39afbb79ad8f6e4f6720e61866f859..85c8a89ceef6bb6ee31081d0b04cf9b2b5514e13 100644 (file)
@@ -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 */
index 384224d75a74b6dc4b51ce3de32c86043fe9cb85..4065520726dc449b1052a2181873071314e2c2e5 100644 (file)
@@ -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
index bc05d3022119cca4f480f26e631414f9d4be9b78..52dace42eeaa1a6858879a4ce262170eb29de4ec 100644 (file)
@@ -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;