125-mtd-nand-sunxi-extend-bbt_options.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. From a5ba30016f4a29f5875112169a92a28a9ba7f5c9 Mon Sep 17 00:00:00 2001
  2. From: Hans de Goede <hdegoede@redhat.com>
  3. Date: Mon, 25 May 2015 11:59:03 +0200
  4. Subject: [PATCH] mtd: nand: sunxi: Add NAND_BBT_CREATE_EMPTY to bbt_options
  5. The ftl format used by the Allwinner Android kernels, with which most
  6. Allwinnner devices ship, overrides the factory bad block markers, and
  7. fills the oob data with a pattern which causes a lot of false bad block
  8. positives, so when we first create a bbt table, start with an empty one
  9. to avoid marking a ton of blocks as bad from the start.
  10. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  11. ---
  12. drivers/mtd/nand/sunxi_nand.c | 9 +++++++++
  13. 1 file changed, 9 insertions(+)
  14. --- a/drivers/mtd/nand/sunxi_nand.c
  15. +++ b/drivers/mtd/nand/sunxi_nand.c
  16. @@ -1851,6 +1851,15 @@ static int sunxi_nand_chip_init(struct d
  17. if (of_get_nand_on_flash_bbt(np))
  18. nand->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
  19. + /*
  20. + * The ftl format used by the Allwinner Android kernels overrides
  21. + * the factory bad block markers, and fills the oob data with a
  22. + * pattern which causes a lot of false bad block positives, so
  23. + * when we first create a bbt table, start with an empty one
  24. + * to avoid marking a ton of blocks as bad from the start.
  25. + */
  26. + nand->bbt_options |= NAND_BBT_CREATE_EMPTY;
  27. +
  28. mtd = &chip->mtd;
  29. mtd->dev.parent = dev;
  30. mtd->priv = nand;