]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/bootm.c
mtd: nand: Remove docg4 driver and palmtreo680 flashing tool
[people/ms/u-boot.git] / common / bootm.c
index c0d0d09411f0df2886db4fcec75a11ffae6ca23a..49414142dcd207902b96a7e93a64923c121e71ba 100644 (file)
@@ -108,7 +108,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc,
                images.os.arch = image_get_arch(os_hdr);
                break;
 #endif
-#if defined(CONFIG_FIT)
+#if IMAGE_ENABLE_FIT
        case IMAGE_FORMAT_FIT:
                if (fit_image_get_type(images.fit_hdr_os,
                                       images.fit_noffset_os,
@@ -180,7 +180,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc,
                /* Kernel entry point is the setup.bin */
        } else if (images.legacy_hdr_valid) {
                images.ep = image_get_ep(&images.legacy_hdr_os_copy);
-#if defined(CONFIG_FIT)
+#if IMAGE_ENABLE_FIT
        } else if (images.fit_uname_os) {
                int ret;
 
@@ -201,7 +201,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc,
                images.ep += images.os.load;
        }
 
-       images.os.start = (ulong)os_hdr;
+       images.os.start = map_to_sysmem(os_hdr);
 
        return 0;
 }
@@ -234,7 +234,7 @@ int bootm_find_images(int flag, int argc, char * const argv[])
                return 1;
        }
 
-#if defined(CONFIG_OF_LIBFDT)
+#if IMAGE_ENABLE_OF_LIBFDT
        /* find flattened device tree */
        ret = boot_get_fdt(flag, argc, argv, IH_ARCH_DEFAULT, &images,
                           &images.ft_addr, &images.ft_len);
@@ -245,7 +245,17 @@ int bootm_find_images(int flag, int argc, char * const argv[])
        set_working_fdt_addr((ulong)images.ft_addr);
 #endif
 
-#if defined(CONFIG_FIT)
+#if IMAGE_ENABLE_FIT
+#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_XILINX)
+       /* find bitstreams */
+       ret = boot_get_fpga(argc, argv, &images, IH_ARCH_DEFAULT,
+                           NULL, NULL);
+       if (ret) {
+               printf("FPGA image is corrupted or invalid\n");
+               return 1;
+       }
+#endif
+
        /* find all of the loadables */
        ret = boot_get_loadable(argc, argv, &images, IH_ARCH_DEFAULT,
                               NULL, NULL);
@@ -389,6 +399,15 @@ int bootm_decomp_image(int comp, ulong load, ulong image_start, int type,
                break;
        }
 #endif /* CONFIG_LZO */
+#ifdef CONFIG_LZ4
+       case IH_COMP_LZ4: {
+               size_t size = unc_len;
+
+               ret = ulz4fn(image_buf, image_len, load_buf, &size);
+               image_len = size;
+               break;
+       }
+#endif /* CONFIG_LZ4 */
        default:
                printf("Unimplemented compression type %d\n", comp);
                return BOOTM_ERR_UNIMPLEMENTED;
@@ -426,7 +445,7 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
                bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
                return err;
        }
-       flush_cache(load, (*load_end - load) * sizeof(ulong));
+       flush_cache(load, *load_end - load);
 
        debug("   kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
        bootstage_mark(BOOTSTAGE_ID_KERNEL_LOADED);
@@ -635,7 +654,7 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                }
        }
 #endif
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_LMB)
+#if IMAGE_ENABLE_OF_LIBFDT && defined(CONFIG_LMB)
        if (!ret && (states & BOOTM_STATE_FDT)) {
                boot_fdt_add_mem_rsv_regions(&images->lmb, images->ft_addr);
                ret = boot_relocate_fdt(&images->lmb, &images->ft_addr,
@@ -779,7 +798,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
        const void *buf;
        const char      *fit_uname_config = NULL;
        const char      *fit_uname_kernel = NULL;
-#if defined(CONFIG_FIT)
+#if IMAGE_ENABLE_FIT
        int             os_noffset;
 #endif
 
@@ -840,7 +859,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
                bootstage_mark(BOOTSTAGE_ID_DECOMP_IMAGE);
                break;
 #endif
-#if defined(CONFIG_FIT)
+#if IMAGE_ENABLE_FIT
        case IMAGE_FORMAT_FIT:
                os_noffset = fit_image_load(images, img_addr,
                                &fit_uname_kernel, &fit_uname_config,