All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Arm nomadik : Vendor tool compatibility
@ 2010-03-31 15:06 ` Lemetayer Jean Marie
  2010-03-31 23:34     ` Linus Walleij
  0 siblings, 1 reply; 9+ messages in thread
From: Lemetayer Jean Marie @ 2010-03-31 15:06 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Arm nomadik : Vendor tool compatibility
  2010-03-31 15:06 ` [PATCH] Arm nomadik : Vendor tool compatibility Lemetayer Jean Marie
  2010-03-31 23:34     ` Linus Walleij
@ 2010-03-31 23:34     ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2010-03-31 23:34 UTC (permalink / raw)
  To: Lemetayer Jean Marie
  Cc: linux, dwmw2, linux-mtd, linux-kernel, linux-arm-kernel

2010/3/31 Lemetayer Jean Marie <jeanmarie.lemetayer@altran.com>:

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

Acked-by: Linus Walleij <linus.walleij@stericsson.com>

I don't think any of this layout belongs in the driver itself frankly speaking,
I am facing the need to use this in U300 and we use yet *another*
ECC layout with the FSMC, so we have to add yet another #ifdef.
However I can fix that up with a patch on top of this one after it's
queued.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Arm nomadik : Vendor tool compatibility
@ 2010-03-31 23:34     ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2010-03-31 23:34 UTC (permalink / raw)
  To: Lemetayer Jean Marie
  Cc: linux-arm-kernel, dwmw2, linux, linux-kernel, linux-mtd

2010/3/31 Lemetayer Jean Marie <jeanmarie.lemetayer@altran.com>:

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

Acked-by: Linus Walleij <linus.walleij@stericsson.com>

I don't think any of this layout belongs in the driver itself frankly speaking,
I am facing the need to use this in U300 and we use yet *another*
ECC layout with the FSMC, so we have to add yet another #ifdef.
However I can fix that up with a patch on top of this one after it's
queued.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Arm nomadik : Vendor tool compatibility
@ 2010-03-31 23:34     ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2010-03-31 23:34 UTC (permalink / raw)
  To: linux-arm-kernel

2010/3/31 Lemetayer Jean Marie <jeanmarie.lemetayer@altran.com>:

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

Acked-by: Linus Walleij <linus.walleij@stericsson.com>

