[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1545061693-29216-4-git-send-email-frieder.schrempf@kontron.de>
Date: Mon, 17 Dec 2018 15:49:15 +0000
From: Schrempf Frieder <frieder.schrempf@...tron.de>
To: "boris.brezillon@...tlin.com" <boris.brezillon@...tlin.com>,
"miquel.raynal@...tlin.com" <miquel.raynal@...tlin.com>,
"richard@....at" <richard@....at>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"Schrempf Frieder" <frieder.schrempf@...tron.de>,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
Marek Vasut <marek.vasut@...il.com>
Subject: [PATCH 3/3] mtd: rawnand: AMD: Also use the last page for bad block
markers
From: Frieder Schrempf <frieder.schrempf@...tron.de>
According to the datasheet of some Cypress SLC NANDs, the bad
block markers can be in the first, second or last page of a block.
So let's check all three locations.
Signed-off-by: Frieder Schrempf <frieder.schrempf@...tron.de>
---
drivers/mtd/nand/raw/nand_amd.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/nand_amd.c b/drivers/mtd/nand/raw/nand_amd.c
index 890c5b4..aad5f14 100644
--- a/drivers/mtd/nand/raw/nand_amd.c
+++ b/drivers/mtd/nand/raw/nand_amd.c
@@ -40,7 +40,13 @@ static void amd_nand_decode_id(struct nand_chip *chip)
static int amd_nand_init(struct nand_chip *chip)
{
if (nand_is_slc(chip))
- chip->bbt_options |= NAND_BBT_SCAN2NDPAGE;
+ /*
+ * According to the datasheet of some Cypress SLC NANDs,
+ * the bad block markers can be in the first, second or last
+ * page of a block. So let's check all three locations.
+ */
+ chip->bbt_options |= NAND_BBT_SCAN2NDPAGE |
+ NAND_BBT_SCANLASTPAGE;
return 0;
}
--
2.7.4
Powered by blists - more mailing lists