Skip to content

Commit

Permalink
mtd: rawnand: cadence: change bad block marker size
Browse files Browse the repository at this point in the history
Increase bad block marker size from one byte to two bytes.
Bad block marker is handled by skip bytes feature of HPNFC.
Controller expects this value to be an even number.

Fixes: ec4ba01 ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Cc: stable@vger.kernel.org
Signed-off-by: Piotr Sroka <piotrs@cadence.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1581328530-29966-3-git-send-email-piotrs@cadence.com
  • Loading branch information
Piotr Sroka authored and Miquel Raynal committed Mar 11, 2020
1 parent e4578af commit 9bf1903
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/mtd/nand/raw/cadence-nand-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -2612,12 +2612,9 @@ int cadence_nand_attach_chip(struct nand_chip *chip)
chip->options |= NAND_NO_SUBPAGE_WRITE;

cdns_chip->bbm_offs = chip->badblockpos;
if (chip->options & NAND_BUSWIDTH_16) {
cdns_chip->bbm_offs &= ~0x01;
cdns_chip->bbm_len = 2;
} else {
cdns_chip->bbm_len = 1;
}
cdns_chip->bbm_offs &= ~0x01;
/* this value should be even number */
cdns_chip->bbm_len = 2;

ret = nand_ecc_choose_conf(chip,
&cdns_ctrl->ecc_caps,
Expand Down

0 comments on commit 9bf1903

Please sign in to comment.