X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fimage.c;h=e6071099d6365ecc63483c2c1ab4b1df400997ac;hb=ecdc3df611385625dc3902b3de118dfcbfd8fb0c;hp=9efacf8b89ecb36b0f2c43dd5cd5fa373b648ebe;hpb=6f4e050639241218987541f4729172e4e0e2ff31;p=oweals%2Fu-boot.git diff --git a/common/image.c b/common/image.c index 9efacf8b89..e6071099d6 100644 --- a/common/image.c +++ b/common/image.c @@ -54,6 +54,10 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch, #include #include #include + +#ifndef __maybe_unused +# define __maybe_unused /* unimplemented */ +#endif #endif /* !USE_HOSTCC*/ #include @@ -151,6 +155,9 @@ 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" }, { -1, "", "", }, }; @@ -160,6 +167,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, "", "", }, }; @@ -274,7 +282,7 @@ void image_multi_getimg(const image_header_t *hdr, ulong idx, static void image_print_type(const image_header_t *hdr) { - const char *os, *arch, *type, *comp; + const char __maybe_unused *os, *arch, *type, *comp; os = genimg_get_os_name(image_get_os(hdr)); arch = genimg_get_arch_name(image_get_arch(hdr)); @@ -299,7 +307,7 @@ static void image_print_type(const image_header_t *hdr) void image_print_contents(const void *ptr) { const image_header_t *hdr = (const image_header_t *)ptr; - const char *p; + const char __maybe_unused *p; p = IMAGE_INDENT_STRING; printf("%sImage Name: %.*s\n", p, IH_NMLEN, image_get_name(hdr)); @@ -900,8 +908,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 (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 @@ -1000,6 +1018,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 @@ -1031,16 +1055,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 */ @@ -1213,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,