base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0093-mtd-get-the-ECC-info-from-the-parameter-page-for-ONF.patch
1 From ceef2075f3aa430da137e3629b0280a46d420ccd Mon Sep 17 00:00:00 2001
2 From: Huang Shijie <b32955@freescale.com>
3 Date: Fri, 17 May 2013 11:17:26 +0800
4 Subject: [PATCH 093/203] mtd: get the ECC info from the parameter page for
5  ONFI nand
6
7 From the ONFI spec, we can just get the ECC info from the @ecc_bits field of
8 the parameter page.
9
10 Signed-off-by: Huang Shijie <b32955@freescale.com>
11 Reviewed-and-tested-by: Brian Norris <computersforpeace@gmail.com>
12 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
13 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 ---
15  drivers/mtd/nand/nand_base.c | 5 +++++
16  1 file changed, 5 insertions(+)
17
18 --- a/drivers/mtd/nand/nand_base.c
19 +++ b/drivers/mtd/nand/nand_base.c
20 @@ -2924,6 +2924,11 @@ static int nand_flash_detect_onfi(struct
21         if (le16_to_cpu(p->features) & 1)
22                 *busw = NAND_BUSWIDTH_16;
23  
24 +       if (p->ecc_bits != 0xff) {
25 +               chip->ecc_strength_ds = p->ecc_bits;
26 +               chip->ecc_step_ds = 512;
27 +       }
28 +
29         pr_info("ONFI flash detected\n");
30         return 1;
31  }