Skip to contentSkip to conversation

sf: add driver for SST flashes

PATCH Superseded Mike Frysinger 2 participants 3 messages Mar 28, 2009 – Mar 29, 2009 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sf: add driver for SST flashes

CC Haavard Skinnemoen <[email protected]>
---
 drivers/mtd/spi/Makefile             |    1 +
 drivers/mtd/spi/spi_flash.c          |    5 +
 drivers/mtd/spi/spi_flash_internal.h |    1 +
 drivers/mtd/spi/sst.c                |  350 ++++++++++++++++++++++++++++++++++
 4 files changed, 357 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/sst.c
drivers/mtd/spi/Makefile +1 -0
index 3d4f892..a8fd68f 100644
@@ -27,6 +27,7 @@ LIB	:= $(obj)libspi_flash.a
 
 COBJS-$(CONFIG_SPI_FLASH)	+= spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)	+= atmel.o
+COBJS-$(CONFIG_SPI_FLASH_SST)	+= sst.o
 COBJS-$(CONFIG_SPI_FLASH_STMICRO)	+= stmicro.o
 
 COBJS	:= $(COBJS-y)
drivers/mtd/spi/spi_flash.c +5 -0
index d1d81af..1902960 100644
@@ -139,6 +139,11 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
 		flash = spi_flash_probe_stmicro(spi, idcode);
 		break;
 #endif
+#ifdef CONFIG_SPI_FLASH_SST
+	case 0xBF:
+		flash = spi_flash_probe_sst(spi, idcode);
+		break;
+#endif
 	default:
 		debug("SF: Unsupported manufacturer %02X\n", idcode[0]);
 		flash = NULL;
drivers/mtd/spi/spi_flash_internal.h +1 -0
index 75f5900..2d020c3 100644
@@ -43,4 +43,5 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
 /* Manufacturer-specific probe functions */
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode);
+struct spi_flash *spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode);
drivers/mtd/spi/sst.c new file +350 -0

350 lines not on this page · raw message

Signature · 1 line
1.6.2
#2 lore raw

PATCH v2 1/1 sf: add driver for SST flashes

In reply to Mike Frysinger

---
v2
- fix handling of leading/trailing 1 byte edge cases

 drivers/mtd/spi/Makefile             |    1 +
 drivers/mtd/spi/spi_flash.c          |    5 +
 drivers/mtd/spi/spi_flash_internal.h |    1 +
 drivers/mtd/spi/sst.c                |  358 ++++++++++++++++++++++++++++++++++
 4 files changed, 365 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/sst.c
drivers/mtd/spi/Makefile +1 -0
index 6ca6073..a71b16e 100644
@@ -28,6 +28,7 @@ LIB	:= $(obj)libspi_flash.a
 COBJS-$(CONFIG_SPI_FLASH)	+= spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)	+= atmel.o
 COBJS-$(CONFIG_SPI_FLASH_SPANSION)	+= spansion.o
+COBJS-$(CONFIG_SPI_FLASH_SST)	+= sst.o
 COBJS-$(CONFIG_SPI_FLASH_STMICRO)	+= stmicro.o
 
 COBJS	:= $(COBJS-y)
drivers/mtd/spi/spi_flash.c +5 -0
index d1d81af..1902960 100644
@@ -139,6 +139,11 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
 		flash = spi_flash_probe_stmicro(spi, idcode);
 		break;
 #endif
+#ifdef CONFIG_SPI_FLASH_SST
+	case 0xBF:
+		flash = spi_flash_probe_sst(spi, idcode);
+		break;
+#endif
 	default:
 		debug("SF: Unsupported manufacturer %02X\n", idcode[0]);
 		flash = NULL;
drivers/mtd/spi/spi_flash_internal.h +1 -0
index 75f5900..2d020c3 100644
@@ -43,4 +43,5 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
 /* Manufacturer-specific probe functions */
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode);
+struct spi_flash *spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode);
drivers/mtd/spi/sst.c new file +358 -0

358 lines not on this page · raw message

Signature · 1 line
1.6.2