X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fimage.c;h=7604494a567ed9cf9af14c2b58a2bc6d1fb3805d;hb=d8c1e0331ac31aefe32c9182a44b612617008288;hp=af155b229b9dc2b5c5268732060860055d033a84;hpb=926fbcc08327bd0ffb9964765e6573c432957998;p=oweals%2Fu-boot.git diff --git a/common/image.c b/common/image.c index af155b229b..7604494a56 100644 --- a/common/image.c +++ b/common/image.c @@ -38,7 +38,7 @@ #include #include -#include +#include #include #ifdef CONFIG_CMD_BDI @@ -93,6 +93,7 @@ static const table_entry_t uimage_arch[] = { { IH_ARCH_ARM64, "arm64", "AArch64", }, { IH_ARCH_ARC, "arc", "ARC", }, { IH_ARCH_X86_64, "x86_64", "AMD x86_64", }, + { IH_ARCH_XTENSA, "xtensa", "Xtensa", }, { -1, "", "", }, }; @@ -160,6 +161,7 @@ static const table_entry_t uimage_type[] = { { 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_VYBRIDIMAGE, "vybridimage", "Vybrid Boot Image", }, { IH_TYPE_ZYNQIMAGE, "zynqimage", "Xilinx Zynq Boot Image" }, { IH_TYPE_ZYNQMPIMAGE, "zynqmpimage", "Xilinx ZynqMP Boot Image" }, { IH_TYPE_FPGA, "fpga", "FPGA Image" }, @@ -585,10 +587,12 @@ const table_entry_t *get_table_entry(const table_entry_t *table, int id) static const char *unknown_msg(enum ih_category category) { + static const char unknown_str[] = "Unknown "; static char msg[30]; - strcpy(msg, "Unknown "); - strcat(msg, table_info[category].desc); + strcpy(msg, unknown_str); + strncat(msg, table_info[category].desc, + sizeof(msg) - sizeof(unknown_str)); return msg; } @@ -1077,7 +1081,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, rd_addr = map_to_sysmem(images->fit_hdr_os); rd_noffset = fit_get_node_from_config(images, FIT_RAMDISK_PROP, rd_addr); - if (rd_noffset == -ENOLINK) + if (rd_noffset == -ENOENT) return 0; else if (rd_noffset < 0) return 1; @@ -1303,7 +1307,7 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images, void *buf; int conf_noffset; int fit_img_result; - char *uname, *name; + const char *uname, *name; int err; int devnum = 0; /* TODO support multi fpga platforms */ const fpga_desc * const desc = fpga_get_desc(devnum); @@ -1330,9 +1334,9 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images, case IMAGE_FORMAT_FIT: conf_noffset = fit_conf_get_node(buf, images->fit_uname_cfg); - err = fdt_get_string_index(buf, conf_noffset, FIT_FPGA_PROP, 0, - (const char **)&uname); - if (err < 0) { + uname = fdt_stringlist_get(buf, conf_noffset, FIT_FPGA_PROP, 0, + NULL); + if (!uname) { debug("## FPGA image is not specified\n"); return 0; } @@ -1402,7 +1406,7 @@ int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images, int loadables_index; int conf_noffset; int fit_img_result; - char *uname; + const char *uname; /* Check to see if the images struct has a FIT configuration */ if (!genimg_has_config(images)) { @@ -1426,15 +1430,14 @@ 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, - FIT_LOADABLE_PROP, - loadables_index, - (const char **)&uname) == 0; + uname = fdt_stringlist_get(buf, conf_noffset, + FIT_LOADABLE_PROP, loadables_index, + NULL), uname; loadables_index++) { fit_img_result = fit_image_load(images, tmp_img_addr, - (const char **)&uname, + &uname, &(images->fit_uname_cfg), arch, IH_TYPE_LOADABLE, BOOTSTAGE_ID_FIT_LOADABLE_START,