summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2010-10-07 20:03:19 +1100
committerGraeme Russ <graeme.russ@gmail.com>2010-10-07 20:03:19 +1100
commitabe98f49e191ce0183132bed548643db7e2b80c5 (patch)
treefd574234ddbde33db5dfe925b894044622ddde5b /arch
parentde25059404b630012eef050532a3f73f47c567c5 (diff)
downloadu-boot-imx-abe98f49e191ce0183132bed548643db7e2b80c5.zip
u-boot-imx-abe98f49e191ce0183132bed548643db7e2b80c5.tar.gz
u-boot-imx-abe98f49e191ce0183132bed548643db7e2b80c5.tar.bz2
x86: zboot update
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
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/lib/zimage.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/i386/lib/zimage.c b/arch/i386/lib/zimage.c
index 89fe015..0c42072 100644
--- a/arch/i386/lib/zimage.c
+++ b/arch/i386/lib/zimage.c
@@ -248,7 +248,8 @@ void boot_zimage(void *setup_base)
int do_zboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
void *base_ptr;
- void *bzImage_addr;
+ void *bzImage_addr = NULL;
+ char *s;
ulong bzImage_size = 0;
disable_interrupts();
@@ -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 */
+ s = argv[1];
+ else
+ s = getenv("fileaddr");
+
+ if (s)
+ bzImage_addr = (void *)simple_strtoul(s, NULL, 16);
- if (argc == 3)
+ if (argc >= 3)
+ /* argv[2] holds the size of the bzImage */
bzImage_size = simple_strtoul(argv[2], NULL, 16);
/* Lets look for*/
@@ -282,7 +290,7 @@ int do_zboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
U_BOOT_CMD(
- zboot, 3, 0, do_zboot,
+ zboot, 2, 0, do_zboot,
"Boot bzImage",
""
);