diff options
Diffstat (limited to 'target/linux/ipq806x/patches-4.14/0047-mtd-nand-Create-a-BBT-flag-to-access-bad-block-marke.patch')
-rw-r--r-- | target/linux/ipq806x/patches-4.14/0047-mtd-nand-Create-a-BBT-flag-to-access-bad-block-marke.patch | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/target/linux/ipq806x/patches-4.14/0047-mtd-nand-Create-a-BBT-flag-to-access-bad-block-marke.patch b/target/linux/ipq806x/patches-4.14/0047-mtd-nand-Create-a-BBT-flag-to-access-bad-block-marke.patch index 4c271d71fa..fe98980766 100644 --- a/target/linux/ipq806x/patches-4.14/0047-mtd-nand-Create-a-BBT-flag-to-access-bad-block-marke.patch +++ b/target/linux/ipq806x/patches-4.14/0047-mtd-nand-Create-a-BBT-flag-to-access-bad-block-marke.patch @@ -28,38 +28,38 @@ Signed-off-by: Archit Taneja <architt@codeaurora.org> --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -481,7 +481,11 @@ static int nand_default_block_markbad(st - } else { - ops.len = ops.ooblen = 1; - } + } else { + ops.len = ops.ooblen = 1; + } - ops.mode = MTD_OPS_PLACE_OOB; + + if (unlikely(chip->bbt_options & NAND_BBT_ACCESS_BBM_RAW)) + ops.mode = MTD_OPS_RAW; + else + ops.mode = MTD_OPS_PLACE_OOB; - - /* Write to first/last page(s) if necessary */ - if (chip->bbt_options & NAND_BBT_SCANLASTPAGE) + + /* Write to first/last page(s) if necessary */ + if (chip->bbt_options & NAND_BBT_SCANLASTPAGE) --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -420,7 +420,11 @@ static int scan_block_fast(struct mtd_in - ops.oobbuf = buf; - ops.ooboffs = 0; - ops.datbuf = NULL; + ops.oobbuf = buf; + ops.ooboffs = 0; + ops.datbuf = NULL; - ops.mode = MTD_OPS_PLACE_OOB; + + if (unlikely(bd->options & NAND_BBT_ACCESS_BBM_RAW)) + ops.mode = MTD_OPS_RAW; + else + ops.mode = MTD_OPS_PLACE_OOB; - - for (j = 0; j < numpages; j++) { - /* + + for (j = 0; j < numpages; j++) { + /* --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h @@ -116,6 +116,12 @@ struct nand_bbt_descr { #define NAND_BBT_NO_OOB_BBM 0x00080000 - + /* + * Force MTD_OPS_RAW mode when trying to access bad block markes from OOB. To + * be used by controllers which can access BBM only when ECC is disabled, i.e, |