]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ARM: OMAP2+: GPMC: Support Software ECC scheme via DT
authorRoger Quadros <rogerq@ti.com>
Mon, 25 Aug 2014 23:15:33 +0000 (16:15 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 25 Aug 2014 23:15:33 +0000 (16:15 -0700)
For v3.14 and prior, 1-bit Hamming code ECC via software was the
default choice for some boards e.g. 3430sdp.
Commit ac65caf514ec in v3.15 changed the behaviour
to use 1-bit Hamming code via Hardware using a different ECC layout
i.e. (ROM code layout) than what is used by software ECC.

This ECC layout change causes NAND filesystems created in v3.14
and prior to be unusable in v3.15 and later. So don't mark "sw" scheme
as deperecated and support it.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Documentation/devicetree/bindings/mtd/gpmc-nand.txt
arch/arm/mach-omap2/gpmc.c

index 65f4f7c43136a0507ddbb23a7dc511c94cc34cdb..ee654e95d8ad55c3b53259b9f087be596b6dc99a 100644 (file)
@@ -22,7 +22,7 @@ Optional properties:
                                width of 8 is assumed.
 
  - ti,nand-ecc-opt:            A string setting the ECC layout to use. One of:
-               "sw"            <deprecated> use "ham1" instead
+               "sw"            1-bit Hamming ecc code via software
                "hw"            <deprecated> use "ham1" instead
                "hw-romcode"    <deprecated> use "ham1" instead
                "ham1"          1-bit Hamming ecc code
index 8bc13380f0a06ec14859b8c274883142a14ef968..9f42d5437fcc52e6cb3693f5dbbab18b29c6aebf 100644 (file)
@@ -1403,8 +1403,11 @@ static int gpmc_probe_nand_child(struct platform_device *pdev,
                pr_err("%s: ti,nand-ecc-opt not found\n", __func__);
                return -ENODEV;
        }
-       if (!strcmp(s, "ham1") || !strcmp(s, "sw") ||
-               !strcmp(s, "hw") || !strcmp(s, "hw-romcode"))
+
+       if (!strcmp(s, "sw"))
+               gpmc_nand_data->ecc_opt = OMAP_ECC_HAM1_CODE_SW;
+       else if (!strcmp(s, "ham1") ||
+                !strcmp(s, "hw") || !strcmp(s, "hw-romcode"))
                gpmc_nand_data->ecc_opt =
                                OMAP_ECC_HAM1_CODE_HW;
        else if (!strcmp(s, "bch4"))