[OpenWrt-Devel] [PATCH openwrt-18.06] kernel: Add support for Winbond w25q128jv SPI NOR flash
Baptiste Jonglez
baptiste at bitsofnetworks.org
Thu Oct 18 05:08:20 EDT 2018
From: Baptiste Jonglez <git at bitsofnetworks.org>
Newer batches of several Mikrotik boards contain this yet-unsupported
flash chip, for instance:
- rb941-2nd (hAP lite)
- rb952ui-5ac2nd (hAP ac lite)
- RBM33G
and probably other Mikrotik boards need this patch as well.
The patch was submitted upstream by Robert Marko: https://patchwork.ozlabs.org/patch/934181/
Closes: FS#1715
Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
Cc: Robert Marko <robimarko at gmail.com>
---
...mtd-spi-nor-Add-Winbond-w25q128jv-support.patch | 34 ++++++++++++++++++++++
...-Add-support-for-XM25QH64A-and-XM25QH128A.patch | 2 +-
...mtd-spi-nor-Add-Winbond-w25q128jv-support.patch | 34 ++++++++++++++++++++++
...-Add-support-for-XM25QH64A-and-XM25QH128A.patch | 2 +-
...53-mtd-spi-nor-add-w25q256-3b-mode-switch.patch | 12 ++++----
5 files changed, 76 insertions(+), 8 deletions(-)
create mode 100644 target/linux/generic/pending-4.14/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
create mode 100644 target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
diff --git a/target/linux/generic/pending-4.14/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch b/target/linux/generic/pending-4.14/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
new file mode 100644
index 0000000000..e3cc699e42
--- /dev/null
+++ b/target/linux/generic/pending-4.14/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
@@ -0,0 +1,34 @@
+From: Robert Marko <robimarko at gmail.com>
+To: linux-mtd at lists.infradead.org
+Subject: mtd: spi-nor: Add Winbond w25q128jv support
+Date: Mon, 25 Jun 2018 13:17:48 +0200
+
+Datasheet:
+http://www.winbond.com/resource-files/w25q128jv%20revf%2003272018%20plus.pdf
+
+Testing done on Mikrotik Routerboard wAP R board.
+It does not support Dual or Quad modes.
+
+Signed-off-by: Robert Marko <robimarko at gmail.com>
+---
+
+Changes in v2:
+ - Correct the title
+---
+ drivers/mtd/spi-nor/spi-nor.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/mtd/spi-nor/spi-nor.c
++++ b/drivers/mtd/spi-nor/spi-nor.c
+@@ -1159,6 +1159,11 @@ static const struct flash_info spi_nor_i
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+ SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
+ },
++ {
++ "w25q128jv", INFO(0xef7018, 0, 64 * 1024, 256,
++ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
++ SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
++ },
+ { "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) },
diff --git a/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch b/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch
index b7361d2ab5..69bade0cf8 100644
--- a/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch
+++ b/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch
@@ -17,7 +17,7 @@ Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1181,6 +1181,10 @@ static const struct flash_info spi_nor_i
+@@ -1186,6 +1186,10 @@ static const struct flash_info spi_nor_i
{ "3S400AN", S3AN_INFO(0x1f2400, 256, 264) },
{ "3S700AN", S3AN_INFO(0x1f2500, 512, 264) },
{ "3S1400AN", S3AN_INFO(0x1f2600, 512, 528) },
diff --git a/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch b/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
new file mode 100644
index 0000000000..87f0325fbc
--- /dev/null
+++ b/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
@@ -0,0 +1,34 @@
+From: Robert Marko <robimarko at gmail.com>
+To: linux-mtd at lists.infradead.org
+Subject: mtd: spi-nor: Add Winbond w25q128jv support
+Date: Mon, 25 Jun 2018 13:17:48 +0200
+
+Datasheet:
+http://www.winbond.com/resource-files/w25q128jv%20revf%2003272018%20plus.pdf
+
+Testing done on Mikrotik Routerboard wAP R board.
+It does not support Dual or Quad modes.
+
+Signed-off-by: Robert Marko <robimarko at gmail.com>
+---
+
+Changes in v2:
+ - Correct the title
+---
+ drivers/mtd/spi-nor/spi-nor.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/mtd/spi-nor/spi-nor.c
++++ b/drivers/mtd/spi-nor/spi-nor.c
+@@ -1146,6 +1146,11 @@ static const struct flash_info spi_nor_i
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+ SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
+ },
++ {
++ "w25q128jv", INFO(0xef7018, 0, 64 * 1024, 256,
++ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
++ SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
++ },
+ { "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) },
diff --git a/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch b/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch
index 585d678815..39e78b2343 100644
--- a/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch
+++ b/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch
@@ -17,7 +17,7 @@ Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1166,6 +1166,10 @@ static const struct flash_info spi_nor_i
+@@ -1171,6 +1171,10 @@ static const struct flash_info spi_nor_i
{ "3S400AN", S3AN_INFO(0x1f2400, 256, 264) },
{ "3S700AN", S3AN_INFO(0x1f2500, 512, 264) },
{ "3S1400AN", S3AN_INFO(0x1f2600, 512, 528) },
diff --git a/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch b/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
index 2e7cc33c8f..ff13b8f608 100644
--- a/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
+++ b/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
@@ -116,7 +116,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK);
return ret;
-@@ -1164,7 +1216,7 @@ static const struct flash_info spi_nor_i
+@@ -1169,7 +1221,7 @@ 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) },
@@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
{ "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024,
SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_DUAL_READ) },
-@@ -1224,6 +1276,9 @@ static int spi_nor_read(struct mtd_info
+@@ -1229,6 +1281,9 @@ static int spi_nor_read(struct mtd_info
if (ret)
return ret;
@@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
while (len) {
loff_t addr = from;
-@@ -1248,6 +1303,18 @@ static int spi_nor_read(struct mtd_info
+@@ -1253,6 +1308,18 @@ static int spi_nor_read(struct mtd_info
ret = 0;
read_err:
@@ -154,7 +154,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ);
return ret;
}
-@@ -1349,6 +1416,10 @@ static int spi_nor_write(struct mtd_info
+@@ -1354,6 +1421,10 @@ static int spi_nor_write(struct mtd_info
if (ret)
return ret;
@@ -165,7 +165,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
for (i = 0; i < len; ) {
ssize_t written;
loff_t addr = to + i;
-@@ -1389,6 +1460,7 @@ static int spi_nor_write(struct mtd_info
+@@ -1394,6 +1465,7 @@ static int spi_nor_write(struct mtd_info
}
write_err:
@@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
return ret;
}
-@@ -2805,8 +2877,10 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -2810,8 +2882,10 @@ int spi_nor_scan(struct spi_nor *nor, co
} else if (mtd->size > 0x1000000) {
/* enable 4-byte addressing if the device exceeds 16MiB */
nor->addr_width = 4;
--
2.11.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list