summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu, Josh <Josh.wu@atmel.com>2013-10-18 17:46:31 +0800
committerScott Wood <scottwood@freescale.com>2013-11-21 13:33:41 -0600
commit16dddef6050471f47c84b6c929ae3c4bc9c0fb46 (patch)
tree365663bb1c2546ecbae0ceeba7a2f9bac2cf97a1
parentaffd520f8ce506eab96e66ad525c4807871e2981 (diff)
downloadu-boot-imx-16dddef6050471f47c84b6c929ae3c4bc9c0fb46.zip
u-boot-imx-16dddef6050471f47c84b6c929ae3c4bc9c0fb46.tar.gz
u-boot-imx-16dddef6050471f47c84b6c929ae3c4bc9c0fb46.tar.bz2
mtd: atmel_nand: enable PMECC support for 8k bytes page NAND flash
increase the delay to 75us to support the 8k bytes page nand flash Signed-off-by: Josh Wu <josh.wu@atmel.com>
-rw-r--r--drivers/mtd/nand/atmel_nand.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 10011c6..1d8c860 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -827,6 +827,7 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand,
switch (mtd->writesize) {
case 2048:
case 4096:
+ case 8192:
host->pmecc_degree = (sector_size == 512) ?
PMECC_GF_DIMENSION_13 : PMECC_GF_DIMENSION_14;
host->pmecc_cw_len = (1 << host->pmecc_degree) - 1;
@@ -840,6 +841,13 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand,
nand->ecc.steps = 1;
nand->ecc.bytes = host->pmecc_bytes_per_sector *
host->pmecc_sector_number;
+
+ if (nand->ecc.bytes > MTD_MAX_ECCPOS_ENTRIES_LARGE) {
+ dev_err(host->dev, "too large eccpos entries. max support ecc.bytes is %d\n",
+ MTD_MAX_ECCPOS_ENTRIES_LARGE);
+ return -EINVAL;
+ }
+
if (nand->ecc.bytes > mtd->oobsize - 2) {
printk(KERN_ERR "No room for ECC bytes\n");
return -EINVAL;
@@ -1190,7 +1198,7 @@ int atmel_nand_chip_init(int devnum, ulong base_addr)
#ifdef CONFIG_SYS_NAND_READY_PIN
nand->dev_ready = at91_nand_ready;
#endif
- nand->chip_delay = 20;
+ nand->chip_delay = 75;
ret = nand_scan_ident(mtd, CONFIG_SYS_NAND_MAX_CHIPS, NULL);
if (ret)