diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-10-08 16:29:51 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-10-09 11:35:42 +0200 |
commit | 83cf63d763006ddfc6f3b43acc9ae52ea218ec0c (patch) | |
tree | a97c13bb272ffe3c6ba706eb65ff327c157cafe7 /commands | |
parent | 774f88c79bee296b57d32590c6f905501b475abd (diff) | |
download | barebox-83cf63d763006ddfc6f3b43acc9ae52ea218ec0c.tar.gz barebox-83cf63d763006ddfc6f3b43acc9ae52ea218ec0c.tar.xz |
bootm: add -L option to specify the initrd load address
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/bootm.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/commands/bootm.c b/commands/bootm.c index afb9e067bb..f11138afba 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -191,7 +191,18 @@ static struct image_handle *get_fake_image_handle(struct image_data *data, int n static int initrd_handler_parse_options(struct image_data *data, int opt, char *optarg) { + uint32_t initrd_start; + switch(opt) { + case 'L': + if (!data->initrd) { + eprintf("Warning -L ingnored. Specify the initrd first\n"); + break; + } + initrd_start = simple_strtoul(optarg, NULL, 0); + printf("initrd_start=0x%x\n", initrd_start); + data->initrd->header.ih_load = cpu_to_uimage(initrd_start); + break; case 'r': printf("use initrd %s\n", optarg); /* check for multi image @<num> */ @@ -204,16 +215,19 @@ static int initrd_handler_parse_options(struct image_data *data, int opt, } if (!data->initrd) return -1; - return 0; + break; default: return 1; } + + return 0; } static struct image_handler initrd_handler = { - .cmdline_options = "r:", + .cmdline_options = "r:L:", .cmdline_parse = initrd_handler_parse_options, - .help_string = " -r <initrd> specify an initrd image", + .help_string = " -r <initrd> specify an initrd image\n" + " -L <load addr> specify initrd load address", }; static int initrd_register_image_handler(void) |