diff options
author | Gabe Black <gabeblack@chromium.org> | 2011-12-05 12:09:27 +0000 |
---|---|---|
committer | Graeme Russ <graeme.russ@gmail.com> | 2011-12-19 13:26:17 +1100 |
commit | 6f9d9986d54cb53e50b33a044a9c89572736d96a (patch) | |
tree | e72614527f18accfaacca84be27275fd30f6b32c /arch/x86 | |
parent | 69370d144a9e8133461f1662131fbf97ad121165 (diff) | |
download | u-boot-imx-6f9d9986d54cb53e50b33a044a9c89572736d96a.zip u-boot-imx-6f9d9986d54cb53e50b33a044a9c89572736d96a.tar.gz u-boot-imx-6f9d9986d54cb53e50b33a044a9c89572736d96a.tar.bz2 |
x86: Add support for specifying an initrd with the zboot command
This change finishes plumbing the initrd support built into the zboot
mechanism out to the command interface.
It also fixes a bug in the command declaration where the kernel size could
be passed as an optional second parameter but not enough arguments were
allowed.
Signed-off-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/lib/zimage.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 0cbb571..bb40517 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -321,6 +321,8 @@ int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) void *load_address; char *s; ulong bzImage_size = 0; + ulong initrd_addr = 0; + ulong initrd_size = 0; disable_interrupts(); @@ -337,9 +339,15 @@ int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) 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); + } + + if (argc >= 4) + initrd_addr = simple_strtoul(argv[3], NULL, 16); + if (argc >= 5) + initrd_size = simple_strtoul(argv[4], NULL, 16); /* Lets look for */ base_ptr = load_zimage(bzImage_addr, bzImage_size, &load_address); @@ -349,7 +357,7 @@ int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) return -1; } if (setup_zimage(base_ptr, (char *)base_ptr + COMMAND_LINE_OFFSET, - 0, 0, 0)) { + 0, initrd_addr, initrd_size)) { printf("Setting up boot parameters failed ...\n"); return -1; } @@ -366,7 +374,14 @@ int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) } U_BOOT_CMD( - zboot, 2, 0, do_zboot, + zboot, 5, 0, do_zboot, "Boot bzImage", - "" + "[addr] [size] [initrd addr] [initrd size]\n" + " addr - The optional starting address of the bzimage.\n" + " If not set it defaults to the environment\n" + " variable \"fileaddr\".\n" + " size - The optional size of the bzimage. Defaults to\n" + " zero.\n" + " initrd addr - The address of the initrd image to use, if any.\n" + " initrd size - The size of the initrd image to use, if any.\n" ); |