2018-01-16 22:07:58 +00:00
|
|
|
--- a/include/linux/mtd/rawnand.h
|
|
|
|
+++ b/include/linux/mtd/rawnand.h
|
|
|
|
@@ -885,6 +885,9 @@ struct nand_chip {
|
|
|
|
int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
|
|
|
|
int (*erase)(struct mtd_info *mtd, int page);
|
|
|
|
int (*scan_bbt)(struct mtd_info *mtd);
|
|
|
|
+ int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
|
|
|
|
+ uint32_t offset, int data_len, const uint8_t *buf,
|
|
|
|
+ int oob_required, int page, int raw);
|
|
|
|
int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip,
|
|
|
|
int feature_addr, uint8_t *subfeature_para);
|
|
|
|
int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,
|
|
|
|
--- a/drivers/mtd/nand/nand_base.c
|
|
|
|
+++ b/drivers/mtd/nand/nand_base.c
|
2018-03-22 17:34:08 +00:00
|
|
|
@@ -2761,9 +2761,14 @@ static int nand_do_write_ops(struct mtd_
|
2018-01-16 22:07:58 +00:00
|
|
|
memset(chip->oob_poi, 0xff, mtd->oobsize);
|
|
|
|
}
|
|
|
|
|
|
|
|
- ret = nand_write_page(mtd, chip, column, bytes, wbuf,
|
|
|
|
- oob_required, page,
|
|
|
|
- (ops->mode == MTD_OPS_RAW));
|
|
|
|
+// if (chip->write_page)
|
|
|
|
+ ret = chip->write_page(mtd, chip, column, bytes, wbuf,
|
|
|
|
+ oob_required, page,
|
|
|
|
+ (ops->mode == MTD_OPS_RAW));
|
|
|
|
+// else
|
|
|
|
+// ret = nand_write_page(mtd, chip, column, bytes, wbuf,
|
|
|
|
+// oob_required, page,
|
|
|
|
+// (ops->mode == MTD_OPS_RAW));
|
|
|
|
if (ret)
|
|
|
|
break;
|
|
|
|
|
2018-03-22 17:34:08 +00:00
|
|
|
@@ -4719,6 +4724,9 @@ int nand_scan_tail(struct mtd_info *mtd)
|
2018-01-16 22:07:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+// if (!chip->write_page)
|
|
|
|
+// chip->write_page = nand_write_page;
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Check ECC mode, default to software if 3byte/512byte hardware ECC is
|
|
|
|
* selected and we have 256 byte pagesize fallback to software ECC
|