aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/patches-5.15/121-hack-spi-nand-1b-bbm.patch
diff options
context:
space:
mode:
authorChuanhong Guo <gch981213@gmail.com>2022-04-07 10:05:56 +0800
committerChuanhong Guo <gch981213@gmail.com>2022-04-28 18:06:00 +0800
commit2138956bdc3145fac26d2ba8ac966f31d33cd290 (patch)
tree00913a2d19324c7eea1c9a524038af24e4b3c22b /target/linux/mediatek/patches-5.15/121-hack-spi-nand-1b-bbm.patch
parent861efe158ac56da2e00637aed704a77994bec54c (diff)
downloadupstream-2138956bdc3145fac26d2ba8ac966f31d33cd290.tar.gz
upstream-2138956bdc3145fac26d2ba8ac966f31d33cd290.tar.bz2
upstream-2138956bdc3145fac26d2ba8ac966f31d33cd290.zip
mediatek: spi-nand: check for 1 byte BBM only
the OOB layout in MTK SNFI uses the 2nd byte, and anything using OOB will make the block a bad-block in spi-nand driver. Hack it for now. We need a proper solution upstream. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Diffstat (limited to 'target/linux/mediatek/patches-5.15/121-hack-spi-nand-1b-bbm.patch')
-rw-r--r--target/linux/mediatek/patches-5.15/121-hack-spi-nand-1b-bbm.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/target/linux/mediatek/patches-5.15/121-hack-spi-nand-1b-bbm.patch b/target/linux/mediatek/patches-5.15/121-hack-spi-nand-1b-bbm.patch
new file mode 100644
index 0000000000..eccd363395
--- /dev/null
+++ b/target/linux/mediatek/patches-5.15/121-hack-spi-nand-1b-bbm.patch
@@ -0,0 +1,20 @@
+--- a/drivers/mtd/nand/spi/core.c
++++ b/drivers/mtd/nand/spi/core.c
+@@ -715,7 +715,7 @@ static int spinand_mtd_write(struct mtd_
+ static bool spinand_isbad(struct nand_device *nand, const struct nand_pos *pos)
+ {
+ struct spinand_device *spinand = nand_to_spinand(nand);
+- u8 marker[2] = { };
++ u8 marker[1] = { };
+ struct nand_page_io_req req = {
+ .pos = *pos,
+ .ooblen = sizeof(marker),
+@@ -726,7 +726,7 @@ static bool spinand_isbad(struct nand_de
+
+ spinand_select_target(spinand, pos->target);
+ spinand_read_page(spinand, &req);
+- if (marker[0] != 0xff || marker[1] != 0xff)
++ if (marker[0] != 0xff)
+ return true;
+
+ return false;