Skip to contentSkip to conversation

mtd: rawnand: meson: set oob layout ops

PATCH Applied Liang Yang 3 participants 3 messages Mar 21, 2019 – Apr 1, 2019

Subsystems (4)
lore
Share & tools
lore

Liang Yang

author maintainer
#0 lore raw

PATCH 1/1 mtd: rawnand: meson: set oob layout ops

Specify the oob layout operation to avoid no oob scheme defined for some nand flash.

Fixes 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller")
---
 drivers/mtd/nand/raw/meson_nand.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/nand/raw/meson_nand.c +2 -0
index 3e8aa71..a2154a2 100644
@@ -1183,6 +1183,8 @@ static int meson_nand_attach_chip(struct nand_chip *nand)
 		return -EINVAL;
 	}
 
+	mtd_set_ooblayout(mtd, &meson_ooblayout_ops);
+
 	ret = meson_nand_bch_mode(nand);
 	if (ret)
 		return -EINVAL;
Signature · 1 line
1.9.1
reviewer Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Liang Yang

Specify the oob layout operation to avoid no oob scheme defined for some nand flash.

Fixes 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller")

this patch solves the "No oob scheme defined for oobsize 1280" on my Meson8m2 M8S board, so:

to give a bit of context on my Tested-by:
I tested this with my work-in-progress series and a hack to make the kzalloc() in meson_nfc_read_buf() return an aligned address (by allocating PAGE_SIZE instead of PER_INFO_BYTE) on my Meson8m2 M8S board.
it's now progressing to the state where Linux tries to find the BBT which it can't (because the vendor kernel which was used to format the NAND flash is shipping a custom BBT format).
before this patch I couldn't get past the "No oob scheme defined for oobsize 1280" error.

Regards
Martin

maintainer Applied
#2 lore raw
In reply to Liang Yang

Hi Liang,

Liang Yang <[email protected]> wrote on Thu, 21 Mar 2019 20:14:01 +0800:

Quoted 14 lines

Specify the oob layout operation to avoid no oob scheme defined for some nand flash.

Fixes 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller")
---
 drivers/mtd/nand/raw/meson_nand.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/nand/raw/meson_nand.c +0 -0
index 3e8aa71..a2154a2 100644

drivers/mtd/nand/raw/meson_nand.c static int meson_nand_attach_chip(struct nand_chip *nand) · line 1190

Quoted 8 lines
drivers/mtd/nand/raw/meson_nand.c +2 -0
@@ -1183,6 +1183,8 @@ static int meson_nand_attach_chip(struct nand_chip *nand)
 		return -EINVAL;
 	}
 
+	mtd_set_ooblayout(mtd, &meson_ooblayout_ops);
+
 	ret = meson_nand_bch_mode(nand);
 	if (ret)
 		return -EINVAL;

Applied to git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git
on nand/next.

Thanks,
Miquèl