From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Tue, 3 Jul 2007 14:27:34 +0200 Subject: [U-Boot-Users] [PATCH] Bad block skipping for command nboot In-Reply-To: <4688DAAD.6020501@siemens.com> References: <4688DAAD.6020501@siemens.com> Message-ID: <200707031427.34164.sr@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 Hi Thomas, On Monday 02 July 2007, Thomas Knobloch wrote: > The old implementation of command nboot does not support reading the image > from NAND flash with skipping of bad blocks. The patch implements a new > version of the nboot command: by calling nboot.jffs2 from the u-boot > command line the command will load the image from NAND flash with respect > to bad blocks (by using nand_read_opts()). This is similar to e.g. the NAND > read command: "nand read.jffs2 ...". And that's why I have to ask: Do we really need this command extension? Why not just use a combination of commands (e.g. "nand read.jffs2 ...;bootm ...)? Nevertheless one short remark in the patch below: > Signed-off-by: Thomas Knobloch > > --- a/common/cmd_nand.c 2007-02-02 10:02:06.000000000 +0100 > +++ b/common/cmd_nand.c 2007-07-02 10:59:26.000000000 +0200 > @@ -476,14 +476,33 @@ > ulong offset, ulong addr, char *cmd) > { > int r; > - char *ep; > + char *ep, *s; > ulong cnt; > image_header_t *hdr; > + int jffs2 = 0; > + > + s = strchr(cmd, '.'); > + if (s != NULL && > + (!strcmp(s, ".jffs2") || !strcmp(s, ".e") || !strcmp(s, ".i"))) > + { > + jffs2 = 1; > + } No parentheses for one lined statements please. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================