generic: mtd: backport SPI_NOR_HAS_LOCK
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.4 / 1111-mtd-spi-nor-disable-4kb-sector-erase-for-s25fl128.patch
1 From 30d34abc80b0a602a1327bdfbddd42d250887049 Mon Sep 17 00:00:00 2001
2 From: Yutang Jiang <yutang.jiang@nxp.com>
3 Date: Fri, 9 Sep 2016 22:56:12 +0800
4 Subject: [PATCH 111/113] mtd: spi-nor: disable 4kb sector erase for s25fl128
5
6 As for s25fl128s flash, the sectors are organized either as a hybrid
7 combination of 4-kB and 64-kB sectors, or as uniform 256-kbyte sectors.
8 we should use the command 0xd8 to erase all bits, not the Parameter 4-kB
9 Sector Erase (P4E) command 0x20.
10
11 Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
12 Integrated-by: Yutang Jiang <yutang.jiang@nxp.com>
13 ---
14 drivers/mtd/spi-nor/spi-nor.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17 --- a/drivers/mtd/spi-nor/spi-nor.c
18 +++ b/drivers/mtd/spi-nor/spi-nor.c
19 @@ -804,7 +804,7 @@ static const struct flash_info spi_nor_i
20 { "s70fl01gs", INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) },
21 { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) },
22 { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) },
23 - { "s25fl128s", INFO6(0x012018, 0x4d0180, 64 * 1024, 256, SECT_4K | SPI_NOR_QUAD_READ
24 + { "s25fl128s", INFO6(0x012018, 0x4d0180, 64 * 1024, 256, SPI_NOR_QUAD_READ
25 | SPI_NOR_DDR_QUAD_READ) },
26 { "s25fl129p0", INFO(0x012018, 0x4d00, 256 * 1024, 64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
27 { "s25fl129p1", INFO(0x012018, 0x4d01, 64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },