nand: mxs_nand: Add the option to have BBT in the nand device
Subsystems (3)
PATCH 1/1 nand: mxs_nand: Add the option to have BBT in the nand device
This patch add people that use ubi and BBT in the kernel. Up to now the mxs driver has no managment for BBT in nand itself. We can have this problem:
ubi0: attaching mtd1
ubi0 error: scan_peb: bad image sequence number -999266176 in PEB 1844, expected 344810451 Erase counter header dump:
magic 0x55424923
version 1
ec 2
vid_hdr_offset 2048
data_offset 4096
image_seq -999266176
hdr_crc 0x4247f853erase counter header hexdump:
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd1, error -22 UBI error: cannot attach mtd1
UBI error: cannot initialize UBI, error -22
UBI init error 22
and even we can have this problem for every reboot in kernel log
[ 1.635636] Bad block table not found for chip 0 [ 1.642350] Bad block table not found for chip 0 [ 1.647066] Scanning device for bad blocks [ 2.392740] Bad block table written to 0x00000ffe0000, version 0x01 [ 2.401091] Bad block table written to 0x00000ffc0000, version 0x01
Correct log should be
[ 3.117226] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 [ 3.128981] Bad block table found at page 131008, version 0x01 [ 3.136624] Bad block table found at page 130944, version 0x01
Signed-off-by Michael Trimarchi <[email protected]>
--- drivers/mtd/nand/mxs_nand.c | 5 ++++- include/configs/imx6ull-isiot.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/mtd/nand/mxs_nand.c +4 -1
@@ -1182,7 +1182,10 @@ int board_nand_init(struct nand_chip *nand)nand_set_controller_data (nand, nand_info); nand->options |=NAND_NO_SUBPAGE_WRITE ; - +#if definedCONFIG_SYS_NAND_USE_FLASH_BBT + nand->bbt_options |=NAND_BBT_NO_OOB ; + nand->bbt_options |=NAND_BBT_USE_FLASH ; +#endif nand->cmd_ctrl = mxs_nand_cmd_ctrl; nand->dev_ready = mxs_nand_device_ready;
include/configs/imx6ull-isiot.h +1 -0
@@ -146,6 +146,7 @@/* NAND */ #ifdef CONFIG_NAND_MXS +# define CONFIG_SYS_NAND_USE_FLASH_BBT # define CONFIG_SYS_MAX_NAND_DEVICE 1# define CONFIG_SYS_NAND_BASE 0x40000000# define CONFIG_SYS_NAND_5_ADDR_CYCLE
Signature · 1 line
2.17.1