All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Graham Moore <grmoore@opensource.altera.com>,
	Enrico Jorns <ejo@pengutronix.de>,
	Chuanxiao Dong <chuanxiao.dong@intel.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: [PATCH v3 37/37] mtd: nand: denali: enable bad block table scan
Date: Thu, 30 Mar 2017 17:15:08 +0900	[thread overview]
Message-ID: <1490861708-27813-7-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1490861708-27813-1-git-send-email-yamada.masahiro@socionext.com>

Now this driver is ready to remove NAND_SKIP_BBTSCAN.

The BBT descriptors in denali.c are equivalent to the ones in
nand_bbt.c.  There is no need to duplicate the equivalent structures.
The with-oob decriptors do not work for this driver anyway.

The bbt_pattern (offs = 8) and the version (veroffs = 12) area
overlaps the ECC area.  Set NAND_BBT_NO_OOB flag to use the no_oob
variant of the BBT descriptors.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v3: None
Changes in v2:
  - Newly added

 drivers/mtd/nand/denali.c | 31 ++-----------------------------
 1 file changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index d10702d..de27c73 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1249,29 +1249,6 @@ static const struct mtd_ooblayout_ops denali_ooblayout_ops = {
 	.free = denali_ooblayout_free,
 };
 
-static uint8_t bbt_pattern[] = {'B', 'b', 't', '0' };
-static uint8_t mirror_pattern[] = {'1', 't', 'b', 'B' };
-
-static struct nand_bbt_descr bbt_main_descr = {
-	.options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE
-		| NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
-	.offs =	8,
-	.len = 4,
-	.veroffs = 12,
-	.maxblocks = 4,
-	.pattern = bbt_pattern,
-};
-
-static struct nand_bbt_descr bbt_mirror_descr = {
-	.options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE
-		| NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
-	.offs =	8,
-	.len = 4,
-	.veroffs = 12,
-	.maxblocks = 4,
-	.pattern = mirror_pattern,
-};
-
 /* initialize driver data structures */
 static void denali_drv_init(struct denali_nand_info *denali)
 {
@@ -1413,13 +1390,9 @@ int denali_init(struct denali_nand_info *denali)
 	 * bad block management.
 	 */
 
-	/* Bad block management */
-	chip->bbt_td = &bbt_main_descr;
-	chip->bbt_md = &bbt_mirror_descr;
-
-	/* skip the scan for now until we have OOB read and write support */
 	chip->bbt_options |= NAND_BBT_USE_FLASH;
-	chip->options |= NAND_SKIP_BBTSCAN;
+	chip->bbt_options |= NAND_BBT_NO_OOB;
+
 	chip->ecc.mode = NAND_ECC_HW_SYNDROME;
 
 	/* no subpage writes on denali */
-- 
2.7.4

      parent reply	other threads:[~2017-03-30  8:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  8:15 [PATCH v3 31/37] mtd: nand: denali: fix raw and oob accessors for syndrome page layout Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 32/37] mtd: nand: denali: support hardware-assisted erased page detection Masahiro Yamada
2017-03-30 16:30   ` Boris Brezillon
2017-06-06  2:04     ` Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 33/37] mtd: nand: allocate aligned buffers if NAND_OWN_BUFFERS is unset Masahiro Yamada
2017-04-06 14:08   ` Leonard Crestez
2017-04-07  6:49     ` Masahiro Yamada
2017-04-09  7:33       ` Boris Brezillon
2017-04-09 14:17   ` Boris Brezillon
2017-04-09 14:17     ` Boris Brezillon
2017-04-10  0:20     ` Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 34/37] mtd: nand: allow drivers to request minimum alignment for passed buffer Masahiro Yamada
2017-03-31  4:01   ` Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 35/37] mtd: nand: denali: skip driver internal bounce buffer when possible Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 36/37] mtd: nand: denali: use non-managed kmalloc() for DMA buffer Masahiro Yamada
2017-03-30  8:15 ` Masahiro Yamada [this message]

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=1490861708-27813-7-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=chuanxiao.dong@intel.com \
    --cc=dinguyen@kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=ejo@pengutronix.de \
    --cc=grmoore@opensource.altera.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=mhiramat@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.