mtd: rawnand: ingenic: Move BBTs out of ECC area
authorPaul Cercueil <paul@crapouillou.net>
Tue, 19 Mar 2019 14:54:03 +0000 (15:54 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 8 Apr 2019 08:21:07 +0000 (10:21 +0200)
The generic layout for BBT markers will most likely overlap with our
ECC bytes in the OOB, so move the BBT markers outside the OOB area.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/ingenic/ingenic_nand.c

index d32d68ef0dc7949b884b4fcf288fb178b9043b41..ad0c905a03ba2a6e03cc7a7ba89348f042f96858 100644 (file)
@@ -282,6 +282,13 @@ static int ingenic_nand_attach_chip(struct nand_chip *chip)
                return -EINVAL;
        }
 
+       /*
+        * The generic layout for BBT markers will most likely overlap with our
+        * ECC bytes in the OOB, so move the BBT markers outside the OOB area.
+        */
+       if (chip->bbt_options & NAND_BBT_USE_FLASH)
+               chip->bbt_options |= NAND_BBT_NO_OOB;
+
        /* For legacy reasons we use a different layout on the qi,lb60 board. */
        if (of_machine_is_compatible("qi,lb60"))
                mtd_set_ooblayout(mtd, &qi_lb60_ooblayout_ops);