[U-Boot] [PATCH v3 07/28] sf: probe: Add support for W25* flash parts

Sascha Silbe t-uboot at infra-silbe.de
Sat Sep 21 20:54:50 CEST 2013


Jagannadha Sutradharudu Teki <jagannadha.sutradharudu-teki at xilinx.com>
writes:

> Added W25* parts are which are avilable in spi_flash_probe_legacy.c.
>
> Updated the sector_size attributes as per the flash parts.
> Looks fine for with this sector_size for computing the size
> of flash.


This breaks sector-sized (i.e. 4KiB) erases on W25Q32BV (and many other
Winbond chips). The sizes are set differently by the old code and yours:

                  old     yours
page_size          256      256
sector_size          4K      64K
size                 4M       4M


The data sheet defines three different granularities: pages (256B, used
for writing), sectors (4KiB, used for erasing), blocks (64KiB, used for
write protection in some configurations). You seem to have mixed sectors
and blocks. The total size is the same, but sector-sized erases stop
working.

With the following change, my (rather simple) test cases work again:


diff --git i/drivers/mtd/spi/spi_flash_probe.c w/drivers/mtd/spi/spi_flash_probe.c
index 1ff3b60..6f13484 100644
--- i/drivers/mtd/spi/spi_flash_probe.c
+++ w/drivers/mtd/spi/spi_flash_probe.c
@@ -85,7 +85,7 @@ static const struct spi_flash_params spi_flash_params_table[] = {
        {"W25X64",              0xef3017, 0x0,     64 * 1024,    128},
        {"W25Q80BL",            0xef4014, 0x0,     64 * 1024,     16},
        {"W25Q16CL",            0xef4015, 0x0,     64 * 1024,     32},
-       {"W25Q32BV",            0xef4016, 0x0,     64 * 1024,     64},
+       {"W25Q32BV",            0xef4016, 0x0,      4 * 1024,   1024},
        {"W25Q64CV",            0xef4017, 0x0,     64 * 1024,    128},
        {"W25Q128BV",           0xef4018, 0x0,     64 * 1024,    256},
        {"W25Q256",             0xef4019, 0x0,     64 * 1024,    512},


The other chips will need similar changes.

Sascha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130921/657eb526/attachment.pgp>


More information about the U-Boot mailing list