]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/image.c
Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig
[people/ms/u-boot.git] / common / image.c
index 01f48bf772f3ccb959dcfae4d09f29c24075e760..e9609cd4f7ffad6fb443d42f81e96db27a62f3ac 100644 (file)
 #include <status_led.h>
 #endif
 
-#ifdef CONFIG_LOGBUFFER
-#include <logbuff.h>
-#endif
-
 #include <rtc.h>
 
 #include <environment.h>
@@ -95,6 +91,7 @@ static const table_entry_t uimage_arch[] = {
 
 static const table_entry_t uimage_os[] = {
        {       IH_OS_INVALID,  "invalid",      "Invalid OS",           },
+       {       IH_OS_ARM_TRUSTED_FIRMWARE, "arm-trusted-firmware", "ARM Trusted Firmware"  },
        {       IH_OS_LINUX,    "linux",        "Linux",                },
 #if defined(CONFIG_LYNXKDI) || defined(USE_HOSTCC)
        {       IH_OS_LYNXOS,   "lynxos",       "LynxOS",               },
@@ -385,9 +382,6 @@ void image_print_contents(const void *ptr)
  * flag. Verification done covers data and header integrity and os/type/arch
  * fields checking.
  *
- * If dataflash support is enabled routine checks for dataflash addresses
- * and handles required dataflash reads.
- *
  * returns:
  *     pointer to a ramdisk image header, if image was found and valid
  *     otherwise, return NULL
@@ -885,23 +879,6 @@ int genimg_get_format(const void *img_addr)
        return IMAGE_FORMAT_INVALID;
 }
 
-/**
- * genimg_get_image - get image from special storage (if necessary)
- * @img_addr: image start address
- *
- * genimg_get_image() checks if provided image start address is located
- * in a dataflash storage. If so, image is moved to a system RAM memory.
- *
- * returns:
- *     image start address after possible relocation from special storage
- */
-ulong genimg_get_image(ulong img_addr)
-{
-       ulong ram_addr = img_addr;
-
-       return ram_addr;
-}
-
 /**
  * fit_has_config - check if there is a valid FIT configuration
  * @images: pointer to the bootm command headers structure
@@ -1034,9 +1011,6 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
                }
 #endif
 
-               /* copy from dataflash if needed */
-               rd_addr = genimg_get_image(rd_addr);
-
                /*
                 * Check if there is an initrd image at the
                 * address provided in the second bootm argument
@@ -1176,11 +1150,6 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
        }
 
 
-#ifdef CONFIG_LOGBUFFER
-       /* Prevent initrd from overwriting logbuffer */
-       lmb_reserve(lmb, logbuffer_base() - LOGBUFF_OVERHEAD, LOGBUFF_RESERVE);
-#endif
-
        debug("## initrd_high = 0x%08lx, copy_to_ram = %d\n",
                        initrd_high, initrd_copy_to_ram);
 
@@ -1217,7 +1186,8 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
                         * AMP boot scenarios in which we might not be
                         * HW cache coherent
                         */
-                       flush_cache((unsigned long)*initrd_start, rd_len);
+                       flush_cache((unsigned long)*initrd_start,
+                                   ALIGN(rd_len, ARCH_DMA_MINALIGN));
 #endif
                        puts("OK\n");
                }
@@ -1246,7 +1216,7 @@ int boot_get_setup(bootm_headers_t *images, uint8_t arch,
 }
 
 #if IMAGE_ENABLE_FIT
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_XILINX)
+#if defined(CONFIG_FPGA)
 int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
                  uint8_t arch, const ulong *ld_start, ulong * const ld_len)
 {
@@ -1257,8 +1227,6 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
        const char *uname, *name;
        int err;
        int devnum = 0; /* TODO support multi fpga platforms */
-       const fpga_desc * const desc = fpga_get_desc(devnum);
-       xilinx_desc *desc_xilinx = desc->devdesc;
 
        /* Check to see if the images struct has a FIT configuration */
        if (!genimg_has_config(images)) {
@@ -1268,10 +1236,8 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
 
        /*
         * Obtain the os FIT header from the images struct
-        * copy from dataflash if needed
         */
        tmp_img_addr = map_to_sysmem(images->fit_hdr_os);
-       tmp_img_addr = genimg_get_image(tmp_img_addr);
        buf = map_sysmem(tmp_img_addr, 0);
        /*
         * Check image type. For FIT images get FIT node
@@ -1305,7 +1271,7 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
                        return fit_img_result;
                }
 
-               if (img_len >= desc_xilinx->size) {
+               if (!fpga_is_partial_data(devnum, img_len)) {
                        name = "full";
                        err = fpga_loadbitstream(devnum, (char *)img_data,
                                                 img_len, BIT_FULL);
@@ -1380,10 +1346,8 @@ int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images,
 
        /*
         * Obtain the os FIT header from the images struct
-        * copy from dataflash if needed
         */
        tmp_img_addr = map_to_sysmem(images->fit_hdr_os);
-       tmp_img_addr = genimg_get_image(tmp_img_addr);
        buf = map_sysmem(tmp_img_addr, 0);
        /*
         * Check image type. For FIT images get FIT node