]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/image.c
Merge branch 'master' of /home/wd/git/u-boot/master
[karo-tx-uboot.git] / common / image.c
index 6eaf41eb131feb2624421b590c99441bc3a542bf..ea5973086140930d9f995924aab60dcd3c319447 100644 (file)
@@ -60,7 +60,7 @@ static int fit_check_ramdisk (const void *fit, int os_noffset,
 #endif
 
 #ifdef CONFIG_CMD_BDI
-extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -84,7 +84,6 @@ static table_entry_t uimage_arch[] = {
        {       IH_ARCH_MICROBLAZE,     "microblaze",   "MicroBlaze",   },
        {       IH_ARCH_MIPS,           "mips",         "MIPS",         },
        {       IH_ARCH_MIPS64,         "mips64",       "MIPS 64 Bit",  },
-       {       IH_ARCH_NIOS,           "nios",         "NIOS",         },
        {       IH_ARCH_NIOS2,          "nios2",        "NIOS II",      },
        {       IH_ARCH_PPC,            "powerpc",      "PowerPC",      },
        {       IH_ARCH_PPC,            "ppc",          "PowerPC",      },
@@ -140,6 +139,7 @@ static table_entry_t uimage_type[] = {
        {       IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
        {       IH_TYPE_FLATDT,     "flat_dt",    "Flat Device Tree",   },
        {       IH_TYPE_KWBIMAGE,   "kwbimage",   "Kirkwood Boot Image",},
+       {       IH_TYPE_IMXIMAGE,   "imximage",   "Freescale i.MX Boot Image",},
        {       -1,                 "",           "",                   },
 };
 
@@ -148,6 +148,7 @@ static table_entry_t uimage_comp[] = {
        {       IH_COMP_BZIP2,  "bzip2",        "bzip2 compressed",     },
        {       IH_COMP_GZIP,   "gzip",         "gzip compressed",      },
        {       IH_COMP_LZMA,   "lzma",         "lzma compressed",      },
+       {       IH_COMP_LZO,    "lzo",          "lzo compressed",       },
        {       -1,             "",             "",                     },
 };
 
@@ -432,26 +433,31 @@ ulong getenv_bootm_low(void)
 
 phys_size_t getenv_bootm_size(void)
 {
+       phys_size_t tmp;
        char *s = getenv ("bootm_size");
        if (s) {
-               phys_size_t tmp;
-#ifdef CONFIG_SYS_64BIT_STRTOUL
                tmp = (phys_size_t)simple_strtoull (s, NULL, 16);
-#else
-               tmp = (phys_size_t)simple_strtoul (s, NULL, 16);
-#endif
                return tmp;
        }
+       s = getenv("bootm_low");
+       if (s)
+               tmp = (phys_size_t)simple_strtoull (s, NULL, 16);
+       else
+               tmp = 0;
+
 
 #if defined(CONFIG_ARM)
-       return gd->bd->bi_dram[0].size;
+       return gd->bd->bi_dram[0].size - tmp;
 #else
-       return gd->bd->bi_memsize;
+       return gd->bd->bi_memsize - tmp;
 #endif
 }
 
 void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
 {
+       if (to == from)
+               return;
+
 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
        while (len > 0) {
                size_t tail = (len > chunksz) ? chunksz : len;
@@ -756,7 +762,7 @@ int genimg_has_config (bootm_headers_t *images)
  *     1, if ramdisk image is found but corrupted, or invalid
  *     rd_start and rd_end are set to 0 if no ramdisk exists
  */
-int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
+int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
                uint8_t arch, ulong *rd_start, ulong *rd_end)
 {
        ulong rd_addr, rd_load;
@@ -1279,7 +1285,7 @@ error:
  *     1, if fdt image is found but corrupted
  *     of_flat_tree and of_size are set to 0 if no fdt exists
  */
-int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images,
+int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *images,
                char **of_flat_tree, ulong *of_size)
 {
        const image_header_t *fdt_hdr;