OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 16... | Line 16... | |||
16 | oob_required, page); |
16 | oob_required, page); |
|
17 | +#endif |
17 | +#endif |
|
18 | if (ret < 0) { |
18 | if (ret < 0) { |
|
19 | if (use_bufpoi) |
19 | if (use_bufpoi) |
|
20 | /* Invalidate page cache */ |
20 | /* Invalidate page cache */ |
|
- | 21 | @@ -2761,9 +2765,14 @@ static int nand_do_write_ops(struct mtd_ |
||
- | 22 | memset(chip->oob_poi, 0xff, mtd->oobsize); |
||
- | 23 | } |
||
- | 24 | |
||
- | 25 | - ret = nand_write_page(mtd, chip, column, bytes, wbuf, |
||
- | 26 | - oob_required, page, |
||
- | 27 | - (ops->mode == MTD_OPS_RAW)); |
||
- | 28 | + if (chip->write_page) |
||
- | 29 | + ret = chip->write_page(mtd, chip, column, bytes, wbuf, |
||
- | 30 | + oob_required, page, |
||
- | 31 | + (ops->mode == MTD_OPS_RAW)); |
||
- | 32 | + else |
||
- | 33 | + ret = nand_write_page(mtd, chip, column, bytes, wbuf, |
||
- | 34 | + oob_required, page, |
||
- | 35 | + (ops->mode == MTD_OPS_RAW)); |
||
- | 36 | if (ret) |
||
- | 37 | break; |
||
- | 38 | |
||
21 | --- a/include/linux/mtd/rawnand.h |
39 | --- a/include/linux/mtd/rawnand.h |
|
22 | +++ b/include/linux/mtd/rawnand.h |
40 | +++ b/include/linux/mtd/rawnand.h |
|
- | 41 | @@ -885,6 +885,9 @@ struct nand_chip { |
||
- | 42 | int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); |
||
- | 43 | int (*erase)(struct mtd_info *mtd, int page); |
||
- | 44 | int (*scan_bbt)(struct mtd_info *mtd); |
||
- | 45 | + int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, |
||
- | 46 | + uint32_t offset, int data_len, const uint8_t *buf, |
||
- | 47 | + int oob_required, int page, int raw); |
||
- | 48 | int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip, |
||
- | 49 | int feature_addr, uint8_t *subfeature_para); |
||
- | 50 | int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip, |
||
23 | @@ -897,6 +897,9 @@ struct nand_chip { |
51 | @@ -893,6 +896,9 @@ struct nand_chip { |
|
24 | int (*setup_data_interface)(struct mtd_info *mtd, int chipnr, |
52 | int (*setup_data_interface)(struct mtd_info *mtd, int chipnr, |
|
25 | const struct nand_data_interface *conf); |
53 | const struct nand_data_interface *conf); |
|
Line 26... | Line 54... | |||
26 | |
54 | |
|
27 | +#ifdef CONFIG_MTK_MTD_NAND |
55 | +#ifdef CONFIG_MTK_MTD_NAND |