[openwrt/openwrt] kernel/4.{4, 9}: add manufacturer ID for Winbond NANDs
LEDE Commits
lede-commits at lists.infradead.org
Sat Jan 20 12:13:46 PST 2018
hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/02050f7e7d5b41f80b138a2d5953e596fd8e0e6a
commit 02050f7e7d5b41f80b138a2d5953e596fd8e0e6a
Author: Gabor Juhos <juhosg at freemail.hu>
AuthorDate: Thu Jan 18 22:13:09 2018 +0100
kernel/4.{4, 9}: add manufacturer ID for Winbond NANDs
Some MikroTik devices are using a Winbond NAND flash. Linux treats
it as an unknown NAND before version 4.11:
nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Unknown NAND 128MiB 3,3V 8-bit
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Backport a patch from 4.11 to show the manufacturer correctly:
nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Winbond NAND 128MiB 3,3V 8-bit
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Tested on a MikroTik R951Ui-2HnD board.
Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
...4.11-mtd-nand-Add-Winbond-manufacturer-id.patch | 34 ++++++++++++++++++++++
...4.11-mtd-nand-Add-Winbond-manufacturer-id.patch | 34 ++++++++++++++++++++++
...allow-to-use-platform-specific-chip-fixup.patch | 2 +-
3 files changed, 69 insertions(+), 1 deletion(-)
diff --git a/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch b/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
new file mode 100644
index 0000000..cbab378
--- /dev/null
+++ b/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
@@ -0,0 +1,34 @@
+From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001
+From: "Andrey Jr. Melnikov" <temnota.am at gmail.com>
+Date: Thu, 8 Dec 2016 19:57:08 +0300
+Subject: [PATCH] mtd: nand: Add Winbond manufacturer id
+
+Add WINBOND manufacturer id.
+
+Signed-off-by: Andrey Jr. Melnikov <temnota.am at gmail.com>
+Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
+---
+ drivers/mtd/nand/nand_ids.c | 1 +
+ include/linux/mtd/nand.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/drivers/mtd/nand/nand_ids.c
++++ b/drivers/mtd/nand/nand_ids.c
+@@ -182,6 +182,7 @@ struct nand_manufacturers nand_manuf_ids
+ {NAND_MFR_SANDISK, "SanDisk"},
+ {NAND_MFR_INTEL, "Intel"},
+ {NAND_MFR_ATO, "ATO"},
++ {NAND_MFR_WINBOND, "Winbond"},
+ {0x0, "Unknown"}
+ };
+
+--- a/include/linux/mtd/nand.h
++++ b/include/linux/mtd/nand.h
+@@ -928,6 +928,7 @@ static inline void nand_set_controller_d
+ #define NAND_MFR_SANDISK 0x45
+ #define NAND_MFR_INTEL 0x89
+ #define NAND_MFR_ATO 0x9b
++#define NAND_MFR_WINBOND 0xef
+
+ /* The maximum expected count of bytes in the NAND ID sequence */
+ #define NAND_MAX_ID_LEN 8
diff --git a/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch b/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
new file mode 100644
index 0000000..d102d89
--- /dev/null
+++ b/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
@@ -0,0 +1,34 @@
+From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001
+From: "Andrey Jr. Melnikov" <temnota.am at gmail.com>
+Date: Thu, 8 Dec 2016 19:57:08 +0300
+Subject: [PATCH] mtd: nand: Add Winbond manufacturer id
+
+Add WINBOND manufacturer id.
+
+Signed-off-by: Andrey Jr. Melnikov <temnota.am at gmail.com>
+Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
+---
+ drivers/mtd/nand/nand_ids.c | 1 +
+ include/linux/mtd/nand.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/drivers/mtd/nand/nand_ids.c
++++ b/drivers/mtd/nand/nand_ids.c
+@@ -181,6 +181,7 @@ struct nand_manufacturers nand_manuf_ids
+ {NAND_MFR_SANDISK, "SanDisk"},
+ {NAND_MFR_INTEL, "Intel"},
+ {NAND_MFR_ATO, "ATO"},
++ {NAND_MFR_WINBOND, "Winbond"},
+ {0x0, "Unknown"}
+ };
+
+--- a/include/linux/mtd/nand.h
++++ b/include/linux/mtd/nand.h
+@@ -736,6 +736,7 @@ struct nand_chip {
+ #define NAND_MFR_SANDISK 0x45
+ #define NAND_MFR_INTEL 0x89
+ #define NAND_MFR_ATO 0x9b
++#define NAND_MFR_WINBOND 0xef
+
+ /* The maximum expected count of bytes in the NAND ID sequence */
+ #define NAND_MAX_ID_LEN 8
diff --git a/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch b/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch
index 3ce7f13..b107204 100644
--- a/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch
+++ b/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch
@@ -5,7 +5,7 @@
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
-@@ -863,6 +863,7 @@ struct platform_nand_chip {
+@@ -864,6 +864,7 @@ struct platform_nand_chip {
unsigned int options;
unsigned int bbt_options;
const char **part_probe_types;
More information about the lede-commits
mailing list