X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Fcmd_ximg.c;h=8b8645c9e1367028690eb6098465509fe60f446a;hb=0fae47bee7413776275076ae136a174c57aaa25b;hp=b439be3d088526eb48c0fb9c95cd6f805203728f;hpb=778c3cbd857f4abe54773f399204dd86ffe6516c;p=karo-tx-uboot.git diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c index b439be3d08..8b8645c9e1 100644 --- a/common/cmd_ximg.c +++ b/common/cmd_ximg.c @@ -15,11 +15,13 @@ #include #include #include +#include #include #if defined(CONFIG_BZIP2) #include #endif #include +#include #ifndef CONFIG_SYS_XIMG_LEN /* use 8MByte as default max gunzip size */ @@ -31,10 +33,13 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong addr = load_addr; ulong dest = 0; - ulong data, len, count; + ulong data, len; int verify; int part = 0; - image_header_t *hdr; +#if defined(CONFIG_IMAGE_FORMAT_LEGACY) + ulong count; + image_header_t *hdr = NULL; +#endif #if defined(CONFIG_FIT) const char *uname = NULL; const void* fit_hdr; @@ -63,6 +68,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) case IMAGE_FORMAT_LEGACY: printf("## Copying part %d from legacy image " @@ -113,6 +119,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) image_multi_getimg(hdr, part, &data, &len); break; +#endif #if defined(CONFIG_FIT) case IMAGE_FORMAT_FIT: if (uname == NULL) { @@ -210,7 +217,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) } break; #endif -#if defined(CONFIG_BZIP2) +#if defined(CONFIG_BZIP2) && defined(CONFIG_IMAGE_FORMAT_LEGACY) case IH_COMP_BZIP2: { int i; @@ -222,7 +229,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) * which requires at most 2300 KB of memory. */ i = BZ2_bzBuffToBuffDecompress( - (char *)ntohl(hdr->ih_load), + map_sysmem(ntohl(hdr->ih_load), 0), &unc_len, (char *)data, len, CONFIG_SYS_MALLOC_LEN < (4096 * 1024), 0); @@ -241,6 +248,8 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) puts("OK\n"); } + flush_cache(dest, len); + setenv_hex("fileaddr", data); setenv_hex("filesize", len);