Skip to contentSkip to conversation

common/cmd_fdt.c: fix wrong data displayed in fdt print

PATCH New Haojian Zhuang 3 participants 3 messages May 23, 2011 – Jun 1, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 2011052301

#1 lore raw

PATCH 1/1 common/cmd_fdt.c: fix wrong data displayed in fdt print

From: Haojian Zhuang <[email protected]>

All data in dtb is big endian. Some ARM devices are little-endian. In print_data(), it displays data with big-endian format. For ARM device, data should be converted to little-endian first.

Cc Gerald Van Baren <[email protected]>
---
 common/cmd_fdt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_fdt.c +1 -1
index 3d0c2b7..9bdecca 100644
@@ -665,7 +665,7 @@ static void print_data(const void *data, int len)
 
 		printf("<");
 		for (j = 0, p = data; j < len/4; j ++)
-			printf("0x%x%s", p[j], j < (len/4 - 1) ? " " : "");
+			printf("0x%x%s", fdt32_to_cpu(p[j]), j < (len/4 - 1) ? " " : "");
 		printf(">");
 	} else { /* anything else... hexdump */
 		const u8 *s;
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 1/1 common/cmd_fdt.c: fix wrong data displayed in fdt print

Dear Haojian Zhuang,

Quoted 11 lines · In message <[email protected]> you…

From: Haojian Zhuang <[email protected]>

All data in dtb is big endian. Some ARM devices are little-endian. In print_data(), it displays data with big-endian format. For ARM device, data should be converted to little-endian first.

Cc Gerald Van Baren <[email protected]>
---
 common/cmd_fdt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Gerald, I hope this is OK with you?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
 The software required `Windows 95 or better', so I installed Linux.
#3 lore raw

PATCH 1/1 common/cmd_fdt.c: fix wrong data displayed in fdt print

Quoted 3 lines · Wolfgang Denk

Dear Haojian Zhuang,

In message<[email protected]> you wrote:

[snip]

Quoted 3 lines

Applied, thanks.

Gerald, I hope this is OK with you?

Yes.

Quoted 2 lines

Best regards,
Wolfgang Denk

Thanks,
gvb