public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH 1/2] fsl_elbc_nand: workaround for hangs during nand write
@ 2008-05-22 20:12 Scott Wood
  2008-07-05 22:32 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2008-05-22 20:12 UTC (permalink / raw)
  To: u-boot

From: Anton Vorontsov <avorontsov@ru.mvista.com>

Using current driver elbc sometimes hangs during nand write. Reading back
last byte helps though (thanks to Scott Wood for the idea).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 drivers/mtd/nand/fsl_elbc_nand.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index c1644c0..ab3e0fd 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -489,7 +489,7 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 	struct fsl_elbc_ctrl *ctrl = priv->ctrl;
 	unsigned int bufsize = mtd->writesize + mtd->oobsize;
 
-	if (len < 0) {
+	if (len <= 0) {
 		printf("write_buf of %d bytes", len);
 		ctrl->status = 0;
 		return;
@@ -503,6 +503,15 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 	}
 
 	memcpy_toio(&ctrl->addr[ctrl->index], buf, len);
+	/*
+	 * This is workaround for the weird elbc hangs during nand write,
+	 * Scott Wood says: "...perhaps difference in how long it takes a
+	 * write to make it through the localbus compared to a write to IMMR
+	 * is causing problems, and sync isn't helping for some reason."
+	 * Reading back the last byte helps though.
+	 */
+	in_8(&ctrl->addr[ctrl->index] + len - 1);
+
 	ctrl->index += len;
 }
 
-- 
1.5.3

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

* [U-Boot-Users] [PATCH 1/2] fsl_elbc_nand: workaround for hangs during nand write
  2008-05-22 20:12 [U-Boot-Users] [PATCH 1/2] fsl_elbc_nand: workaround for hangs during nand write Scott Wood
@ 2008-07-05 22:32 ` Wolfgang Denk
  2008-07-07 13:58   ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2008-07-05 22:32 UTC (permalink / raw)
  To: u-boot

In message <20080522201255.GA1731@ld0162-tx32.am.freescale.net> you wrote:
> From: Anton Vorontsov <avorontsov@ru.mvista.com>
> 
> Using current driver elbc sometimes hangs during nand write. Reading back
> last byte helps though (thanks to Scott Wood for the idea).
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
>  drivers/mtd/nand/fsl_elbc_nand.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)

I guess (and I don't like having to guess) that this patch is intended
for the new NAND code, as we don't even have a file "fsl_elbc_nand.c"
in mainline yet?

It would be really helpful if you could be explicit and make clear
what the target of such patches is.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I don't want to be young again, I just don't want to get any older.

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

* [U-Boot-Users] [PATCH 1/2] fsl_elbc_nand: workaround for hangs during nand write
  2008-07-05 22:32 ` Wolfgang Denk
@ 2008-07-07 13:58   ` Scott Wood
  0 siblings, 0 replies; 3+ messages in thread
From: Scott Wood @ 2008-07-07 13:58 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> In message <20080522201255.GA1731@ld0162-tx32.am.freescale.net> you wrote:
>> From: Anton Vorontsov <avorontsov@ru.mvista.com>
>>
>> Using current driver elbc sometimes hangs during nand write. Reading back
>> last byte helps though (thanks to Scott Wood for the idea).
>>
>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>> Signed-off-by: Scott Wood <scottwood@freescale.com>
>> ---
>>  drivers/mtd/nand/fsl_elbc_nand.c |   11 ++++++++++-
>>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> I guess (and I don't like having to guess) that this patch is intended
> for the new NAND code, as we don't even have a file "fsl_elbc_nand.c"
> in mainline yet?

Yes, it's for the NAND testing branch.

> It would be really helpful if you could be explicit and make clear
> what the target of such patches is.

OK, I'll prefix such patches with "NAND testing:" in the future.

-Scott

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

end of thread, other threads:[~2008-07-07 13:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22 20:12 [U-Boot-Users] [PATCH 1/2] fsl_elbc_nand: workaround for hangs during nand write Scott Wood
2008-07-05 22:32 ` Wolfgang Denk
2008-07-07 13:58   ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox