]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_bootm.c
sandbox: config: enable fdt and snprintf() options
[u-boot] / common / cmd_bootm.c
index b073f095ba00610f978d0b4d22b6e69ee24861ae..93045841f9e73fed2a5c04b5ceba5e52ce70d697 100644 (file)
@@ -272,7 +272,13 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
                return 1;
        }
 
+       if (images.os.type == IH_TYPE_KERNEL_NOLOAD) {
+               images.os.load = images.os.image_start;
+               images.ep += images.os.load;
+       }
+
        if (((images.os.type == IH_TYPE_KERNEL) ||
+            (images.os.type == IH_TYPE_KERNEL_NOLOAD) ||
             (images.os.type == IH_TYPE_MULTI)) &&
            (images.os.os == IH_OS_LINUX)) {
                /* find ramdisk */
@@ -314,6 +320,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
        ulong image_start = os.image_start;
        ulong image_len = os.image_len;
        __maybe_unused uint unc_len = CONFIG_SYS_BOOTM_LEN;
+       int no_overlap = 0;
 #if defined(CONFIG_LZMA) || defined(CONFIG_LZO)
        int ret;
 #endif /* defined(CONFIG_LZMA) || defined(CONFIG_LZO) */
@@ -324,6 +331,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
        case IH_COMP_NONE:
                if (load == blob_start || load == image_start) {
                        printf("   XIP %s ... ", type_name);
+                       no_overlap = 1;
                } else {
                        printf("   Loading %s ... ", type_name);
                        memmove_wd((void *)load, (void *)image_start,
@@ -418,7 +426,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
        if (boot_progress)
                show_boot_progress(7);
 
-       if ((load < blob_end) && (*load_end > blob_start)) {
+       if (!no_overlap && (load < blob_end) && (*load_end > blob_start)) {
                debug("images.os.start = 0x%lX, images.os.end = 0x%lx\n",
                        blob_start, blob_end);
                debug("images.os.load = 0x%lx, load_end = 0x%lx\n", load,
@@ -485,12 +493,12 @@ int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
                }
        } else {
                /* Unrecognized command */
-               return cmd_usage(cmdtp);
+               return CMD_RET_USAGE;
        }
 
        if (images.state >= state) {
                printf("Trying to execute a command out of order\n");
-               return cmd_usage(cmdtp);
+               return CMD_RET_USAGE;
        }
 
        images.state |= state;
@@ -796,7 +804,8 @@ static int fit_check_kernel(const void *fit, int os_noffset, int verify)
        }
 
        show_boot_progress(106);
-       if (!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL)) {
+       if (!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL) &&
+           !fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL_NOLOAD)) {
                puts("Not a kernel image\n");
                show_boot_progress(-106);
                return 0;
@@ -874,6 +883,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
                /* get os_data and os_len */
                switch (image_get_type(hdr)) {
                case IH_TYPE_KERNEL:
+               case IH_TYPE_KERNEL_NOLOAD:
                        *os_data = image_get_data(hdr);
                        *os_len = image_get_data_size(hdr);
                        break;
@@ -1035,14 +1045,8 @@ int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int rcode = 0;
 
-#ifndef CONFIG_SYS_HUSH_PARSER
        if (run_command(getenv("bootcmd"), flag) < 0)
                rcode = 1;
-#else
-       if (parse_string_outer(getenv("bootcmd"),
-                       FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0)
-               rcode = 1;
-#endif
        return rcode;
 }