ARM: mvebu: Netgear RN2120: Use Hardware BCH ECC
authorArnaud Ebalard <arno@natisbad.org>
Sat, 6 Sep 2014 20:49:38 +0000 (22:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 16:38:25 +0000 (09:38 -0700)
commit 500abb6ccb9e3f8d638a7f422443a8549245ef90 upstream.

The bootloader on the Netgear ReadyNAS RN2120 uses Hardware BCH
ECC (strength = 4), while the pxa3xx NAND driver by default uses
Hamming ECC (strength = 1).

This patch changes the ECC mode on these machines to match that
of the bootloader and of the stock firmware. That way, it is
now possible to update the kernel from userland (e.g. using
standard tools from mtd-utils package); u-boot will happily
load and boot it.

The issue was initially reported and fixed by Ben Pedell for
RN102. The RN2120 shares the same Hynix H27U1G8F2BTR NAND
flash and setup. This patch is based on Ben's fix for RN102.

Fixes: ad51eddd95ad ("ARM: mvebu: Enable NAND controller in ReadyNAS 2120 .dts file")
Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Link: https://lkml.kernel.org/r/61f6a1b7ad0adc57a0e201b9680bc2e5f214a317.1410035142.git.arno@natisbad.org
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts

index ff049ee..b4aba09 100644 (file)
                                marvell,nand-enable-arbiter;
                                nand-on-flash-bbt;
 
+                               /* Use Hardware BCH ECC */
+                               nand-ecc-strength = <4>;
+                               nand-ecc-step-size = <512>;
+
                                partition@0 {
                                        label = "u-boot";
                                        reg = <0x0000000 0x180000>;  /* 1.5MB */