diff options
author | Huang Shijie <b32955@freescale.com> | 2013-05-16 23:17:26 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:06:01 -0400 |
commit | 473b70c9cdd74d966f98538d8226b6eb7cfaa878 (patch) | |
tree | daefade4307495e7ba119aa902924734a599ac27 | |
parent | 005563166596efd685d87c1ee2b60992bbe19a45 (diff) |
mtd: get the ECC info from the parameter page for ONFI nand
From the ONFI spec, we can just get the ECC info from the @ecc_bits field of
the parameter page.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Reviewed-and-tested-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index fcb5811ab51d..2c70ed432c72 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -2924,6 +2924,11 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, | |||
2924 | if (le16_to_cpu(p->features) & 1) | 2924 | if (le16_to_cpu(p->features) & 1) |
2925 | *busw = NAND_BUSWIDTH_16; | 2925 | *busw = NAND_BUSWIDTH_16; |
2926 | 2926 | ||
2927 | if (p->ecc_bits != 0xff) { | ||
2928 | chip->ecc_strength_ds = p->ecc_bits; | ||
2929 | chip->ecc_step_ds = 512; | ||
2930 | } | ||
2931 | |||
2927 | pr_info("ONFI flash detected\n"); | 2932 | pr_info("ONFI flash detected\n"); |
2928 | return 1; | 2933 | return 1; |
2929 | } | 2934 | } |