I don't think any of this layout belongs in the driver itself frankly speaking,
I am facing the need to use this in U300 and we use yet *another*
ECC layout with the FSMC, so we have to add yet another #ifdef.
However I can fix that up with a patch on top of this one after it's
queued.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Arm nomadik : Vendor tool compatibility
  2010-03-31 23:34     ` Linus Walleij
  (?)
  (?)
@ 2010-04-12 19:29     ` Jean-Michel Hautbois
  2010-04-13  0:26         ` Linus Walleij
  -1 siblings, 1 reply; 9+ messages in thread
From: Jean-Michel Hautbois @ 2010-04-12 19:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Linus,

2010/4/1 Linus Walleij <linus.ml.walleij@gmail.com>

> 2010/3/31 Lemetayer Jean Marie <jeanmarie.lemetayer@altran.com>:
>
> > +#ifdef CONFIG_VENDOR_TOOL_COMPATIBILITY
> > +static struct nand_ecclayout nomadik_ecc_layout = {
> > +       .eccbytes = 3 * 4,
> > +       .eccpos = {
> > +               0x28, 0x29, 0x2A,
> > +               0x2B, 0x2C, 0x2D,
> > +               0x2E, 0x2F, 0x30,
> > +               0x31, 0x32, 0x33},
> > +       .oobfree = {{0x02, 0x26}, {0x34, 0x0C} },
> > +};
> > +#else
> >  static struct nand_ecclayout nomadik_ecc_layout = {
> >         .eccbytes = 3 * 4,
> >         .eccpos = { /* each subpage has 16 bytes: pos 2,3,4 hosts ECC */
> > @@ -54,6 +65,7 @@ static struct nand_ecclayout nomadik_ecc_layout = {
> >         /* let's keep bytes 5,6,7 for us, just in case we change ECC algo
> */
> >         .oobfree = { {0x08, 0x08}, {0x18, 0x08}, {0x28, 0x08}, {0x38,
> 0x08}
> > },
> >  };
> > +#endif
>
> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
>
> I don't think any of this layout belongs in the driver itself frankly
> speaking,
> I am facing the need to use this in U300 and we use yet *another*
> ECC layout with the FSMC, so we have to add yet another #ifdef.
> However I can fix that up with a patch on top of this one after it's
> queued.
>
> Yours,
> Linus Walleij
>

What king of modification would you do ?
Do you think it shall be queued before your submission ?

Regards,
JM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100412/d06c9e57/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Arm nomadik : Vendor tool compatibility
  2010-04-12 19:29     ` Jean-Michel Hautbois
  2010-04-13  0:26         ` Linus Walleij
@ 2010-04-13  0:26         ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2010-04-13  0:26 UTC (permalink / raw)
  To: Jean-Michel Hautbois
  Cc: Lemetayer Jean Marie, linux-arm-kernel, dwmw2, linux,
	linux-kernel, linux-mtd

2010/4/12 Jean-Michel Hautbois <jhautbois@gmail.com>:

> What king of modification would you do ?

Instead of coding the ECC layout into the driver I would move it to the
machine config in arch/arm/mach-* and pass it in as platform data
to the driver.

> Do you think it shall be queued before your submission ?

I will fix it for all users the day I have time, please queue this
as it is now.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Arm nomadik : Vendor tool compatibility
@ 2010-04-13  0:26         ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2010-04-13  0:26 UTC (permalink / raw)
  To: Jean-Michel Hautbois
  Cc: linux, linux-kernel, Lemetayer Jean Marie, linux-mtd, dwmw2,
	linux-arm-kernel

2010/4/12 Jean-Michel Hautbois <jhautbois@gmail.com>:

> What king of modification would you do ?

Instead of coding the ECC layout into the driver I would move it to the
machine config in arch/arm/mach-* and pass it in as platform data
to the driver.

> Do you think it shall be queued before your submission ?

I will fix it for all users the day I have time, please queue this
as it is now.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Arm nomadik : Vendor tool compatibility
@ 2010-04-13  0:26         ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2010-04-13  0:26 UTC (permalink / raw)
  To: linux-arm-kernel

2010/4/12 Jean-Michel Hautbois <jhautbois@gmail.com>:

> What king of modification would you do ?

Instead of coding the ECC layout into the driver I would move it to the
machine config in arch/arm/mach-* and pass it in as platform data
to the driver.

> Do you think it shall be queued before your submission ?

I will fix it for all users the day I have time, please queue this
as it is now.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Arm nomadik : Vendor tool compatibility
@ 2010-03-31 13:19 Jean-Marie Lemetayer
  0 siblings, 0 replies; 9+ messages in thread
From: Jean-Marie Lemetayer @ 2010-03-31 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

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@gnudd.com>
Signed-off-by: Jean-Marie Lemetayer <jeanmarie.lemetayer@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
=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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7654.12">
<TITLE>[PATCH] Arm nomadik : Vendor tool compatibility</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=3D2>From a2e31cef5783b8123c10df7a32d4f3a1c08a3803 Mon Sep =
17 00:00:00 2001<BR>
From: Jean-Marie Lemetayer &lt;jeanmarie.lemetayer at altran.com&gt;<BR>
Date: Wed, 31 Mar 2010 15:19:50 +0200<BR>
Subject: [PATCH] Arm nomadik : Vendor tool compatibility<BR>
<BR>
The patch adds a compatibility with the vendor toolset which use<BR>
a different convention for the ECC bytes in the flash memory.<BR>
<BR>
Acked-by: Alessandro Rubini &lt;rubini at gnudd.com&gt;<BR>
Signed-off-by: Jean-Marie Lemetayer =
&lt;jeanmarie.lemetayer at altran.com&gt;<BR>
---<BR>
&nbsp;arch/arm/mach-nomadik/Kconfig&nbsp;&nbsp; |&nbsp;&nbsp; 11 =
+++++++++++<BR>
&nbsp;drivers/mtd/nand/nomadik_nand.c |&nbsp;&nbsp; 12 ++++++++++++<BR>
&nbsp;2 files changed, 23 insertions(+), 0 deletions(-)<BR>
<BR>
diff --git a/arch/arm/mach-nomadik/Kconfig =
b/arch/arm/mach-nomadik/Kconfig<BR>
index 2a02b49..af9bcca 100644<BR>
--- a/arch/arm/mach-nomadik/Kconfig<BR>
+++ b/arch/arm/mach-nomadik/Kconfig<BR>
@@ -18,4 +18,15 @@ config I2C_BITBANG_8815NHK<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select I2C_ALGOBIT<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default y<BR>
<BR>
+config VENDOR_TOOL_COMPATIBILITY<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool &quot;Compatibility for =
vendor tool&quot;<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default n<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; help<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Some flash programmers can =
use a different placement of<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ECC bytes of the =
convention. Using two different placements<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; causes errors and makes the =
memory unreadable.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; The use of the vendor =
toolset to program the memory, can<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; leads to this problem.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; say N if not sure<BR>
+<BR>
&nbsp;endif<BR>
diff --git a/drivers/mtd/nand/nomadik_nand.c =
b/drivers/mtd/nand/nomadik_nand.c<BR>
index 7c302d5..9ebe681 100644<BR>
--- a/drivers/mtd/nand/nomadik_nand.c<BR>
+++ b/drivers/mtd/nand/nomadik_nand.c<BR>
@@ -44,6 +44,17 @@ struct nomadik_nand_host {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct nand_bbt_descr =
*bbt_desc;<BR>
&nbsp;};<BR>
<BR>
+#ifdef CONFIG_VENDOR_TOOL_COMPATIBILITY<BR>
+static struct nand_ecclayout nomadik_ecc_layout =3D {<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .eccbytes =3D 3 * 4,<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .eccpos =3D {<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x28, 0x29, 0x2A,<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x2B, 0x2C, 0x2D,<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x2E, 0x2F, 0x30,<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x31, 0x32, 0x33},<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .oobfree =3D {{0x02, 0x26}, {0x34, =
0x0C} },<BR>
+};<BR>
+#else<BR>
&nbsp;static struct nand_ecclayout nomadik_ecc_layout =3D {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .eccbytes =3D 3 * 4,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .eccpos =3D { /* each subpage =
has 16 bytes: pos 2,3,4 hosts ECC */<BR>
@@ -54,6 +65,7 @@ static struct nand_ecclayout nomadik_ecc_layout =3D =
{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* let's keep bytes 5,6,7 for =
us, just in case we change ECC algo */<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .oobfree =3D { {0x08, 0x08}, =
{0x18, 0x08}, {0x28, 0x08}, {0x38, 0x08} },<BR>
&nbsp;};<BR>
+#endif<BR>
<BR>
&nbsp;static void nomadik_ecc_control(struct mtd_info *mtd, int =
mode)<BR>
&nbsp;{<BR>
--<BR>
1.6.0.4<BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01CAD0E3.E8424BB7--

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-13  0:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AcrQ47RPeBz4nhRMR9ORyzmB2isxaQ==>
2010-03-31 15:06 ` [PATCH] Arm nomadik : Vendor tool compatibility Lemetayer Jean Marie
2010-03-31 23:34   ` Linus Walleij
2010-03-31 23:34     ` Linus Walleij
2010-03-31 23:34     ` Linus Walleij
2010-04-12 19:29     ` Jean-Michel Hautbois
2010-04-13  0:26       ` Linus Walleij
2010-04-13  0:26         ` Linus Walleij
2010-04-13  0:26         ` Linus Walleij
2010-03-31 13:19 Jean-Marie Lemetayer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.