projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cmd: simplify command efidebug
[platform/kernel/u-boot.git]
/
cmd
/
ximg.c
diff --git
a/cmd/ximg.c
b/cmd/ximg.c
index
9e53cc4
..
1c40fd2
100644
(file)
--- a/
cmd/ximg.c
+++ b/
cmd/ximg.c
@@
-13,13
+13,18
@@
*/
#include <common.h>
#include <command.h>
*/
#include <common.h>
#include <command.h>
+#include <cpu_func.h>
+#include <env.h>
+#include <gzip.h>
#include <image.h>
#include <image.h>
+#include <malloc.h>
#include <mapmem.h>
#include <watchdog.h>
#if defined(CONFIG_BZIP2)
#include <bzlib.h>
#endif
#include <asm/byteorder.h>
#include <mapmem.h>
#include <watchdog.h>
#if defined(CONFIG_BZIP2)
#include <bzlib.h>
#endif
#include <asm/byteorder.h>
+#include <asm/cache.h>
#include <asm/io.h>
#ifndef CONFIG_SYS_XIMG_LEN
#include <asm/io.h>
#ifndef CONFIG_SYS_XIMG_LEN
@@
-28,16
+33,16
@@
#endif
static int
#endif
static int
-do_imgextract(
cmd_tbl_t * cmdtp, int flag, int argc, char *
const argv[])
+do_imgextract(
struct cmd_tbl *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_LEGACY_IMAGE_FORMAT)
ulong count;
ulong dest = 0;
ulong data, len;
int verify;
int part = 0;
#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
ulong count;
-
image_header_t
*hdr = NULL;
+
struct legacy_img_hdr
*hdr = NULL;
#endif
#if defined(CONFIG_FIT)
const char *uname = NULL;
#endif
#if defined(CONFIG_FIT)
const char *uname = NULL;
@@
-54,16
+59,16
@@
do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
verify = env_get_yesno("verify");
if (argc > 1) {
verify = env_get_yesno("verify");
if (argc > 1) {
- addr =
simple_strtoul(argv[1], NULL, 16
);
+ addr =
hextoul(argv[1], NULL
);
}
if (argc > 2) {
}
if (argc > 2) {
- part =
simple_strtoul(argv[2], NULL, 16
);
+ part =
hextoul(argv[2], NULL
);
#if defined(CONFIG_FIT)
uname = argv[2];
#endif
}
if (argc > 3) {
#if defined(CONFIG_FIT)
uname = argv[2];
#endif
}
if (argc > 3) {
- dest =
simple_strtoul(argv[3], NULL, 16
);
+ dest =
hextoul(argv[3], NULL
);
}
switch (genimg_get_format((void *)addr)) {
}
switch (genimg_get_format((void *)addr)) {
@@
-73,7
+78,7
@@
do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
printf("## Copying part %d from legacy image "
"at %08lx ...\n", part, addr);
printf("## Copying part %d from legacy image "
"at %08lx ...\n", part, addr);
- hdr = (
image_header_t
*)addr;
+ hdr = (
struct legacy_img_hdr
*)addr;
if (!image_check_magic(hdr)) {
printf("Bad Magic Number\n");
return 1;
if (!image_check_magic(hdr)) {
printf("Bad Magic Number\n");
return 1;
@@
-131,7
+136,7
@@
do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
"at %08lx ...\n", uname, addr);
fit_hdr = (const void *)addr;
"at %08lx ...\n", uname, addr);
fit_hdr = (const void *)addr;
- if (
!fit_check_format(fit_hdr
)) {
+ if (
fit_check_format(fit_hdr, IMAGE_SIZE_INVAL
)) {
puts("Bad FIT image format\n");
return 1;
}
puts("Bad FIT image format\n");
return 1;
}
@@
-166,11
+171,8
@@
do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
return 1;
}
return 1;
}
- if (fit_image_get_comp(fit_hdr, noffset, &comp)) {
- puts("Could not find script subimage "
- "compression type\n");
- return 1;
- }
+ if (fit_image_get_comp(fit_hdr, noffset, &comp))
+ comp = IH_COMP_NONE;
data = (ulong)fit_data;
len = (ulong)fit_len;
data = (ulong)fit_data;
len = (ulong)fit_len;
@@
-195,7
+197,7
@@
do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
while (l > 0) {
tail = (l > CHUNKSZ) ? CHUNKSZ : l;
while (l > 0) {
tail = (l > CHUNKSZ) ? CHUNKSZ : l;
-
WATCHDOG_RESET
();
+
schedule
();
memmove(to, from, tail);
to += tail;
from += tail;
memmove(to, from, tail);
to += tail;
from += tail;