From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Mon, 04 Oct 2010 13:54:27 +0400 Subject: [U-Boot] [PATCH 03/19] x86: zboot update In-Reply-To: <1286163483-21697-4-git-send-email-graeme.russ@gmail.com> References: <1286163483-21697-1-git-send-email-graeme.russ@gmail.com> <1286163483-21697-4-git-send-email-graeme.russ@gmail.com> Message-ID: <4CA9A453.3080609@mvista.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello. On 04-10-2010 7:37, Graeme Russ wrote: > The header of recent Linux Kernels includes the size of the image, and > therefore is not needed to be passed to zboot. Still process the third > parameter (size of image) in the event that an older kernel is being loaded > Signed-off-by: Graeme Russ [...] > diff --git a/arch/i386/lib/zimage.c b/arch/i386/lib/zimage.c > index 89fe015..f279b43 100644 > --- a/arch/i386/lib/zimage.c > +++ b/arch/i386/lib/zimage.c [...] > @@ -256,10 +257,17 @@ int do_zboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) > /* Setup board for maximum PC/AT Compatibility */ > setup_pcat_compatibility(); > > - /* argv[1] holds the address of the bzImage */ > - bzImage_addr = (void *)simple_strtoul(argv[1], NULL, 16); > + if (argc>= 2) { > + /* argv[1] holds the address of the bzImage */ > + bzImage_addr = (void *)simple_strtoul(argv[1], NULL, 16); > + } else { > + s = getenv("fileaddr"); > + if (s) > + bzImage_addr = (void *)simple_strtoul(s, NULL, 16); > + } Why not: + if (argc >= 2) + /* argv[1] holds the address of the bzImage */ + s = argv[1]; + else + s = getenv("fileaddr"); + + if (s) + bzImage_addr = (void *)simple_strtoul(s, NULL, 16); WBR, Sergei