Merge branch 'master' of git://git.denx.de/u-boot-socfpga
[oweals/u-boot.git] / common / bootm.c
index a4618b6d2e176cd4dc46a828299c697af79bfc1f..d19375164784b8ab74358dded3d3374c8b5d8fd7 100644 (file)
@@ -59,8 +59,8 @@ static void boot_start_lmb(bootm_headers_t *images)
        mem_start = env_get_bootm_low();
        mem_size = env_get_bootm_size();
 
-       lmb_init_and_reserve(&images->lmb, (phys_addr_t)mem_start, mem_size,
-                            NULL);
+       lmb_init_and_reserve_range(&images->lmb, (phys_addr_t)mem_start,
+                                  mem_size, NULL);
 }
 #else
 #define lmb_reserve(lmb, base, size)
@@ -154,7 +154,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc,
 #ifdef CONFIG_ANDROID_BOOT_IMAGE
        case IMAGE_FORMAT_ANDROID:
                images.os.type = IH_TYPE_KERNEL;
-               images.os.comp = IH_COMP_NONE;
+               images.os.comp = android_image_get_kcomp(os_hdr);
                images.os.os = IH_OS_LINUX;
 
                images.os.end = android_image_get_end(os_hdr);
@@ -450,7 +450,6 @@ static int bootm_load_os(bootm_headers_t *images, int boot_progress)
        ulong image_start = os.image_start;
        ulong image_len = os.image_len;
        ulong flush_start = ALIGN_DOWN(load, ARCH_DMA_MINALIGN);
-       ulong flush_len;
        bool no_overlap;
        void *load_buf, *image_buf;
        int err;
@@ -465,11 +464,7 @@ static int bootm_load_os(bootm_headers_t *images, int boot_progress)
                return err;
        }
 
-       flush_len = load_end - load;
-       if (flush_start < load)
-               flush_len += load - flush_start;
-
-       flush_cache(flush_start, ALIGN(flush_len, ARCH_DMA_MINALIGN));
+       flush_cache(flush_start, ALIGN(load_end, ARCH_DMA_MINALIGN) - flush_start);
 
        debug("   kernel loaded at 0x%08lx, end = 0x%08lx\n", load, load_end);
        bootstage_mark(BOOTSTAGE_ID_KERNEL_LOADED);
@@ -912,6 +907,16 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
 
        return buf;
 }
+
+/**
+ * switch_to_non_secure_mode() - switch to non-secure mode
+ *
+ * This routine is overridden by architectures requiring this feature.
+ */
+void __weak switch_to_non_secure_mode(void)
+{
+}
+
 #else /* USE_HOSTCC */
 
 void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
@@ -919,6 +924,7 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
        memmove(to, from, len);
 }
 
+#if defined(CONFIG_FIT_SIGNATURE)
 static int bootm_host_load_image(const void *fit, int req_image_type)
 {
        const char *fit_uname_config = NULL;
@@ -983,5 +989,6 @@ int bootm_host_load_images(const void *fit, int cfg_noffset)
        /* Return the first error we found */
        return err;
 }
+#endif
 
 #endif /* ndef USE_HOSTCC */