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

Wolfgang Denk wd at denx.de
Tue Feb 17 21:22:01 CET 2009


Dear Derek Ou,

In message <499B03FD.7050207 at siconix.com> you wrote:
>
> Until v1.3.4, "nand write.jffs2" supports non page-aligned data write and
> pad data automatically to page alignment.  As a result, we can use the
> following scripts to automate downloading a file and writing it to flash.
> "tftp file.bin" and "nand write.jffs2 add_# off_# $(filesize)"
> But in the later releases, this feature was no longer supported.  So my
> patch restores this feature to nand write command.

Such implicit padding is IMHO a bad idea.

I think we should rather add logic similar to what we use on NOR flash
and support a "+length" syntax which indicates "please round up to the
next block boundary".

You would then write

	nand write.jffs2 addr off +${filesize}

to get the wanted behaviour.

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
A rolling stone gathers momentum.


More information about the U-Boot mailing list