aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
diff options
context:
space:
mode:
authorIan Pozella <Ian.Pozella@imgtec.com>2017-02-15 09:05:24 +0000
committerFelix Fietkau <nbd@nbd.name>2017-03-22 11:43:22 +0100
commit52c17bff3c861dc28517303e535b880473a54498 (patch)
treeed706b19a6a8f37598f73bba9c5eefb567719482 /target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
parent370d740647707f9caec915b5c1f5cb1a278b1d3b (diff)
downloadupstream-52c17bff3c861dc28517303e535b880473a54498.tar.gz
upstream-52c17bff3c861dc28517303e535b880473a54498.tar.bz2
upstream-52c17bff3c861dc28517303e535b880473a54498.zip
pistachio: add 4.9 kernel support
This adds kernel support for the Pistachio SoC and the Marduk (Ci40) board which uses it. Much of the code for Pistachio has been upstreamed however some patches are still required to boot from the Marduk board: * spi bug fixes * dma bug fixes * pistachio internal clock tree bug fixes * spi-nand implementation * dts based mtd device naming scheme * dts backports and bug fixes Signed-off-by: Abhijit Mahajani <Abhijit.Mahajani@imgtec.com> Signed-off-by: Francois Berder <francois.berder@imgtec.com> Signed-off-by: Ian Pozella <Ian.Pozella@imgtec.com>
Diffstat (limited to 'target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch')
-rw-r--r--target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
new file mode 100644
index 0000000000..0ae92f3c86
--- /dev/null
+++ b/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
@@ -0,0 +1,39 @@
+From f32bc2aa01edcba2f2ed5db151cf183eac9ef919 Mon Sep 17 00:00:00 2001
+From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
+Date: Sat, 25 Feb 2017 16:42:50 +0000
+Subject: mtd: nor: support mtd name from device tree
+
+Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
+---
+ drivers/mtd/spi-nor/spi-nor.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
+index d0fc165..fcee697 100644
+--- a/drivers/mtd/spi-nor/spi-nor.c
++++ b/drivers/mtd/spi-nor/spi-nor.c
+@@ -1306,6 +1306,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
+ struct device *dev = nor->dev;
+ struct mtd_info *mtd = &nor->mtd;
+ struct device_node *np = spi_nor_get_flash_node(nor);
++ const char __maybe_unused *of_mtd_name = NULL;
+ int ret;
+ int i;
+
+@@ -1361,7 +1362,12 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
+ spi_nor_wait_till_ready(nor);
+ }
+
+- if (!mtd->name)
++#ifdef CONFIG_MTD_OF_PARTS
++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name);
++#endif
++ if (of_mtd_name)
++ mtd->name = of_mtd_name;
++ else if (!mtd->name)
+ mtd->name = dev_name(dev);
+ mtd->priv = nor;
+ mtd->type = MTD_NORFLASH;
+--
+2.7.4
+