summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas/recipes-bsp/u-boot/u-boot/0005-common-cmd_source.c-Fix-the-source-command-failure-u.patch
blob: 81a205f664b58c9dcb9e6277e8a3db51f4df0a0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 5b189130c95630cf68c50255fb0d1ed0515cb92a Mon Sep 17 00:00:00 2001
From: Gong Qianyu <Qianyu.Gong@freescale.com>
Date: Thu, 30 Jul 2015 14:00:01 +0800
Subject: [PATCH] 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 88 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>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
---
 common/cmd_source.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/cmd_source.c b/common/cmd_source.c
index 6881bc9..291e5f4 100644
--- a/common/cmd_source.c
+++ b/common/cmd_source.c
@@ -32,7 +32,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)
@@ -73,7 +73,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");
@@ -127,7 +127,7 @@ source (ulong addr, const char *fit_uname)
 			return 1;
 		}
 
-		data = (ulong *)fit_data;
+		data = (u32 *)fit_data;
 		len = (ulong)fit_len;
 		break;
 #endif
-- 
1.9.3