+// 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, <linux-development@auerswald.de>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
*/
#include <common.h>
#include <command.h>
+#include <env.h>
+#include <gzip.h>
#include <image.h>
#include <mapmem.h>
#include <watchdog.h>
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
}
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 "
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",
}
}
- /* 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;
}
}
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;
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);