]> git.sur5r.net Git - u-boot/commitdiff
mtd: nand: mxs_nand: allow to enable BBT support
authorStefan Agner <stefan.agner@toradex.com>
Fri, 22 Jun 2018 15:19:48 +0000 (17:19 +0200)
committerStefano Babic <sbabic@denx.de>
Wed, 27 Jun 2018 07:07:55 +0000 (09:07 +0200)
Add config option which allows to enable on flash bad block table
support. This has the same effect as when using the device tree
property "nand-on-flash-bbt" in Linux.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
drivers/mtd/nand/mxs_nand.c

index 14d321001732924d44a5b3d25b370653013ffabe..2584608641bf79916adb8562b53cab1619e8508c 100644 (file)
@@ -1213,6 +1213,10 @@ void board_nand_init(void)
 
        memset(&fake_ecc_layout, 0, sizeof(fake_ecc_layout));
 
+#ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
+       nand->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+#endif
+
        nand_set_controller_data(nand, nand_info);
        nand->options |= NAND_NO_SUBPAGE_WRITE;