mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: mrvl-nand: create initial empty bbt
@ 2015-08-09 21:54 Robert Jarzmik
  2015-08-19 14:24 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Jarzmik @ 2015-08-09 21:54 UTC (permalink / raw)
  To: barebox

When creating an initial bad blocks table, create it empty. This is
necessary because when the bad block table blocks are not
initialized (all ff) while some partitions are, all the blocks which
have an OOB data not beginning with 0xff 0xff will be marked as bad
blocks in the initial bad blocks scan.

As a consequence, any existing blocks are impossible to erase
anymore. Fix this by fixing the BBT creation flag.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/mtd/nand/nand_mrvl_nfc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_mrvl_nfc.c b/drivers/mtd/nand/nand_mrvl_nfc.c
index 258ff75..1ec48cc 100644
--- a/drivers/mtd/nand/nand_mrvl_nfc.c
+++ b/drivers/mtd/nand/nand_mrvl_nfc.c
@@ -881,8 +881,9 @@ static int mrvl_nand_scan(struct mtd_info *mtd)
 		 * We'll use a bad block table stored in-flash and don't
 		 * allow writing the bad block marker to the flash.
 		 */
-		chip->bbt_options |= NAND_BBT_USE_FLASH |
-				     NAND_BBT_NO_OOB_BBM;
+		chip->bbt_options |=
+			NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB_BBM |
+			NAND_BBT_CREATE_EMPTY;
 		chip->bbt_td = &bbt_main_descr;
 		chip->bbt_md = &bbt_mirror_descr;
 	}
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-19 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-09 21:54 [PATCH] mtd: nand: mrvl-nand: create initial empty bbt Robert Jarzmik
2015-08-19 14:24 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox