X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=common%2Fcmd_source.c;h=db7ab7e5f4092a0b996f96702e4ed53b9cd897bb;hb=HEAD;hp=54ffd16470e8c9d0c43ba1c209fee241163bdcd1;hpb=778c3cbd857f4abe54773f399204dd86ffe6516c;p=karo-tx-uboot.git diff --git a/common/cmd_source.c b/common/cmd_source.c index 54ffd16470..db7ab7e5f4 100644 --- a/common/cmd_source.c +++ b/common/cmd_source.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #if defined(CONFIG_8xx) @@ -29,8 +30,10 @@ int source (ulong addr, const char *fit_uname) { ulong len; +#if defined(CONFIG_IMAGE_FORMAT_LEGACY) const image_header_t *hdr; - ulong *data; +#endif + u32 *data; int verify; void *buf; #if defined(CONFIG_FIT) @@ -44,6 +47,7 @@ source (ulong addr, const char *fit_uname) buf = map_sysmem(addr, 0); switch (genimg_get_format(buf)) { +#if defined(CONFIG_IMAGE_FORMAT_LEGACY) case IMAGE_FORMAT_LEGACY: hdr = buf; @@ -70,7 +74,7 @@ source (ulong addr, const char *fit_uname) } /* get length of script */ - data = (ulong *)image_get_data (hdr); + data = (u32 *)image_get_data (hdr); if ((len = uimage_to_cpu (*data)) == 0) { puts ("Empty Script\n"); @@ -84,6 +88,7 @@ source (ulong addr, const char *fit_uname) */ while (*data++); break; +#endif #if defined(CONFIG_FIT) case IMAGE_FORMAT_FIT: if (fit_uname == NULL) { @@ -123,7 +128,7 @@ source (ulong addr, const char *fit_uname) return 1; } - data = (ulong *)fit_data; + data = (u32 *)fit_data; len = (ulong)fit_len; break; #endif @@ -138,8 +143,7 @@ source (ulong addr, const char *fit_uname) /**************************************************/ #if defined(CONFIG_CMD_SOURCE) -int -do_source (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr; int rcode;