X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fbootm.c;h=2ed7521520a756d3f9bd7057f4b9fde6e3490384;hb=a61cf765f7e3a4ba80453150e16acaaecbd913ac;hp=02295daf79f1f6452a6e2120be64e8955b22c07c;hpb=5939afc9611e8ba4a86b96e67670b765ee27668e;p=oweals%2Fu-boot.git diff --git a/common/bootm.c b/common/bootm.c index 02295daf79..2ed7521520 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -7,12 +7,17 @@ #ifndef USE_HOSTCC #include #include +#include #include #include #include +#include #include +#include #include #include +#include +#include #include #if defined(CONFIG_CMD_USB) #include @@ -38,8 +43,8 @@ DECLARE_GLOBAL_DATA_PTR; bootm_headers_t images; /* pointers to os/initrd/fdt images */ -static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[], bootm_headers_t *images, +static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], bootm_headers_t *images, ulong *os_data, ulong *os_len); __weak void board_quiesce_devices(void) @@ -63,8 +68,8 @@ static void boot_start_lmb(bootm_headers_t *images) static inline void boot_start_lmb(bootm_headers_t *images) { } #endif -static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int bootm_start(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { memset((void *)&images, 0, sizeof(images)); images.verify = env_get_yesno("verify"); @@ -77,8 +82,8 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, return 0; } -static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { const void *os_hdr; bool ep_found = false; @@ -234,7 +239,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc, * 0, if all existing images were loaded correctly * 1, if an image is found but corrupted, or invalid */ -int bootm_find_images(int flag, int argc, char * const argv[]) +int bootm_find_images(int flag, int argc, char *const argv[]) { int ret; @@ -281,8 +286,8 @@ int bootm_find_images(int flag, int argc, char * const argv[]) return 0; } -static int bootm_find_other(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int bootm_find_other(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { if (((images.os.type == IH_TYPE_KERNEL) || (images.os.type == IH_TYPE_KERNEL_NOLOAD) || @@ -516,8 +521,9 @@ static void fixup_silent_linux(void) * then the intent is to boot an OS, so this function will not return * unless the image type is standalone. */ -int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], - int states, bootm_headers_t *images, int boot_progress) +int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], int states, bootm_headers_t *images, + int boot_progress) { boot_os_fn *boot_fn; ulong iflag = 0; @@ -700,8 +706,8 @@ static image_header_t *image_get_kernel(ulong img_addr, int verify) * pointer to image header if valid image was found, plus kernel start * address and length, otherwise NULL */ -static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[], bootm_headers_t *images, +static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], bootm_headers_t *images, ulong *os_data, ulong *os_len) { #if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT) @@ -817,7 +823,8 @@ void __weak switch_to_non_secure_mode(void) #else /* USE_HOSTCC */ #if defined(CONFIG_FIT_SIGNATURE) -static int bootm_host_load_image(const void *fit, int req_image_type) +static int bootm_host_load_image(const void *fit, int req_image_type, + int cfg_noffset) { const char *fit_uname_config = NULL; ulong data, len; @@ -829,6 +836,7 @@ static int bootm_host_load_image(const void *fit, int req_image_type) void *load_buf; int ret; + fit_uname_config = fdt_get_name(fit, cfg_noffset, NULL); memset(&images, '\0', sizeof(images)); images.verify = 1; noffset = fit_image_load(&images, (ulong)fit, @@ -876,7 +884,7 @@ int bootm_host_load_images(const void *fit, int cfg_noffset) for (i = 0; i < ARRAY_SIZE(image_types); i++) { int ret; - ret = bootm_host_load_image(fit, image_types[i]); + ret = bootm_host_load_image(fit, image_types[i], cfg_noffset); if (!err && ret && ret != -ENOENT) err = ret; }