]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
common/cmd_source.c: Fix the source command failure under 64-bit platform
authorGong Qianyu <Qianyu.Gong@freescale.com>
Thu, 30 Jul 2015 06:00:01 +0000 (14:00 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 08:19:12 +0000 (10:19 +0200)
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>
common/cmd_source.c

index d2a881ddc798f32c5a598f57245a208b9bb8036d..db7ab7e5f4092a0b996f96702e4ed53b9cd897bb 100644 (file)
@@ -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