]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_bootm.c
YAFFS2: cmd_yaffs2.c - fix build warnings
[karo-tx-uboot.git] / common / cmd_bootm.c
index 1a024f168f7d1bea73fd7b0c26f81480ec602f4a..8909ee703d32db806ba677196788af623cde2bf4 100644 (file)
@@ -93,7 +93,6 @@ static int fit_check_kernel (const void *fit, int os_noffset, int verify);
 
 static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char * const argv[],
                bootm_headers_t *images, ulong *os_data, ulong *os_len);
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 /*
  *  Continue booting an OS image; caller already has:
@@ -157,7 +156,6 @@ static boot_os_fn *boot_os[] = {
 #endif
 };
 
-ulong load_addr = CONFIG_SYS_LOAD_ADDR;        /* Default Load Address */
 static bootm_headers_t images;         /* pointers to os/initrd/fdt images */
 
 /* Allow for arch specific config before we boot */
@@ -346,7 +344,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
 
        switch (comp) {
        case IH_COMP_NONE:
-               if (load == blob_start) {
+               if (load == blob_start || load == image_start) {
                        printf ("   XIP %s ... ", type_name);
                } else {
                        printf ("   Loading %s ... ", type_name);
@@ -434,6 +432,9 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
                printf ("Unimplemented compression type %d\n", comp);
                return BOOTM_ERR_UNIMPLEMENTED;
        }
+
+       flush_cache(load, (*load_end - load) * sizeof(ulong));
+
        puts ("OK\n");
        debug ("   kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
        if (boot_progress)
@@ -546,11 +547,12 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
                }
                        break;
 #endif
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_SYS_BOOTMAPSZ)
+#if defined(CONFIG_OF_LIBFDT)
                case BOOTM_STATE_FDT:
                {
-                       ulong bootmap_base = getenv_bootm_low();
-                       ret = boot_relocate_fdt(&images.lmb, bootmap_base,
+                       boot_fdt_add_mem_rsv_regions(&images.lmb,
+                                                    images.ft_addr);
+                       ret = boot_relocate_fdt(&images.lmb,
                                &images.ft_addr, &images.ft_len);
                        break;
                }
@@ -709,6 +711,21 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        return 1;
 }
 
+int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd)
+{
+       const char *ep = getenv("autostart");
+
+       if (ep && !strcmp(ep, "yes")) {
+               char *local_args[2];
+               local_args[0] = (char *)cmd;
+               local_args[1] = NULL;
+               printf("Automatic boot of image at addr 0x%08lX ...\n", load_addr);
+               return do_bootm(cmdtp, 0, 1, local_args);
+       }
+
+       return 0;
+}
+
 /**
  * image_get_kernel - verify legacy format kernel image
  * @img_addr: in RAM address of the legacy format image to be verified