From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeanmarie.lemetayer@altran.com (Jean-Marie Lemetayer) Date: Wed, 31 Mar 2010 15:19:50 +0200 Subject: [PATCH] Arm nomadik : Vendor tool compatibility Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org The patch adds a compatibility with the vendor toolset which use a different convention for the ECC bytes in the flash memory. Acked-by: Alessandro Rubini Signed-off-by: Jean-Marie Lemetayer --- arch/arm/mach-nomadik/Kconfig | 11 +++++++++++ drivers/mtd/nand/nomadik_nand.c | 12 ++++++++++++ 2 files changed, 23 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-nomadik/Kconfig = b/arch/arm/mach-nomadik/Kconfig index 2a02b49..af9bcca 100644 --- a/arch/arm/mach-nomadik/Kconfig +++ b/arch/arm/mach-nomadik/Kconfig @@ -18,4 +18,15 @@ config I2C_BITBANG_8815NHK select I2C_ALGOBIT default y =20 +config VENDOR_TOOL_COMPATIBILITY + bool "Compatibility for vendor tool" + default n + help + Some flash programmers can use a different placement of + ECC bytes of the convention. Using two different placements + causes errors and makes the memory unreadable. + The use of the vendor toolset to program the memory, can + leads to this problem. + say N if not sure + endif diff --git a/drivers/mtd/nand/nomadik_nand.c = b/drivers/mtd/nand/nomadik_nand.c index 7c302d5..9ebe681 100644 --- a/drivers/mtd/nand/nomadik_nand.c +++ b/drivers/mtd/nand/nomadik_nand.c @@ -44,6 +44,17 @@ struct nomadik_nand_host { struct nand_bbt_descr *bbt_desc; }; =20 +#ifdef CONFIG_VENDOR_TOOL_COMPATIBILITY +static struct nand_ecclayout nomadik_ecc_layout =3D { + .eccbytes =3D 3 * 4, + .eccpos =3D { + 0x28, 0x29, 0x2A, + 0x2B, 0x2C, 0x2D, + 0x2E, 0x2F, 0x30, + 0x31, 0x32, 0x33}, + .oobfree =3D {{0x02, 0x26}, {0x34, 0x0C} }, +}; +#else static struct nand_ecclayout nomadik_ecc_layout =3D { .eccbytes =3D 3 * 4, .eccpos =3D { /* each subpage has 16 bytes: pos 2,3,4 hosts ECC */ @@ -54,6 +65,7 @@ static struct nand_ecclayout nomadik_ecc_layout =3D { /* let's keep bytes 5,6,7 for us, just in case we change ECC algo */ .oobfree =3D { {0x08, 0x08}, {0x18, 0x08}, {0x28, 0x08}, {0x38, 0x08} = }, }; +#endif =20 static void nomadik_ecc_control(struct mtd_info *mtd, int mode) { --=20 1.6.0.4 ------_=_NextPart_001_01CAD0E3.E8424BB7 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable [PATCH] Arm nomadik : Vendor tool compatibility

From a2e31cef5783b8123c10df7a32d4f3a1c08a3803 Mon Sep = 17 00:00:00 2001
From: Jean-Marie Lemetayer <jeanmarie.lemetayer at altran.com>
Date: Wed, 31 Mar 2010 15:19:50 +0200
Subject: [PATCH] Arm nomadik : Vendor tool compatibility

The patch adds a compatibility with the vendor toolset which use
a different convention for the ECC bytes in the flash memory.

Acked-by: Alessandro Rubini <rubini at gnudd.com>
Signed-off-by: Jean-Marie Lemetayer = <jeanmarie.lemetayer at altran.com>
---
 arch/arm/mach-nomadik/Kconfig   |   11 = +++++++++++
 drivers/mtd/nand/nomadik_nand.c |   12 ++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-nomadik/Kconfig = b/arch/arm/mach-nomadik/Kconfig
index 2a02b49..af9bcca 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -18,4 +18,15 @@ config I2C_BITBANG_8815NHK
        select I2C_ALGOBIT
        default y

+config VENDOR_TOOL_COMPATIBILITY
+       bool "Compatibility for = vendor tool"
+       default n
+       help
+         Some flash programmers can = use a different placement of
+         ECC bytes of the = convention. Using two different placements
+         causes errors and makes the = memory unreadable.
+         The use of the vendor = toolset to program the memory, can
+         leads to this problem.
+         say N if not sure
+
 endif
diff --git a/drivers/mtd/nand/nomadik_nand.c = b/drivers/mtd/nand/nomadik_nand.c
index 7c302d5..9ebe681 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -44,6 +44,17 @@ struct nomadik_nand_host {
        struct nand_bbt_descr = *bbt_desc;
 };

+#ifdef CONFIG_VENDOR_TOOL_COMPATIBILITY
+static struct nand_ecclayout nomadik_ecc_layout =3D {
+       .eccbytes =3D 3 * 4,
+       .eccpos =3D {
+       =         0x28, 0x29, 0x2A,
+       =         0x2B, 0x2C, 0x2D,
+       =         0x2E, 0x2F, 0x30,
+       =         0x31, 0x32, 0x33},
+       .oobfree =3D {{0x02, 0x26}, {0x34, = 0x0C} },
+};
+#else
 static struct nand_ecclayout nomadik_ecc_layout =3D {
        .eccbytes =3D 3 * 4,
        .eccpos =3D { /* each subpage = has 16 bytes: pos 2,3,4 hosts ECC */
@@ -54,6 +65,7 @@ static struct nand_ecclayout nomadik_ecc_layout =3D = {
        /* let's keep bytes 5,6,7 for = us, just in case we change ECC algo */
        .oobfree =3D { {0x08, 0x08}, = {0x18, 0x08}, {0x28, 0x08}, {0x38, 0x08} },
 };
+#endif

 static void nomadik_ecc_control(struct mtd_info *mtd, int = mode)
 {
--
1.6.0.4



------_=_NextPart_001_01CAD0E3.E8424BB7--