generic: 4.19: Add 4B_OPCODES flag to w25q256
authorRobert Marko <robimarko@gmail.com>
Tue, 10 Mar 2020 17:17:02 +0000 (18:17 +0100)
committerPetr Štetiar <ynezz@true.cz>
Thu, 12 Mar 2020 11:59:44 +0000 (12:59 +0100)
This patch backports the upstream patch that adds the 4B_OPCODES flag to w25q256 under 4.19 kernel.
This is needed for ipq40xx and ramips.

Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/generic/backport-4.19/464-v5.6-mtd-spi-nor-Add-4B_OPCODES-flag-to-w25q256.patch [new file with mode: 0644]
target/linux/generic/pending-4.19/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch
target/linux/generic/pending-4.19/465-m25p80-mx-disable-software-protection.patch
target/linux/generic/pending-4.19/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch
target/linux/generic/pending-4.19/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
target/linux/generic/pending-4.19/479-mtd-spi-nor-add-xtx-xt25f128b.patch
target/linux/ipq40xx/patches-4.19/087-v5.6-mtd-spi-nor-Add-4B_OPCODES-flag-to-w25q256.patch [deleted file]

diff --git a/target/linux/generic/backport-4.19/464-v5.6-mtd-spi-nor-Add-4B_OPCODES-flag-to-w25q256.patch b/target/linux/generic/backport-4.19/464-v5.6-mtd-spi-nor-Add-4B_OPCODES-flag-to-w25q256.patch
new file mode 100644 (file)
index 0000000..db9f379
--- /dev/null
@@ -0,0 +1,27 @@
+From 10050a02f7d508fa88f70fcfceefbacd13488ca7 Mon Sep 17 00:00:00 2001
+From: Robert Marko <robimarko@gmail.com>
+Date: Mon, 23 Dec 2019 17:05:49 +0200
+Subject: [PATCH] mtd: spi-nor: Add 4B_OPCODES flag to w25q256
+
+The w25q256 supports 4-byte opcodes so lets add the flag.
+Tested on OpenWrt under 4.19.82 kernel on 8devices Habanero.
+
+Signed-off-by: Robert Marko <robimarko@gmail.com>
+Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
+---
+ drivers/mtd/spi-nor/spi-nor.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/mtd/spi-nor/spi-nor.c
++++ b/drivers/mtd/spi-nor/spi-nor.c
+@@ -1244,7 +1244,9 @@ static const struct flash_info spi_nor_i
+       { "w25q80", INFO(0xef5014, 0, 64 * 1024,  16, SECT_4K) },
+       { "w25q80bl", INFO(0xef4014, 0, 64 * 1024,  16, SECT_4K) },
+       { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) },
+-      { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
++      { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512,
++                        SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
++                        SPI_NOR_4B_OPCODES) },
+       { "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024,
+                       SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_DUAL_READ) },
index 6981c6d9433938b2ef382d2084f4bef274ba1d70..4d64fca90b31a93f6bcb374115e702322ffe2031 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1457,7 +1457,7 @@ static int spi_nor_write(struct mtd_info
+@@ -1459,7 +1459,7 @@ static int spi_nor_write(struct mtd_info
  
                write_enable(nor);
                ret = nor->write(nor, addr, page_remain, buf + i);
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        goto write_err;
                written = ret;
  
-@@ -1466,13 +1466,6 @@ static int spi_nor_write(struct mtd_info
+@@ -1468,13 +1468,6 @@ static int spi_nor_write(struct mtd_info
                        goto write_err;
                *retlen += written;
                i += written;
index 0c5d6cfa63e479765707d7bee2ceefc8fef986b3..3172c223f27a27674a79d9d8b67bafbfc94a4d00 100644 (file)
@@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2735,6 +2735,7 @@ static int spi_nor_init(struct spi_nor *
+@@ -2737,6 +2737,7 @@ static int spi_nor_init(struct spi_nor *
         */
        if (JEDEC_MFR(nor->info) == SNOR_MFR_ATMEL ||
            JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
index fb6ae7df7b307f2ce7ff1ce6f7ecca1be6c0d3e5..f6a98af6ac48f7f091e04235cfba5a7f6ec782e5 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
 
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2737,6 +2737,7 @@ static int spi_nor_init(struct spi_nor *
+@@ -2739,6 +2739,7 @@ static int spi_nor_init(struct spi_nor *
            JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
            JEDEC_MFR(nor->info) == SNOR_MFR_MACRONIX ||
            JEDEC_MFR(nor->info) == SNOR_MFR_SST ||
@@ -25,7 +25,7 @@ Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
            nor->info->flags & SPI_NOR_HAS_LOCK) {
                write_enable(nor);
                write_sr(nor, 0);
-@@ -2873,7 +2874,8 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -2875,7 +2876,8 @@ int spi_nor_scan(struct spi_nor *nor, co
  
        /* NOR protection support for STmicro/Micron chips and similar */
        if (JEDEC_MFR(info) == SNOR_MFR_MICRON ||
index 12d785856a4e178d2e5641e9b6392b92cdd43632..695c38cf0f795fe83e4511d876292be3daf3d0e9 100644 (file)
@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110)
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2649,10 +2649,12 @@ static int spi_nor_select_erase(struct s
+@@ -2651,10 +2651,12 @@ static int spi_nor_select_erase(struct s
  
  #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
        /* prefer "small sector" erase if possible */
index 664837928b65b78360e0c2162c3581a39defcc71..da60939bb315cdd772253fe279128eeda84edf1d 100644 (file)
@@ -30,7 +30,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1273,6 +1273,9 @@ static const struct flash_info spi_nor_i
+@@ -1275,6 +1275,9 @@ static const struct flash_info spi_nor_i
        /* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */
        { "XM25QH64A", INFO(0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
        { "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
diff --git a/target/linux/ipq40xx/patches-4.19/087-v5.6-mtd-spi-nor-Add-4B_OPCODES-flag-to-w25q256.patch b/target/linux/ipq40xx/patches-4.19/087-v5.6-mtd-spi-nor-Add-4B_OPCODES-flag-to-w25q256.patch
deleted file mode 100644 (file)
index 8730bb4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From 10050a02f7d508fa88f70fcfceefbacd13488ca7 Mon Sep 17 00:00:00 2001
-From: Robert Marko <robimarko@gmail.com>
-Date: Mon, 23 Dec 2019 17:05:49 +0200
-Subject: [PATCH] mtd: spi-nor: Add 4B_OPCODES flag to w25q256
-
-The w25q256 supports 4-byte opcodes so lets add the flag.
-Tested on OpenWrt under 4.19.82 kernel on 8devices Habanero.
-
-Signed-off-by: Robert Marko <robimarko@gmail.com>
-Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
----
- drivers/mtd/spi-nor/spi-nor.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1257,7 +1257,9 @@ static const struct flash_info spi_nor_i
-       { "w25q80", INFO(0xef5014, 0, 64 * 1024,  16, SECT_4K) },
-       { "w25q80bl", INFO(0xef4014, 0, 64 * 1024,  16, SECT_4K) },
-       { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) },
--      { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
-+      { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512,
-+                        SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
-+                        SPI_NOR_4B_OPCODES) },
-       { "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024,
-                       SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_DUAL_READ) },