summaryrefslogtreecommitdiff
path: root/common/cmd_bootm.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/cmd_bootm.c')
-rw-r--r--common/cmd_bootm.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index a783cea5d3..c18157cd4c 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -396,7 +396,6 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
memmove_wd(load_buf, image_buf, image_len, CHUNKSZ);
}
*load_end = load + image_len;
- puts("OK\n");
break;
#ifdef CONFIG_GZIP
case IH_COMP_GZIP:
@@ -650,12 +649,11 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,
iflag = bootm_disable_interrupts();
ret = bootm_load_os(images, &load_end, 0);
- if (ret && ret != BOOTM_ERR_OVERLAP)
- goto err;
-
if (ret == 0)
lmb_reserve(&images->lmb, images->os.load,
(load_end - images->os.load));
+ else if (ret && ret != BOOTM_ERR_OVERLAP)
+ goto err;
else if (ret == BOOTM_ERR_OVERLAP)
ret = 0;
}
@@ -705,13 +703,6 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,
if (!ret && (states & BOOTM_STATE_OS_PREP))
ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images);
- /* Check for unsupported subcommand. */
- if (ret) {
- puts("subcommand not supported\n");
- return ret;
- }
-
-
#ifdef CONFIG_TRACE
/* Pretend to run the OS, then run a user command */
if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) {
@@ -723,15 +714,17 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,
ret = run_command_list(cmd_list, -1, flag);
}
#endif
+
+ /* Check for unsupported subcommand. */
+ if (ret) {
+ puts("subcommand not supported\n");
+ return ret;
+ }
+
/* Now run the OS! We hope this doesn't return */
- if (!ret && (states & BOOTM_STATE_OS_GO)) {
+ if (!ret && (states & BOOTM_STATE_OS_GO))
ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_GO,
images, boot_fn);
- if (ret)
- goto err;
- }
-
- return ret;
/* Deal with any fallout */
err:
@@ -990,7 +983,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
case IMAGE_FORMAT_FIT:
os_noffset = fit_image_load(images, FIT_KERNEL_PROP,
img_addr,
- &fit_uname_kernel, fit_uname_config,
+ &fit_uname_kernel, &fit_uname_config,
IH_ARCH_DEFAULT, IH_TYPE_KERNEL,
BOOTSTAGE_ID_FIT_KERNEL_START,
FIT_LOAD_IGNORED, os_data, os_len);
@@ -999,6 +992,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
images->fit_hdr_os = map_sysmem(img_addr, 0);
images->fit_uname_os = fit_uname_kernel;
+ images->fit_uname_cfg = fit_uname_config;
images->fit_noffset_os = os_noffset;
break;
#endif
@@ -1474,6 +1468,8 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[],
char *consdev;
char *cmdline;
+ if (flag & BOOTM_STATE_OS_PREP)
+ return 0;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
@@ -1553,6 +1549,8 @@ static int do_bootm_lynxkdi(int flag, int argc, char * const argv[],
{
image_header_t *hdr = &images->legacy_hdr_os_copy;
+ if (flag & BOOTM_STATE_OS_PREP)
+ return 0;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
@@ -1575,6 +1573,8 @@ static int do_bootm_rtems(int flag, int argc, char * const argv[],
{
void (*entry_point)(bd_t *);
+ if (flag & BOOTM_STATE_OS_PREP)
+ return 0;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
@@ -1608,6 +1608,8 @@ static int do_bootm_ose(int flag, int argc, char * const argv[],
{
void (*entry_point)(void);
+ if (flag & BOOTM_STATE_OS_PREP)
+ return 0;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
@@ -1642,6 +1644,8 @@ static int do_bootm_plan9(int flag, int argc, char * const argv[],
void (*entry_point)(void);
char *s;
+ if (flag & BOOTM_STATE_OS_PREP)
+ return 0;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
@@ -1689,6 +1693,8 @@ static int do_bootm_vxworks(int flag, int argc, char * const argv[],
{
char str[80];
+ if (flag & BOOTM_STATE_OS_PREP)
+ return 0;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
@@ -1712,6 +1718,8 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
char *local_args[2];
char str[16];
+ if (flag & BOOTM_STATE_OS_PREP)
+ return 0;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
@@ -1737,6 +1745,8 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[],
{
void (*entry_point)(void);
+ if (flag & BOOTM_STATE_OS_PREP)
+ return 0;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;