Re: [U-Boot] split nand writes

2012-12-20 Thread Jaap de Jong


On 12/19/2012 11:47 PM, Scott Wood wrote:

On 12/19/2012 09:43:01 AM, Jaap de Jong wrote:

Hi All,
suppose the image I want to flash is bigger than the available ram in
the unit.
Is there a way to copy the image f.i. in pieces into the flash?
nand write should have a 'continue on last block' option for that
purpose.

Something like that would be nice.

These patches are relevant:
http://patchwork.ozlabs.org/patch/204939/
http://patchwork.ozlabs.org/patch/204940/

That could do the trick also. You would have to do some arithmetic to 
calculate the next startaddress in the flash.

So there is not an out-of-the-box solution at the moment?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] split nand writes

2012-12-19 Thread Jaap de Jong

Hi All,
suppose the image I want to flash is bigger than the available ram in 
the unit.

Is there a way to copy the image f.i. in pieces into the flash?
nand write should have a 'continue on last block' option for that purpose.
Thanks!
Jaap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND: add more watchdog resets

2011-02-03 Thread Jaap de Jong
My testresults:

unpatched ~~~

 nand read 0x2000 0x0010 0x0300
 no problem

 nand write 0x2000 0x0010 0x00c0
 no problem

 nand write 0x2000 0x0010 0x00d0
 the watchdog will reset the processor

patched 

 nand read 0x2000 0x0010 0x0300
 no problem

 nand write 0x2000 0x0010 0x07f0
 no problem

~~

So, reading was never a problem, only writing.
And that is fixed now!
Thanks!


On 02/03/2011 01:23 AM, Scott Wood wrote:
> Poke the watchdog in a variety of looping constructs, which could take
> a long time to complete.
>
> Signed-off-by: Scott Wood
> ---
> Jaap, does this resolve the watchdog problems you were seeing?
>
>   drivers/mtd/nand/nand_base.c |6 ++
>   drivers/mtd/nand/nand_util.c |2 ++
>   2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 70c0593..b9bd394 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -1156,6 +1156,8 @@ static int nand_do_read_ops(struct mtd_info *mtd, 
> loff_t from,
>   oob = ops->oobbuf;
>
>   while(1) {
> + WATCHDOG_RESET();
> +
>   bytes = min(mtd->writesize - col, readlen);
>   aligned = (bytes == mtd->writesize);
>
> @@ -1485,6 +1487,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, 
> loff_t from,
>   page = realpage&  chip->pagemask;
>
>   while(1) {
> + WATCHDOG_RESET();
>   sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
>
>   len = min(len, readlen);
> @@ -1884,6 +1887,8 @@ static int nand_do_write_ops(struct mtd_info *mtd, 
> loff_t to,
>   memset(chip->oob_poi, 0xff, mtd->oobsize);
>
>   while(1) {
> + WATCHDOG_RESET();
> +
>   int bytes = mtd->writesize;
>   int cached = writelen>  bytes&&  page != blockmask;
>   uint8_t *wbuf = buf;
> @@ -2215,6 +2220,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct 
> erase_info *instr,
>   instr->state = MTD_ERASING;
>
>   while (len) {
> + WATCHDOG_RESET();
>   /*
>* heck if we have a bad block, we do not erase bad blocks !
>*/
> diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
> index 8b4f738..5a6f7ae 100644
> --- a/drivers/mtd/nand/nand_util.c
> +++ b/drivers/mtd/nand/nand_util.c
> @@ -542,6 +542,8 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, 
> size_t *length,
>
>   pages = write_size / pagesize_oob;
>   for (page = 0; page<  pages; page++) {
> + WATCHDOG_RESET();
> +
>   ops.datbuf = p_buffer;
>   ops.oobbuf = ops.datbuf + pagesize;
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] nand commands missing wtchdog reset

2011-02-01 Thread Jaap de Jong
thanks for your reply.
You are right, the format was totally wrong; I apologize!
Concerning the patch itself: I agree: low-level hangups should trigger 
the watchdog although in this specific case the hangups will not occur 
due to a timeout construction surrounding it.
Unfortunately I'm not able to investigate this any further
To get this fix done: hopefully some u-boot-guru will do the dirty work...

Jaap

On 01/31/2011 08:25 PM, Scott Wood wrote:
> On Mon, 31 Jan 2011 13:16:59 -0600
> Scott Wood  wrote:
>
>> On Mon, 31 Jan 2011 09:05:55 +0100
>> Jaap de Jong  wrote:
>>
>>> Hi all,
>>> On my board (at91sam9263ek) I have enabled the watchdog.
>>> It will reset the processor after about 16 seconds.
>>> It looks like it is working but if I'm writing a large file into nand it
>>> seems that the watchdog is not reset and finally my processor resets.
>>> I've patched it, but I'm not sure if it is the right way to do it this
>>> way...
>> So far we've been putting the watchdog resets in higher-level
>> functions.  It looks like the block-skipping versions have them, but
>> the non-block-skipping versions don't (and the former will call the
>> latter if it doesn't see any bad blocks).
>>
>> So I think this should go in nand_read() and nand_write().  If things
>> hang up inside the low-level wait that should trigger the watchdog.
> Oh, and all patches require a sign-off, and the text above the patch
> should be what is intended to go in the git changelog, with any
> additional comments/greetings/etc below a "---" line.
>
> See http://www.denx.de/wiki/U-Boot/Patches
> and also the Developer's Certificate of Origin in
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/SubmittingPatches;h=689e2371095cc5dfea9927120009341f369159aa;hb=HEAD
>
> -Scott
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] nand commands missing wtchdog reset

2011-01-31 Thread Jaap de Jong
Hi all,
On my board (at91sam9263ek) I have enabled the watchdog.
It will reset the processor after about 16 seconds.
It looks like it is working but if I'm writing a large file into nand it 
seems that the watchdog is not reset and finally my processor resets.
I've patched it, but I'm not sure if it is the right way to do it this 
way...

diff -urN a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
--- a/drivers/mtd/nand/nand_base.c2010-12-22 20:22:14.0 +0100
+++ b/drivers/mtd/nand/nand_base.c2011-01-31 08:45:07.818135600 +0100
@@ -447,6 +447,7 @@
  if (chip->dev_ready)
  if (chip->dev_ready(mtd))
  break;
+WATCHDOG_RESET ();
  }
  }

@@ -730,6 +731,7 @@
  if (this->read_byte(mtd) & NAND_STATUS_READY)
  break;
  }
+WATCHDOG_RESET ();
  }
  #ifdef PPCHAMELON_NAND_TIMER_HACK
  reset_timer();

Regards,
Jaap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot