X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fimage.c;h=f4a1dc8e251a24251d5a09e0e900360d4fb846bb;hb=f3ad64c88ccc3cd60d9d2d7b0098bf1692fda779;hp=c3616e2c44f1b37dd13f5f056c9a502d7d5c5f87;hpb=80402f34f8e1f46134a0272ff4d34be64ff7380b;p=u-boot diff --git a/common/image.c b/common/image.c index c3616e2c44..f4a1dc8e25 100644 --- a/common/image.c +++ b/common/image.c @@ -155,6 +155,10 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_ATMELIMAGE, "atmelimage", "ATMEL ROM-Boot Image",}, { IH_TYPE_X86_SETUP, "x86_setup", "x86 setup.bin", }, { IH_TYPE_LPC32XXIMAGE, "lpc32xximage", "LPC32XX Boot Image", }, + { IH_TYPE_RKIMAGE, "rkimage", "Rockchip Boot Image" }, + { IH_TYPE_RKSD, "rksd", "Rockchip SD Boot Image" }, + { IH_TYPE_RKSPI, "rkspi", "Rockchip SPI Boot Image" }, + { IH_TYPE_ZYNQIMAGE, "zynqimage", "Xilinx Zynq Boot Image" }, { -1, "", "", }, }; @@ -164,6 +168,7 @@ static const table_entry_t uimage_comp[] = { { IH_COMP_GZIP, "gzip", "gzip compressed", }, { IH_COMP_LZMA, "lzma", "lzma compressed", }, { IH_COMP_LZO, "lzo", "lzo compressed", }, + { IH_COMP_LZ4, "lz4", "lz4 compressed", }, { -1, "", "", }, }; @@ -467,9 +472,9 @@ phys_size_t getenv_bootm_size(void) #if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS) - return gd->bd->bi_dram[0].size - tmp; + return gd->bd->bi_dram[0].size - (tmp - gd->bd->bi_dram[0].start); #else - return gd->bd->bi_memsize - tmp; + return gd->bd->bi_memsize - (tmp - gd->bd->bi_memstart); #endif } @@ -904,8 +909,18 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, *rd_start = 0; *rd_end = 0; +#ifdef CONFIG_ANDROID_BOOT_IMAGE + /* + * Look for an Android boot image. + */ + buf = map_sysmem(images->os.start, 0); + if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) + select = argv[0]; +#endif + if (argc >= 2) select = argv[1]; + /* * Look for a '-' which indicates to ignore the * ramdisk argument @@ -1004,6 +1019,12 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, images->fit_uname_rd = fit_uname_ramdisk; images->fit_noffset_rd = rd_noffset; break; +#endif +#ifdef CONFIG_ANDROID_BOOT_IMAGE + case IMAGE_FORMAT_ANDROID: + android_image_get_ramdisk((void *)images->os.start, + &rd_data, &rd_len); + break; #endif default: #ifdef CONFIG_SUPPORT_RAW_INITRD @@ -1035,16 +1056,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, (ulong)images->legacy_hdr_os); image_multi_getimg(images->legacy_hdr_os, 1, &rd_data, &rd_len); - } -#ifdef CONFIG_ANDROID_BOOT_IMAGE - else if ((genimg_get_format((void *)images->os.start) - == IMAGE_FORMAT_ANDROID) && - (!android_image_get_ramdisk((void *)images->os.start, - &rd_data, &rd_len))) { - /* empty */ - } -#endif - else { + } else { /* * no initrd image */ @@ -1101,8 +1113,7 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len, if (initrd_high == ~0) initrd_copy_to_ram = 0; } else { - /* not set, no restrictions to load high */ - initrd_high = ~0; + initrd_high = getenv_bootm_mapsize() + getenv_bootm_low(); } @@ -1217,10 +1228,10 @@ int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images, conf_noffset = fit_conf_get_node(buf, images->fit_uname_cfg); for (loadables_index = 0; - !fdt_get_string_index(buf, conf_noffset, + fdt_get_string_index(buf, conf_noffset, FIT_LOADABLE_PROP, loadables_index, - (const char **)&uname) > 0; + (const char **)&uname) == 0; loadables_index++) { fit_img_result = fit_image_load(images,