[U-Boot] [PATCH 2/4] mtd: nand: mxs_nand: allow to enable BBT support
Stefan Agner
stefan at agner.ch
Mon Jan 29 16:01:20 UTC 2018
From: Stefan Agner <stefan.agner at toradex.com>
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 at toradex.com>
---
drivers/mtd/nand/mxs_nand.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
index cf96584fa8..1fe7a712d2 100644
--- a/drivers/mtd/nand/mxs_nand.c
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -1172,6 +1172,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;
--
2.16.1
More information about the U-Boot
mailing list