From: Michael Trimarchi <michael@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFQ PATCH] nand: mxs_nand: Add the option to have BBT in the nand device
Date: Mon, 1 Oct 2018 21:44:45 +0200 [thread overview]
Message-ID: <20181001194448.10089-1-michael@amarulasolutions.com> (raw)
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 0x4247f853
erase 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 <michael@amarulasolutions.com>
---
drivers/mtd/nand/mxs_nand.c | 5 ++++-
include/configs/imx6ull-isiot.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
index b9ffa7cbae..a1e0705b65 100644
--- a/drivers/mtd/nand/mxs_nand.c
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -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 defined CONFIG_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;
diff --git a/include/configs/imx6ull-isiot.h b/include/configs/imx6ull-isiot.h
index 766839c123..f2c97bb964 100644
--- a/include/configs/imx6ull-isiot.h
+++ b/include/configs/imx6ull-isiot.h
@@ -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
--
2.17.1
reply other threads:[~2018-10-01 19:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181001194448.10089-1-michael@amarulasolutions.com \
--to=michael@amarulasolutions.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox