]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_bootm.c
post: remove redundant include of autoconf.mk which is already included from $(TOPDIR...
[karo-tx-uboot.git] / common / cmd_bootm.c
index 306c8f395ad897fb1a06b387fe95b6d0dd204873..046e22ff48f57efd4e9957d311b64377c2e048dd 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 
@@ -396,7 +380,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:
@@ -543,10 +526,6 @@ static int boot_selected_os(int argc, char * const argv[], int state,
                bootm_start_standalone(argc, argv);
                return 0;
        }
-#ifdef CONFIG_SILENT_CONSOLE
-       if (images->os.os == IH_OS_LINUX)
-               fixup_silent_linux();
-#endif
        arch_preboot_os();
        boot_fn(state, argc, argv, images);
        if (state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */
@@ -657,6 +636,10 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,
                        goto err;
                else if (ret == BOOTM_ERR_OVERLAP)
                        ret = 0;
+#ifdef CONFIG_SILENT_CONSOLE
+               if (images->os.os == IH_OS_LINUX)
+                       fixup_silent_linux();
+#endif
        }
 
        /* Relocate the ramdisk */
@@ -704,13 +687,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)) {
@@ -722,15 +698,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:
@@ -989,7 +967,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);
@@ -998,6 +976,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
@@ -1473,6 +1452,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;
 
@@ -1552,6 +1533,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;
 
@@ -1574,6 +1557,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;
 
@@ -1607,6 +1592,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;
 
@@ -1641,6 +1628,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;
 
@@ -1688,6 +1677,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;
 
@@ -1711,6 +1702,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;
 
@@ -1736,6 +1729,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;