X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cmd%2Fximg.c;h=770f6a3eede78bf2edce966cf831f3f5e027dc24;hb=b641dd3ec8dc3f6b18d2fa945ac3ab597063d191;hp=21b5c377218331012e39e10be13ec74a324cc00b;hpb=390194d43fa4478ddb638164ddb114c979f3e57a;p=oweals%2Fu-boot.git diff --git a/cmd/ximg.c b/cmd/ximg.c index 21b5c37721..770f6a3eed 100644 --- a/cmd/ximg.c +++ b/cmd/ximg.c @@ -1,11 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000-2004 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * (C) Copyright 2003 * Kai-Uwe Bloem, Auerswald GmbH & Co KG, - * - * SPDX-License-Identifier: GPL-2.0+ */ @@ -14,7 +13,11 @@ */ #include #include +#include +#include +#include #include +#include #include #include #if defined(CONFIG_BZIP2) @@ -31,12 +34,12 @@ static int do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { - ulong addr = load_addr; + ulong addr = image_load_addr; ulong dest = 0; ulong data, len; int verify; int part = 0; -#if defined(CONFIG_IMAGE_FORMAT_LEGACY) +#if defined(CONFIG_LEGACY_IMAGE_FORMAT) ulong count; image_header_t *hdr = NULL; #endif @@ -68,7 +71,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) } switch (genimg_get_format((void *)addr)) { -#if defined(CONFIG_IMAGE_FORMAT_LEGACY) +#if defined(CONFIG_LEGACY_IMAGE_FORMAT) case IMAGE_FORMAT_LEGACY: printf("## Copying part %d from legacy image " @@ -144,7 +147,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) return 1; } - if (fit_image_check_comp(fit_hdr, noffset, IH_COMP_NONE) + if (!fit_image_check_comp(fit_hdr, noffset, IH_COMP_NONE) && (argc < 4)) { printf("Must specify load address for %s command " "with compressed image\n", @@ -160,9 +163,9 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) } } - /* get subimage data address and length */ - if (fit_image_get_data(fit_hdr, noffset, - &fit_data, &fit_len)) { + /* get subimage/external data address and length */ + if (fit_image_get_data_and_size(fit_hdr, noffset, + &fit_data, &fit_len)) { puts("Could not find script subimage data\n"); return 1; } @@ -218,7 +221,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) } break; #endif -#if defined(CONFIG_BZIP2) && defined(CONFIG_IMAGE_FORMAT_LEGACY) +#if defined(CONFIG_BZIP2) && defined(CONFIG_LEGACY_IMAGE_FORMAT) case IH_COMP_BZIP2: { int i; @@ -249,7 +252,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) puts("OK\n"); } - flush_cache(dest, len); + flush_cache(dest, ALIGN(len, ARCH_DMA_MINALIGN)); env_set_hex("fileaddr", data); env_set_hex("filesize", len);