]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/image.c
Merge branch 'rmobile-mx' of git://git.denx.de/u-boot-sh
[people/ms/u-boot.git] / common / image.c
index a058eb85e107bce98c7a155344250cc30f16ef18..4bcf6b3128a852ee24a4a83f8d4ee91bd70699ac 100644 (file)
 #include <status_led.h>
 #endif
 
-#ifdef CONFIG_HAS_DATAFLASH
-#include <dataflash.h>
-#endif
-
-#ifdef CONFIG_LOGBUFFER
-#include <logbuff.h>
-#endif
-
 #include <rtc.h>
 
 #include <environment.h>
@@ -99,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",               },
@@ -167,6 +160,7 @@ static const table_entry_t uimage_type[] = {
        {       IH_TYPE_FPGA,       "fpga",       "FPGA Image" },
        {       IH_TYPE_TEE,        "tee",        "Trusted Execution Environment Image",},
        {       IH_TYPE_FIRMWARE_IVT, "firmware_ivt", "Firmware with HABv4 IVT" },
+       {       IH_TYPE_PMMC,        "pmmc",        "TI Power Management Micro-Controller Firmware",},
        {       -1,                 "",           "",                   },
 };
 
@@ -388,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
@@ -888,81 +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;
-
-#ifdef CONFIG_HAS_DATAFLASH
-       ulong h_size, d_size;
-
-       if (addr_dataflash(img_addr)) {
-               void *buf;
-
-               /* ger RAM address */
-               ram_addr = CONFIG_SYS_LOAD_ADDR;
-
-               /* get header size */
-               h_size = image_get_header_size();
-#if IMAGE_ENABLE_FIT
-               if (sizeof(struct fdt_header) > h_size)
-                       h_size = sizeof(struct fdt_header);
-#endif
-
-               /* read in header */
-               debug("   Reading image header from dataflash address "
-                       "%08lx to RAM address %08lx\n", img_addr, ram_addr);
-
-               buf = map_sysmem(ram_addr, 0);
-               read_dataflash(img_addr, h_size, buf);
-
-               /* get data size */
-               switch (genimg_get_format(buf)) {
-#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
-               case IMAGE_FORMAT_LEGACY:
-                       d_size = image_get_data_size(buf);
-                       debug("   Legacy format image found at 0x%08lx, "
-                                       "size 0x%08lx\n",
-                                       ram_addr, d_size);
-                       break;
-#endif
-#if IMAGE_ENABLE_FIT
-               case IMAGE_FORMAT_FIT:
-                       d_size = fit_get_size(buf) - h_size;
-                       debug("   FIT/FDT format image found at 0x%08lx, "
-                                       "size 0x%08lx\n",
-                                       ram_addr, d_size);
-                       break;
-#endif
-               default:
-                       printf("   No valid image found at 0x%08lx\n",
-                               img_addr);
-                       return ram_addr;
-               }
-
-               /* read in image data */
-               debug("   Reading image remaining data from dataflash address "
-                       "%08lx to RAM address %08lx\n", img_addr + h_size,
-                       ram_addr + h_size);
-
-               read_dataflash(img_addr + h_size, d_size,
-                               (char *)(buf + h_size));
-
-       }
-#endif /* CONFIG_HAS_DATAFLASH */
-
-       return ram_addr;
-}
-
 /**
  * fit_has_config - check if there is a valid FIT configuration
  * @images: pointer to the bootm command headers structure
@@ -1095,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
@@ -1237,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);
 
@@ -1329,10 +1237,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
@@ -1441,10 +1347,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