diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-18 15:10:50 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-23 16:25:13 +0200 |
commit | 66891566ccf72c19c3c25182f98eda4dc2a8ad3e (patch) | |
tree | 354cfc51aaba34cb14ba5802d8a60cb60c2cc91c /drivers/mtd/nand/atmel_nand.c | |
parent | 69f3d6c93b814c3464dea57538b90552de14caf4 (diff) | |
download | barebox-66891566ccf72c19c3c25182f98eda4dc2a8ad3e.tar.gz barebox-66891566ccf72c19c3c25182f98eda4dc2a8ad3e.tar.xz |
mtd: nand: update to v3.11-rc1
This updates the NAND stuff to Linux-3.11-rc1. It is synchronized
as best as we can get:
- locks removed
- The splitting in different files we had to better support different
features has been dropped. Instead this is now done mostly with the
use of __maybe_unused
Some barebox adjustments are forward ported, like:
- Allow partial page writes
- Optionally allow to erase bad blocks
- check for all_ff before writing a page
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/nand/atmel_nand.c')
-rw-r--r-- | drivers/mtd/nand/atmel_nand.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 3eb78b771b..a0f0966b04 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -624,7 +624,7 @@ normal_check: } static int atmel_nand_pmecc_read_page(struct mtd_info *mtd, - struct nand_chip *chip, uint8_t *buf) + struct nand_chip *chip, uint8_t *buf, int oob_required, int page) { struct atmel_nand_host *host = chip->priv; int eccsize = chip->ecc.size; @@ -659,8 +659,9 @@ static int atmel_nand_pmecc_read_page(struct mtd_info *mtd, return 0; } -static void atmel_nand_pmecc_write_page(struct mtd_info *mtd, - struct nand_chip *chip, const uint8_t *buf) +static int atmel_nand_pmecc_write_page(struct mtd_info *mtd, + struct nand_chip *chip, const uint8_t *buf, + int oob_required) { struct atmel_nand_host *host = chip->priv; uint32_t *eccpos = chip->ecc.layout->eccpos; @@ -681,7 +682,7 @@ static void atmel_nand_pmecc_write_page(struct mtd_info *mtd, !(pmecc_readl_relaxed(host->ecc, SR) & PMECC_SR_BUSY)); if (ret) { dev_err(host->dev, "PMECC: Timeout to get ECC value.\n"); - return; + return -ETIMEDOUT; } for (i = 0; i < host->pmecc_sector_number; i++) { @@ -694,6 +695,8 @@ static void atmel_nand_pmecc_write_page(struct mtd_info *mtd, } } chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); + + return 0; } static void atmel_pmecc_core_init(struct mtd_info *mtd) @@ -881,7 +884,7 @@ static int atmel_nand_calculate(struct mtd_info *mtd, * buf: buffer to store read data */ static int atmel_nand_read_page(struct mtd_info *mtd, - struct nand_chip *chip, uint8_t *buf) + struct nand_chip *chip, uint8_t *buf, int oob_required, int page) { int eccsize = chip->ecc.size; int eccbytes = chip->ecc.bytes; @@ -1201,7 +1204,7 @@ static int __init atmel_nand_probe(struct device_d *dev) /* first scan to find the device and get the page size */ - if (nand_scan_ident(mtd, 1)) { + if (nand_scan_ident(mtd, 1, NULL)) { res = -ENXIO; goto err_scan_ident; } |