summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-07-07 20:56:56 +0200
committerWolfgang Denk <wd@denx.de>2009-07-07 20:56:56 +0200
commitbc1bdab9403c2f3b12c6316d0310f46d31098964 (patch)
treee3ad25e9bc427f52b94a130b30ffc37285a2531c
parent73e1140b4929c92f7715bbc64ee8553815bb43aa (diff)
parent2efee52b09657e9353655b9dae9e1d1a67a2abe4 (diff)
downloadu-boot-imx-bc1bdab9403c2f3b12c6316d0310f46d31098964.zip
u-boot-imx-bc1bdab9403c2f3b12c6316d0310f46d31098964.tar.gz
u-boot-imx-bc1bdab9403c2f3b12c6316d0310f46d31098964.tar.bz2
Merge branch 'sf' of git://git.denx.de/u-boot-blackfin
-rw-r--r--drivers/mtd/spi/macronix.c49
-rw-r--r--drivers/mtd/spi/sst.c24
2 files changed, 57 insertions, 16 deletions
diff --git a/drivers/mtd/spi/macronix.c b/drivers/mtd/spi/macronix.c
index 9464c84..fe1310b 100644
--- a/drivers/mtd/spi/macronix.c
+++ b/drivers/mtd/spi/macronix.c
@@ -49,18 +49,10 @@
#define CMD_MX25XX_DP 0xb9 /* Deep Power-down */
#define CMD_MX25XX_RES 0xab /* Release from DP, and Read Signature */
-#define MXIC_ID_MX2516 0x15
-#define MXIC_ID_MX2520 0x12
-#define MXIC_ID_MX2532 0x16
-#define MXIC_ID_MX2540 0x13
-#define MXIC_ID_MX2564 0x17
-#define MXIC_ID_MX2580 0x14
-#define MXIC_ID_MX25128 0x18
-
#define MACRONIX_SR_WIP (1 << 0) /* Write-in-Progress */
struct macronix_spi_flash_params {
- u8 idcode1;
+ u16 idcode;
u16 page_size;
u16 pages_per_sector;
u16 sectors_per_block;
@@ -81,13 +73,45 @@ static inline struct macronix_spi_flash *to_macronix_spi_flash(struct spi_flash
static const struct macronix_spi_flash_params macronix_spi_flash_table[] = {
{
- .idcode1 = MXIC_ID_MX25128,
+ .idcode = 0x2015,
+ .page_size = 256,
+ .pages_per_sector = 16,
+ .sectors_per_block = 16,
+ .nr_blocks = 32,
+ .name = "MX25L1605D",
+ },
+ {
+ .idcode = 0x2016,
+ .page_size = 256,
+ .pages_per_sector = 16,
+ .sectors_per_block = 16,
+ .nr_blocks = 64,
+ .name = "MX25L3205D",
+ },
+ {
+ .idcode = 0x2017,
+ .page_size = 256,
+ .pages_per_sector = 16,
+ .sectors_per_block = 16,
+ .nr_blocks = 128,
+ .name = "MX25L6405D",
+ },
+ {
+ .idcode = 0x2018,
.page_size = 256,
.pages_per_sector = 16,
.sectors_per_block = 16,
.nr_blocks = 256,
.name = "MX25L12805D",
},
+ {
+ .idcode = 0x2618,
+ .page_size = 256,
+ .pages_per_sector = 16,
+ .sectors_per_block = 16,
+ .nr_blocks = 256,
+ .name = "MX25L12855E",
+ },
};
static int macronix_wait_ready(struct spi_flash *flash, unsigned long timeout)
@@ -277,15 +301,16 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
const struct macronix_spi_flash_params *params;
struct macronix_spi_flash *mcx;
unsigned int i;
+ u16 id = idcode[2] | idcode[1] << 8;
for (i = 0; i < ARRAY_SIZE(macronix_spi_flash_table); i++) {
params = &macronix_spi_flash_table[i];
- if (params->idcode1 == idcode[2])
+ if (params->idcode == id)
break;
}
if (i == ARRAY_SIZE(macronix_spi_flash_table)) {
- debug("SF: Unsupported Macronix ID %02x\n", idcode[1]);
+ debug("SF: Unsupported Macronix ID %04x\n", id);
return NULL;
}
diff --git a/drivers/mtd/spi/sst.c b/drivers/mtd/spi/sst.c
index 62236d4..50e9299 100644
--- a/drivers/mtd/spi/sst.c
+++ b/drivers/mtd/spi/sst.c
@@ -55,20 +55,36 @@ static inline struct sst_spi_flash *to_sst_spi_flash(struct spi_flash *flash)
#define SST_SECTOR_SIZE (4 * 1024)
static const struct sst_spi_flash_params sst_spi_flash_table[] = {
{
- .idcode1 = 0x01,
+ .idcode1 = 0x8d,
.nr_sectors = 128,
+ .name = "SST25VF040B",
+ },{
+ .idcode1 = 0x8e,
+ .nr_sectors = 256,
+ .name = "SST25VF080B",
+ },{
+ .idcode1 = 0x41,
+ .nr_sectors = 512,
+ .name = "SST25VF016B",
+ },{
+ .idcode1 = 0x4a,
+ .nr_sectors = 1024,
+ .name = "SST25VF032B",
+ },{
+ .idcode1 = 0x01,
+ .nr_sectors = 16,
.name = "SST25WF512",
},{
.idcode1 = 0x02,
- .nr_sectors = 256,
+ .nr_sectors = 32,
.name = "SST25WF010",
},{
.idcode1 = 0x03,
- .nr_sectors = 512,
+ .nr_sectors = 64,
.name = "SST25WF020",
},{
.idcode1 = 0x04,
- .nr_sectors = 1024,
+ .nr_sectors = 128,
.name = "SST25WF040",
},
};