[U-Boot] [PATCH 11/12] sf: probe: Add support for S25FL* flash parts

Jagannadha Sutradharudu Teki jagannadha.sutradharudu-teki at xilinx.com
Sun Aug 4 23:20:34 CEST 2013


All SPANSION S25FL* flash parts are taken from spi_flash_probe_legacy.c.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna at xilinx.com>
---
 drivers/mtd/spi/spi_flash_probe.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c b/drivers/mtd/spi/spi_flash_probe.c
index 3ffc94f..054c166 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -51,6 +51,19 @@ static const struct {
 	{"EN25Q32B",		0x1c3016, 0x0,	  64 * 1024,	64},
 	{"EN25Q128B",		0x1c3018, 0x0,    64 * 1024,	256},
 
+	/* SPANSION */
+	{"S25FL008A",		0x010213, 0x0,	  256 * 256,	16},
+	{"S25FL016A",		0x010214, 0x0,	  256 * 256,	32},
+	{"S25FL032A",		0x010215, 0x0,	  256 * 256,	64},
+	{"S25FL064A",		0x010216, 0x0,	  256 * 256,	128},
+	{"S25FL128P_64K",	0x012018, 0x0301, 256 * 256,	256},
+	{"S25FL128P_256K",	0x012018, 0x0300, 256 * 1024,	64},
+	{"S25FL032P",		0x010215, 0x4d00, 256 * 256,	64},
+	{"S25FL064P",		0x010216, 0x4d00, 256 * 256,	128},
+	{"S25FL128S_64K",	0x012018, 0x4d01, 256 * 256,	256},
+	{"S25FL256S_64K",	0x010219, 0x4d01, 256 * 256,	512},
+	{"S25FL512S_64K",	0x010220, 0x4d01, 256 * 256,	1024},
+
 	/* STMICRO */
 	{"M25P10",		0x202011, 0x0,    32 * 1024,    4},
 	{"M25P20",		0x202012, 0x0,    64 * 1024,    4},
@@ -95,6 +108,7 @@ static const struct {
 	/*
 	 * Note:
 	 * Below paired flash devices has similar spi_flash_ids attributes.
+	 * (S25FL129P_64K, S25FL128S_64K)
 	 * (W25Q80BL, W25Q80BV)
 	 * (W25Q16CL, W25Q16DV)
 	 * (W25Q32BV, W25Q32FV_SPI)
@@ -108,7 +122,6 @@ static const struct {
 	 * TODO:
 	 * ATMEL
 	 * RAMTRON
-	 * SPANSION
 	 * SST
 	 * non-JEDEC ID's
 	 */
@@ -119,18 +132,23 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave *spi, u8 *idcode)
 	struct spi_flash *flash;
 	int i;
 	u16 jedec = idcode[1] << 8 | idcode[2];
+	u16 ext_jedec = idcode[3] << 8 | idcode[4];
 
 	/* Get the flash id (jedec = manuf_id + dev_id) */
 	for (i = 0; i < ARRAY_SIZE(spi_flash_ids); i++) {
 		if ((spi_flash_ids[i].jedec >> 16) == idcode[0]) {
-			if (((spi_flash_ids[i].jedec << 16) >> 16) == jedec)
+			if (((spi_flash_ids[i].jedec << 16) >> 16) == jedec) {
+				if ((spi_flash_ids[i].ext_jedec != 0x0) &&
+				    (spi_flash_ids[i].ext_jedec == ext_jedec))
+					continue;
 				break;
+			}
 		}
 	}
 
 	if (i == ARRAY_SIZE(spi_flash_ids)) {
-		printf("SF: Unsupported flash ID: manuf %02x, jedec %04x\n",
-		       idcode[0], jedec);
+		printf("SF: Unsupported flash ID: manuf %02x, jedec %04x, "
+		       "ext_jedec %04x\n", idcode[0], jedec, ext_jedec);
 		return NULL;
 	}
 
-- 
1.8.3




More information about the U-Boot mailing list