summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorGong Qianyu <Qianyu.Gong@freescale.com>2015-07-30 14:00:01 +0800
committerTom Rini <trini@konsulko.com>2015-08-12 20:47:56 -0400
commit210fbee901b13d8e21568fc3e00932f3e082c178 (patch)
treefa85473a2653c47a41b44ef51dda75fdcd4e86f5 /common
parent7ef4c45c6e78f3775894053e65e93bdac1e77e63 (diff)
common/cmd_source.c: Fix the source command failure under 64-bit platform
Modify the data pointer type from ulong* to u32*. For arm64 type "ulong" could be 64-bit. Then in line 89 of common/cmd_source.c: "while (*data++);" data will point to the next 64 bits each time. As the uImage file generated by mkimage tool keeps the same data format in either 32-bit or 64-bit platform, the difference would cause failure in 64-bit platform. Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_source.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/cmd_source.c b/common/cmd_source.c
index d2a881ddc79..db7ab7e5f40 100644
--- a/common/cmd_source.c
+++ b/common/cmd_source.c
@@ -33,7 +33,7 @@ source (ulong addr, const char *fit_uname)
#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
const image_header_t *hdr;
#endif
- ulong *data;
+ u32 *data;
int verify;
void *buf;
#if defined(CONFIG_FIT)
@@ -74,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");
@@ -128,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