0040-nand-hack-restore-write_page.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --- a/include/linux/mtd/rawnand.h
  2. +++ b/include/linux/mtd/rawnand.h
  3. @@ -885,6 +885,9 @@ struct nand_chip {
  4. int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
  5. int (*erase)(struct mtd_info *mtd, int page);
  6. int (*scan_bbt)(struct mtd_info *mtd);
  7. + int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
  8. + uint32_t offset, int data_len, const uint8_t *buf,
  9. + int oob_required, int page, int raw);
  10. int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip,
  11. int feature_addr, uint8_t *subfeature_para);
  12. int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,
  13. --- a/drivers/mtd/nand/nand_base.c
  14. +++ b/drivers/mtd/nand/nand_base.c
  15. @@ -2753,9 +2753,14 @@ static int nand_do_write_ops(struct mtd_
  16. memset(chip->oob_poi, 0xff, mtd->oobsize);
  17. }
  18. - ret = nand_write_page(mtd, chip, column, bytes, wbuf,
  19. - oob_required, page,
  20. - (ops->mode == MTD_OPS_RAW));
  21. +// if (chip->write_page)
  22. + ret = chip->write_page(mtd, chip, column, bytes, wbuf,
  23. + oob_required, page,
  24. + (ops->mode == MTD_OPS_RAW));
  25. +// else
  26. +// ret = nand_write_page(mtd, chip, column, bytes, wbuf,
  27. +// oob_required, page,
  28. +// (ops->mode == MTD_OPS_RAW));
  29. if (ret)
  30. break;
  31. @@ -4711,6 +4716,9 @@ int nand_scan_tail(struct mtd_info *mtd)
  32. }
  33. }
  34. +// if (!chip->write_page)
  35. +// chip->write_page = nand_write_page;
  36. +
  37. /*
  38. * Check ECC mode, default to software if 3byte/512byte hardware ECC is
  39. * selected and we have 256 byte pagesize fallback to software ECC