X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fimage.c;h=1d7543dd185c331fc21c81add59b97a829d85c01;hb=6febd8ca5aef84de67a2d7da9450d9385352bd04;hp=ca721c5401c29df4907576e3765b7c647afa0c5c;hpb=0741701acf00749672f75f4c196dabd8b235f741;p=u-boot diff --git a/common/image.c b/common/image.c index ca721c5401..1d7543dd18 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, "", "", }, }; @@ -453,24 +458,29 @@ ulong getenv_bootm_low(void) phys_size_t getenv_bootm_size(void) { - phys_size_t tmp; + phys_size_t tmp, size; + phys_addr_t start; char *s = getenv("bootm_size"); if (s) { tmp = (phys_size_t)simple_strtoull(s, NULL, 16); return tmp; } + +#if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS) + start = gd->bd->bi_dram[0].start; + size = gd->bd->bi_dram[0].size; +#else + start = gd->bd->bi_memstart; + size = gd->bd->bi_memsize; +#endif + s = getenv("bootm_low"); if (s) tmp = (phys_size_t)simple_strtoull(s, NULL, 16); else - tmp = 0; + tmp = start; - -#if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS) - return gd->bd->bi_dram[0].size - tmp; -#else - return gd->bd->bi_memsize - tmp; -#endif + return size - (tmp - start); } phys_size_t getenv_bootm_mapsize(void) @@ -904,6 +914,15 @@ 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]; @@ -1099,8 +1118,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(); } @@ -1215,10 +1233,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, @@ -1252,7 +1270,7 @@ int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images, * @cmd_end: pointer to a ulong variable, will hold cmdline end * * boot_get_cmdline() allocates space for kernel command line below - * BOOTMAPSZ + getenv_bootm_low() address. If "bootargs" U-boot environemnt + * BOOTMAPSZ + getenv_bootm_low() address. If "bootargs" U-Boot environemnt * variable is present its contents is copied to allocated kernel * command line. *