Commit 598dce70 authored by Frieder Schrempf's avatar Frieder Schrempf Committed by Miquel Raynal
Browse files

mtd: rawnand: AMD: Also use the last page for bad block markers



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: default avatarFrieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: default avatarBoris Brezillon <bbrezillon@kernel.org>
Reviewed-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 7a1894a9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -45,7 +45,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->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE;
		/*
		 * 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->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE |
				 NAND_BBM_LASTPAGE;

	return 0;
}