summaryrefslogtreecommitdiffstats
path: root/common/image-fdt.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-06-11 11:14:46 -0700
committerTom Rini <trini@ti.com>2013-06-26 10:16:41 -0400
commit983c72f479173bced296f7292b4a9fbef9d17688 (patch)
treea484e1ec6bc6d48ce0957c87df79357f319e618d /common/image-fdt.c
parent37544a6dabdaf474726ed8374c58598f61e3fd71 (diff)
downloadblackbird-obmc-uboot-983c72f479173bced296f7292b4a9fbef9d17688.tar.gz
blackbird-obmc-uboot-983c72f479173bced296f7292b4a9fbef9d17688.zip
Clarify bootm OS arguments
At present the arguments to bootm are processed in a somewhat confusing way. Sub-functions must know how many arguments their calling functions have processed, and the OS boot function must also have this information. Also it isn't obvious that 'bootm' and 'bootm start' provide arguments in the same way. Adjust the code so that arguments are removed from the list before calling a sub-function. This means that all functions can know that argv[0] is the first argument of which they need to take notice. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/image-fdt.c')
-rw-r--r--common/image-fdt.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 0d421d92fb..d99f444de1 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -248,13 +248,16 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
ulong default_addr;
int fdt_noffset;
#endif
+ const char *select = NULL;
*of_flat_tree = NULL;
*of_size = 0;
- if (argc > 3 || genimg_has_config(images)) {
+ if (argc > 2)
+ select = argv[2];
+ if (select || genimg_has_config(images)) {
#if defined(CONFIG_FIT)
- if (argc > 3) {
+ if (select) {
/*
* If the FDT blob comes from the FIT image and the
* FIT image address is omitted in the command line
@@ -268,18 +271,18 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
else
default_addr = load_addr;
- if (fit_parse_conf(argv[3], default_addr,
+ if (fit_parse_conf(select, default_addr,
&fdt_addr, &fit_uname_config)) {
debug("* fdt: config '%s' from image at 0x%08lx\n",
fit_uname_config, fdt_addr);
- } else if (fit_parse_subimage(argv[3], default_addr,
+ } else if (fit_parse_subimage(select, default_addr,
&fdt_addr, &fit_uname_fdt)) {
debug("* fdt: subimage '%s' from image at 0x%08lx\n",
fit_uname_fdt, fdt_addr);
} else
#endif
{
- fdt_addr = simple_strtoul(argv[3], NULL, 16);
+ fdt_addr = simple_strtoul(select, NULL, 16);
debug("* fdt: cmdline image address = 0x%08lx\n",
fdt_addr);
}
OpenPOWER on IntegriCloud