[U-Boot] [PATCH v2] nand, gpmc: fix reading after switching ecc
Jeroen Hofstee
jeroen at myspectrum.nl
Wed Jan 15 17:58:54 CET 2014
The omap_gpmc allows switching ecc at runtime. Since
the NAND_SUBPAGE_READ flag is only set, it is kept when
switching to hw ecc, which is not correct. This leads to
calling chip->ecc.read_subpage which is not a valid
pointer. Therefore clear the flag when switching ecc so
reading in hw mode works again.
Cc: Scott Wood <scottwood at freescale.com>
Cc: Pekon Gupta <pekon at ti.com>
Cc: Nikita Kiryanov <nikita at compulab.co.il>
Signed-off-by: Jeroen Hofstee <jeroen at myspectrum.nl>
---
version 2:
- clear the flag from the omap_gpmc specific omap_nand_switch_ecc
---
drivers/mtd/nand/omap_gpmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 790d538..389c4de 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -933,6 +933,7 @@ int __maybe_unused omap_nand_switch_ecc(uint32_t hardware, uint32_t eccstrength)
mtd = &nand_info[nand_curr_device];
nand = mtd->priv;
nand->options |= NAND_OWN_BUFFERS;
+ nand->options &= ~NAND_SUBPAGE_READ;
/* Setup the ecc configurations again */
if (hardware) {
if (eccstrength == 1) {
--
1.8.3.2
More information about the U-Boot
mailing list