sf: add driver for SST flashes
PATCH 1/1 sf: add driver for SST flashes
Signed-off-by Mike Frysinger <[email protected]>
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
@@ -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
@@ -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
@@ -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
PATCH 1/1 sf: add driver for SST flashes
Quoted 2 lines · Mike Frysinger
Signed-off-by Mike Frysinger <[email protected]>CC Haavard Skinnemoen <[email protected]>
Looks good to me.
PATCH v2 1/1 sf: add driver for SST flashes
In reply to Mike FrysingerSigned-off-by Mike Frysinger <[email protected]>
---
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
@@ -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
@@ -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
@@ -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