]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Merge branch 'sf' of git://git.denx.de/u-boot-blackfin
authorWolfgang Denk <wd@denx.de>
Sat, 1 Sep 2012 10:22:31 +0000 (12:22 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 1 Sep 2012 10:22:31 +0000 (12:22 +0200)
* 'sf' of git://git.denx.de/u-boot-blackfin:
  sf: spansion: Add support for S25FL256S
  sf: winbond: fix page_size
  sf: stmicro: add support for N25Q128A
  sf: stmicro: add support N25Q128 parts
  sf: stmicro: support JEDEC standard two-byte signature
  sf: winbond: add W25Q32
  cmd_spi: remove superfluous semicolon

Signed-off-by: Wolfgang Denk <wd@denx.de>
common/cmd_spi.c
drivers/mtd/spi/spansion.c
drivers/mtd/spi/stmicro.c
drivers/mtd/spi/winbond.c

index 8c623c9fcf5a72da3fa0c324dbaabdfeb49cebb1..eba5fb83da4f54d66c8f64f9de9df12d252c9222 100644 (file)
@@ -89,7 +89,7 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                cs = bus;
                                bus = CONFIG_DEFAULT_SPI_BUS;
                        }
-                       if (*cp == '.');
+                       if (*cp == '.')
                                mode = simple_strtoul(cp+1, NULL, 10);
                }
                if (argc >= 3)
index 9a114ac6a1f48da45d7855ccfe47d6fcc066ebd5..32b76e0e9072196802b75963293f7ca2fddca106 100644 (file)
@@ -96,6 +96,13 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
                .nr_sectors = 256,
                .name = "S25FL129P_64K",
        },
+       {
+               .idcode1 = 0x2019,
+               .idcode2 = 0x4d01,
+               .pages_per_sector = 256,
+               .nr_sectors = 512,
+               .name = "S25FL256S",
+       },
 };
 
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
index dbd1fc185432807662f8896d2a83fbfaaabf79e7..30b626a39f8923a398f575cbbdb70abff2fb35f9 100644 (file)
@@ -37,7 +37,7 @@
 #define CMD_M25PXX_RES         0xab    /* Release from DP, and Read Signature */
 
 struct stmicro_spi_flash_params {
-       u8 idcode1;
+       u16 id;
        u16 pages_per_sector;
        u16 nr_sectors;
        const char *name;
@@ -45,55 +45,67 @@ struct stmicro_spi_flash_params {
 
 static const struct stmicro_spi_flash_params stmicro_spi_flash_table[] = {
        {
-               .idcode1 = 0x11,
+               .id = 0x2011,
                .pages_per_sector = 128,
                .nr_sectors = 4,
                .name = "M25P10",
        },
        {
-               .idcode1 = 0x15,
+               .id = 0x2015,
                .pages_per_sector = 256,
                .nr_sectors = 32,
                .name = "M25P16",
        },
        {
-               .idcode1 = 0x12,
+               .id = 0x2012,
                .pages_per_sector = 256,
                .nr_sectors = 4,
                .name = "M25P20",
        },
        {
-               .idcode1 = 0x16,
+               .id = 0x2016,
                .pages_per_sector = 256,
                .nr_sectors = 64,
                .name = "M25P32",
        },
        {
-               .idcode1 = 0x13,
+               .id = 0x2013,
                .pages_per_sector = 256,
                .nr_sectors = 8,
                .name = "M25P40",
        },
        {
-               .idcode1 = 0x17,
+               .id = 0x2017,
                .pages_per_sector = 256,
                .nr_sectors = 128,
                .name = "M25P64",
        },
        {
-               .idcode1 = 0x14,
+               .id = 0x2014,
                .pages_per_sector = 256,
                .nr_sectors = 16,
                .name = "M25P80",
        },
        {
-               .idcode1 = 0x18,
+               .id = 0x2018,
                .pages_per_sector = 1024,
                .nr_sectors = 64,
                .name = "M25P128",
        },
        {
-               .idcode1 = 0x19,
+               .id = 0xba18,
+               .pages_per_sector = 256,
+               .nr_sectors = 256,
+               .name = "N25Q128",
+       },
+       {
+               .id = 0xbb18,
+               .pages_per_sector = 256,
+               .nr_sectors = 256,
+               .name = "N25Q128A",
+       },
+       {
+               .id = 0xba19,
                .pages_per_sector = 256,
                .nr_sectors = 512,
                .name = "N25Q256",
@@ -105,6 +117,7 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
        const struct stmicro_spi_flash_params *params;
        struct spi_flash *flash;
        unsigned int i;
+       u16 id;
 
        if (idcode[0] == 0xff) {
                i = spi_flash_cmd(spi, CMD_M25PXX_RES,
@@ -119,15 +132,17 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
                        return NULL;
        }
 
+       id = ((idcode[1] << 8) | idcode[2]);
+
        for (i = 0; i < ARRAY_SIZE(stmicro_spi_flash_table); i++) {
                params = &stmicro_spi_flash_table[i];
-               if (params->idcode1 == idcode[2]) {
+               if (params->id == id) {
                        break;
                }
        }
 
        if (i == ARRAY_SIZE(stmicro_spi_flash_table)) {
-               debug("SF: Unsupported STMicro ID %02x\n", idcode[1]);
+               debug("SF: Unsupported STMicro ID %04x\n", id);
                return NULL;
        }
 
index 427b71fcdcd4f78fdd79e05263cf3767d5117cfb..f6aab3d32f459d82d0a9e606f4382fe67981160f 100644 (file)
@@ -62,6 +62,11 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
                .nr_blocks              = 256,
                .name                   = "W25Q128",
        },
+       {
+               .id                     = 0x5014,
+               .nr_blocks              = 128,
+               .name                   = "W25Q80",
+       },
 };
 
 struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
@@ -94,7 +99,7 @@ struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
        flash->write = spi_flash_cmd_write_multi;
        flash->erase = spi_flash_cmd_erase;
        flash->read = spi_flash_cmd_read_fast;
-       flash->page_size = 4096;
+       flash->page_size = 256;
        flash->sector_size = 4096;
        flash->size = 4096 * 16 * params->nr_blocks;