]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mtd/spi/spansion.c
Merge branch 'master' of git://git.denx.de/u-boot-video
[karo-tx-uboot.git] / drivers / mtd / spi / spansion.c
index 32b76e0e9072196802b75963293f7ca2fddca106..dad30b54c54e97547f13c14039483da30e1eb409 100644 (file)
@@ -94,10 +94,10 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
                .idcode2 = 0x4d01,
                .pages_per_sector = 256,
                .nr_sectors = 256,
-               .name = "S25FL129P_64K",
+               .name = "S25FL129P_64K/S25FL128S",
        },
        {
-               .idcode1 = 0x2019,
+               .idcode1 = 0x0219,
                .idcode2 = 0x4d01,
                .pages_per_sector = 256,
                .nr_sectors = 512,
@@ -128,18 +128,12 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
                return NULL;
        }
 
-       flash = malloc(sizeof(*flash));
+       flash = spi_flash_alloc_base(spi, params->name);
        if (!flash) {
                debug("SF: Failed to allocate memory\n");
                return NULL;
        }
 
-       flash->spi = spi;
-       flash->name = params->name;
-
-       flash->write = spi_flash_cmd_write_multi;
-       flash->erase = spi_flash_cmd_erase;
-       flash->read = spi_flash_cmd_read_fast;
        flash->page_size = 256;
        flash->sector_size = 256 * params->pages_per_sector;
        flash->size = flash->sector_size * params->nr_sectors;