From: Wolfgang Denk Date: Tue, 17 Feb 2009 21:22:01 +0100 Subject: [U-Boot] [PATCH] Pad data length for nand write In-Reply-To: <499B03FD.7050207@siconix.com> References: <> <1234890907-934-1-git-send-email-dou@siconix.com> <200902171255.53149.vapier@gentoo.org> <499B03FD.7050207@siconix.com> Message-ID: <20090217202201.12E23832E893@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Derek Ou, In message <499B03FD.7050207@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.