From: Rafał Miłecki Date: Mon, 19 Feb 2018 14:27:47 +0000 (+0100) Subject: kernel: order mtd backported patches by kernel release X-Git-Tag: v18.06.0-rc1~900 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=eefe02b23f5347a90eb19cdbaaa24387fe160fe4;p=openwrt%2Fopenwrt.git kernel: order mtd backported patches by kernel release Signed-off-by: Rafał Miłecki --- diff --git a/target/linux/generic/backport-4.9/063-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch b/target/linux/generic/backport-4.9/063-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch deleted file mode 100644 index 339591500f..0000000000 --- a/target/linux/generic/backport-4.9/063-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch +++ /dev/null @@ -1,29 +0,0 @@ -From b0fcb4b413028376894feaaaf62bcb09ab1b52f2 Mon Sep 17 00:00:00 2001 -From: Mathias Kresin -Date: Thu, 13 Apr 2017 09:23:54 +0200 -Subject: [PATCH] mtd: spi-nor: enable stateless 4b op codes for mx25u25635f - -All required stateless 4-byte op codes are supported by this flash -chip. The stateless 4-byte support can't be autodetected due to a -missing 4-byte Address Instruction Table in SFDP. - -Fixes hangs on reboot for SoCs expecting the flash chip in 3byte mode. - -Signed-off-by: Mathias Kresin -Acked-by: Marek Vasut -Signed-off-by: Cyrille Pitchen ---- - drivers/mtd/spi-nor/spi-nor.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/mtd/spi-nor/spi-nor.c -+++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1017,7 +1017,7 @@ static const struct flash_info spi_nor_i - { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, - { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, - { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, 0) }, -- { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K) }, -+ { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, - { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, - { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_QUAD_READ) }, - { "mx66l1g55g", INFO(0xc2261b, 0, 64 * 1024, 2048, SPI_NOR_QUAD_READ) }, diff --git a/target/linux/generic/backport-4.9/063-v4.11-0001-mtd-nand-Add-Winbond-manufacturer-id.patch b/target/linux/generic/backport-4.9/063-v4.11-0001-mtd-nand-Add-Winbond-manufacturer-id.patch new file mode 100644 index 0000000000..cbab378b2b --- /dev/null +++ b/target/linux/generic/backport-4.9/063-v4.11-0001-mtd-nand-Add-Winbond-manufacturer-id.patch @@ -0,0 +1,34 @@ +From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001 +From: "Andrey Jr. Melnikov" +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 +Signed-off-by: Boris Brezillon +--- + 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/backport-4.9/063-v4.11-0002-mtd-introduce-function-max_bad_blocks.patch b/target/linux/generic/backport-4.9/063-v4.11-0002-mtd-introduce-function-max_bad_blocks.patch new file mode 100644 index 0000000000..d2e582ef5b --- /dev/null +++ b/target/linux/generic/backport-4.9/063-v4.11-0002-mtd-introduce-function-max_bad_blocks.patch @@ -0,0 +1,73 @@ +From 6080ef6e7c0a0592cbcca11200d879faf65e27d4 Mon Sep 17 00:00:00 2001 +From: Jeff Westfahl +Date: Tue, 10 Jan 2017 13:30:17 -0600 +Subject: [PATCH] mtd: introduce function max_bad_blocks + +If implemented, 'max_bad_blocks' returns the maximum number of bad +blocks to reserve for a MTD. An implementation for NAND is coming soon. + +Signed-off-by: Jeff Westfahl +Signed-off-by: Zach Brown +Acked-by: Boris Brezillon +Acked-by: Brian Norris +Signed-off-by: Brian Norris +--- + drivers/mtd/mtdpart.c | 10 ++++++++++ + include/linux/mtd/mtd.h | 13 +++++++++++++ + 2 files changed, 23 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -349,6 +349,14 @@ static const struct mtd_ooblayout_ops pa + .free = part_ooblayout_free, + }; + ++static int part_max_bad_blocks(struct mtd_info *mtd, loff_t ofs, size_t len) ++{ ++ struct mtd_part *part = mtd_to_part(mtd); ++ ++ return part->master->_max_bad_blocks(part->master, ++ ofs + part->offset, len); ++} ++ + static inline void free_partition(struct mtd_part *p) + { + kfree(p->mtd.name); +@@ -475,6 +483,8 @@ static struct mtd_part *allocate_partiti + slave->mtd._block_isbad = part_block_isbad; + if (master->_block_markbad) + slave->mtd._block_markbad = part_block_markbad; ++ if (master->_max_bad_blocks) ++ slave->mtd._max_bad_blocks = part_max_bad_blocks; + + if (master->_get_device) + slave->mtd._get_device = part_get_device; +--- a/include/linux/mtd/mtd.h ++++ b/include/linux/mtd/mtd.h +@@ -322,6 +322,7 @@ struct mtd_info { + int (*_block_isreserved) (struct mtd_info *mtd, loff_t ofs); + int (*_block_isbad) (struct mtd_info *mtd, loff_t ofs); + int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs); ++ int (*_max_bad_blocks) (struct mtd_info *mtd, loff_t ofs, size_t len); + int (*_suspend) (struct mtd_info *mtd); + void (*_resume) (struct mtd_info *mtd); + void (*_reboot) (struct mtd_info *mtd); +@@ -397,6 +398,18 @@ static inline int mtd_oobavail(struct mt + return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize; + } + ++static inline int mtd_max_bad_blocks(struct mtd_info *mtd, ++ loff_t ofs, size_t len) ++{ ++ if (!mtd->_max_bad_blocks) ++ return -ENOTSUPP; ++ ++ if (mtd->size < (len + ofs) || ofs < 0) ++ return -EINVAL; ++ ++ return mtd->_max_bad_blocks(mtd, ofs, len); ++} ++ + int mtd_wunit_to_pairing_info(struct mtd_info *mtd, int wunit, + struct mtd_pairing_info *info); + int mtd_pairing_info_to_wunit(struct mtd_info *mtd, diff --git a/target/linux/generic/backport-4.9/063-v4.11-0003-mtd-Add-partition-device-node-to-mtd-partition-devic.patch b/target/linux/generic/backport-4.9/063-v4.11-0003-mtd-Add-partition-device-node-to-mtd-partition-devic.patch new file mode 100644 index 0000000000..ea68fc474f --- /dev/null +++ b/target/linux/generic/backport-4.9/063-v4.11-0003-mtd-Add-partition-device-node-to-mtd-partition-devic.patch @@ -0,0 +1,50 @@ +From 42e9401bd1467d22c4dc4d2c637347b874e6a80b Mon Sep 17 00:00:00 2001 +From: Sascha Hauer +Date: Thu, 9 Feb 2017 11:50:24 +0100 +Subject: [PATCH] mtd: Add partition device node to mtd partition devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The user visible change here is that mtd partitions get an of_node link +in sysfs. + +Signed-off-by: Sascha Hauer +Signed-off-by: Uwe Kleine-König +Signed-off-by: Brian Norris +--- + drivers/mtd/mtdpart.c | 1 + + drivers/mtd/ofpart.c | 1 + + include/linux/mtd/partitions.h | 1 + + 3 files changed, 3 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -432,6 +432,7 @@ static struct mtd_part *allocate_partiti + slave->mtd.dev.parent = IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER) ? + &master->dev : + master->dev.parent; ++ slave->mtd.dev.of_node = part->of_node; + + slave->mtd._read = part_read; + slave->mtd._write = part_write; +--- a/drivers/mtd/ofpart.c ++++ b/drivers/mtd/ofpart.c +@@ -108,6 +108,7 @@ static int parse_ofpart_partitions(struc + + parts[i].offset = of_read_number(reg, a_cells); + parts[i].size = of_read_number(reg + a_cells, s_cells); ++ parts[i].of_node = pp; + + partname = of_get_property(pp, "label", &len); + if (!partname) +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -41,6 +41,7 @@ struct mtd_partition { + uint64_t size; /* partition size */ + uint64_t offset; /* offset within the master MTD space */ + uint32_t mask_flags; /* master MTD flags to mask out for this partition */ ++ struct device_node *of_node; + }; + + #define MTDPART_OFS_RETAIN (-3) diff --git a/target/linux/generic/backport-4.9/064-v4.11-0001-mtd-introduce-function-max_bad_blocks.patch b/target/linux/generic/backport-4.9/064-v4.11-0001-mtd-introduce-function-max_bad_blocks.patch deleted file mode 100644 index d2e582ef5b..0000000000 --- a/target/linux/generic/backport-4.9/064-v4.11-0001-mtd-introduce-function-max_bad_blocks.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 6080ef6e7c0a0592cbcca11200d879faf65e27d4 Mon Sep 17 00:00:00 2001 -From: Jeff Westfahl -Date: Tue, 10 Jan 2017 13:30:17 -0600 -Subject: [PATCH] mtd: introduce function max_bad_blocks - -If implemented, 'max_bad_blocks' returns the maximum number of bad -blocks to reserve for a MTD. An implementation for NAND is coming soon. - -Signed-off-by: Jeff Westfahl -Signed-off-by: Zach Brown -Acked-by: Boris Brezillon -Acked-by: Brian Norris -Signed-off-by: Brian Norris ---- - drivers/mtd/mtdpart.c | 10 ++++++++++ - include/linux/mtd/mtd.h | 13 +++++++++++++ - 2 files changed, 23 insertions(+) - ---- a/drivers/mtd/mtdpart.c -+++ b/drivers/mtd/mtdpart.c -@@ -349,6 +349,14 @@ static const struct mtd_ooblayout_ops pa - .free = part_ooblayout_free, - }; - -+static int part_max_bad_blocks(struct mtd_info *mtd, loff_t ofs, size_t len) -+{ -+ struct mtd_part *part = mtd_to_part(mtd); -+ -+ return part->master->_max_bad_blocks(part->master, -+ ofs + part->offset, len); -+} -+ - static inline void free_partition(struct mtd_part *p) - { - kfree(p->mtd.name); -@@ -475,6 +483,8 @@ static struct mtd_part *allocate_partiti - slave->mtd._block_isbad = part_block_isbad; - if (master->_block_markbad) - slave->mtd._block_markbad = part_block_markbad; -+ if (master->_max_bad_blocks) -+ slave->mtd._max_bad_blocks = part_max_bad_blocks; - - if (master->_get_device) - slave->mtd._get_device = part_get_device; ---- a/include/linux/mtd/mtd.h -+++ b/include/linux/mtd/mtd.h -@@ -322,6 +322,7 @@ struct mtd_info { - int (*_block_isreserved) (struct mtd_info *mtd, loff_t ofs); - int (*_block_isbad) (struct mtd_info *mtd, loff_t ofs); - int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs); -+ int (*_max_bad_blocks) (struct mtd_info *mtd, loff_t ofs, size_t len); - int (*_suspend) (struct mtd_info *mtd); - void (*_resume) (struct mtd_info *mtd); - void (*_reboot) (struct mtd_info *mtd); -@@ -397,6 +398,18 @@ static inline int mtd_oobavail(struct mt - return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize; - } - -+static inline int mtd_max_bad_blocks(struct mtd_info *mtd, -+ loff_t ofs, size_t len) -+{ -+ if (!mtd->_max_bad_blocks) -+ return -ENOTSUPP; -+ -+ if (mtd->size < (len + ofs) || ofs < 0) -+ return -EINVAL; -+ -+ return mtd->_max_bad_blocks(mtd, ofs, len); -+} -+ - int mtd_wunit_to_pairing_info(struct mtd_info *mtd, int wunit, - struct mtd_pairing_info *info); - int mtd_pairing_info_to_wunit(struct mtd_info *mtd, diff --git a/target/linux/generic/backport-4.9/064-v4.11-0002-mtd-Add-partition-device-node-to-mtd-partition-devic.patch b/target/linux/generic/backport-4.9/064-v4.11-0002-mtd-Add-partition-device-node-to-mtd-partition-devic.patch deleted file mode 100644 index ea68fc474f..0000000000 --- a/target/linux/generic/backport-4.9/064-v4.11-0002-mtd-Add-partition-device-node-to-mtd-partition-devic.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 42e9401bd1467d22c4dc4d2c637347b874e6a80b Mon Sep 17 00:00:00 2001 -From: Sascha Hauer -Date: Thu, 9 Feb 2017 11:50:24 +0100 -Subject: [PATCH] mtd: Add partition device node to mtd partition devices -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The user visible change here is that mtd partitions get an of_node link -in sysfs. - -Signed-off-by: Sascha Hauer -Signed-off-by: Uwe Kleine-König -Signed-off-by: Brian Norris ---- - drivers/mtd/mtdpart.c | 1 + - drivers/mtd/ofpart.c | 1 + - include/linux/mtd/partitions.h | 1 + - 3 files changed, 3 insertions(+) - ---- a/drivers/mtd/mtdpart.c -+++ b/drivers/mtd/mtdpart.c -@@ -432,6 +432,7 @@ static struct mtd_part *allocate_partiti - slave->mtd.dev.parent = IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER) ? - &master->dev : - master->dev.parent; -+ slave->mtd.dev.of_node = part->of_node; - - slave->mtd._read = part_read; - slave->mtd._write = part_write; ---- a/drivers/mtd/ofpart.c -+++ b/drivers/mtd/ofpart.c -@@ -108,6 +108,7 @@ static int parse_ofpart_partitions(struc - - parts[i].offset = of_read_number(reg, a_cells); - parts[i].size = of_read_number(reg + a_cells, s_cells); -+ parts[i].of_node = pp; - - partname = of_get_property(pp, "label", &len); - if (!partname) ---- a/include/linux/mtd/partitions.h -+++ b/include/linux/mtd/partitions.h -@@ -41,6 +41,7 @@ struct mtd_partition { - uint64_t size; /* partition size */ - uint64_t offset; /* offset within the master MTD space */ - uint32_t mask_flags; /* master MTD flags to mask out for this partition */ -+ struct device_node *of_node; - }; - - #define MTDPART_OFS_RETAIN (-3) diff --git a/target/linux/generic/backport-4.9/064-v4.12-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch b/target/linux/generic/backport-4.9/064-v4.12-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch new file mode 100644 index 0000000000..339591500f --- /dev/null +++ b/target/linux/generic/backport-4.9/064-v4.12-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch @@ -0,0 +1,29 @@ +From b0fcb4b413028376894feaaaf62bcb09ab1b52f2 Mon Sep 17 00:00:00 2001 +From: Mathias Kresin +Date: Thu, 13 Apr 2017 09:23:54 +0200 +Subject: [PATCH] mtd: spi-nor: enable stateless 4b op codes for mx25u25635f + +All required stateless 4-byte op codes are supported by this flash +chip. The stateless 4-byte support can't be autodetected due to a +missing 4-byte Address Instruction Table in SFDP. + +Fixes hangs on reboot for SoCs expecting the flash chip in 3byte mode. + +Signed-off-by: Mathias Kresin +Acked-by: Marek Vasut +Signed-off-by: Cyrille Pitchen +--- + drivers/mtd/spi-nor/spi-nor.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1017,7 +1017,7 @@ static const struct flash_info spi_nor_i + { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, + { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, + { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, 0) }, +- { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K) }, ++ { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, + { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, + { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_QUAD_READ) }, + { "mx66l1g55g", INFO(0xc2261b, 0, 64 * 1024, 2048, SPI_NOR_QUAD_READ) }, 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 deleted file mode 100644 index cbab378b2b..0000000000 --- a/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001 -From: "Andrey Jr. Melnikov" -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 -Signed-off-by: Boris Brezillon ---- - 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