[U-Boot] [PATCH] Pad data length for nand write

Derek Ou derek at siconix.com
Tue Feb 17 22:37:24 CET 2009


Currently, the nand_util.c does not manipulate NAND flash page by page.  
It's the nand_base.c provides that level of NAND control.

Implementing this properly requires changes to the existing structure.  
Also, adding "+length" syntax means command interface change as well.  
Since it's not to the interest of my company to implement new feature 
instead of maintaining existing behavior, I will not look into this in 
my working hours then.  So everybody is welcomed to work on this issue 
and submit your patches.  I'd love to see them.

By the way, I think WATCHDOG_RESET() should be added to 
nand_do_write_opts() and nand_do_read_opts() at nand_base.c.  Please 
include it if you have patch for the above implementation.

Derek
Scott Wood wrote:
> You can define a static array for holding one page, as v1.3.4 did.  
> The space after the caller's buffer is *not* a safe location.
>> Maybe we should implement, like Wolfgang said, a "+length" syntax in 
>> the "nand write"
>> command to indicates "round up to the next page boundary". 
> Sounds good.  If we do that, we should do similarly with "nand erase". 
> It currently (sometimes) warns and rounds up if you give it a 
> non-block-aligned size.
>> In this case, do_nand()
>> can assume that it's safe to write pass memory address (add + length) 
>> and Flash offset
>> (off + length).
> No, it will *not* assume that it's safe to write to any memory of the 
> caller's.  It will allocate its own buffer.
>
> -Scott


More information about the U-Boot mailing list