aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-5.4/0040-nand-hack.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips/patches-5.4/0040-nand-hack.patch')
-rw-r--r--target/linux/ramips/patches-5.4/0040-nand-hack.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-5.4/0040-nand-hack.patch b/target/linux/ramips/patches-5.4/0040-nand-hack.patch
new file mode 100644
index 0000000000..58cdf1bce7
--- /dev/null
+++ b/target/linux/ramips/patches-5.4/0040-nand-hack.patch
@@ -0,0 +1,32 @@
+--- a/drivers/mtd/nand/nand_base.c
++++ b/drivers/mtd/nand/nand_base.c
+@@ -1908,6 +1908,9 @@ static int nand_do_read_ops(struct mtd_i
+ __func__, buf);
+
+ read_retry:
++#ifdef CONFIG_MTK_MTD_NAND
++ ret = chip->read_page(mtd, chip, bufpoi, page);
++#else
+ if (nand_standard_page_accessors(&chip->ecc))
+ chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
+
+@@ -1927,6 +1930,7 @@ read_retry:
+ else
+ ret = chip->ecc.read_page(mtd, chip, bufpoi,
+ oob_required, page);
++#endif
+ if (ret < 0) {
+ if (use_bufpoi)
+ /* Invalidate page cache */
+--- a/include/linux/mtd/rawnand.h
++++ b/include/linux/mtd/rawnand.h
+@@ -897,6 +897,9 @@ struct nand_chip {
+ int (*setup_data_interface)(struct mtd_info *mtd, int chipnr,
+ const struct nand_data_interface *conf);
+
++#ifdef CONFIG_MTK_MTD_NAND
++ int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip, u8 *buf, int page);
++#endif /* CONFIG_MTK_MTD_NAND */
+
+ int chip_delay;
+ unsigned int options;