public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] freescale: fman: make sure phy-handle property is big endian
@ 2015-11-10 11:20 shh.xie at gmail.com
  2015-12-15  0:42 ` York Sun
  0 siblings, 1 reply; 2+ messages in thread
From: shh.xie at gmail.com @ 2015-11-10 11:20 UTC (permalink / raw)
  To: u-boot

From: Shaohui Xie <Shaohui.Xie@freescale.com>

When creating phy-handle property, an unsigned int value is created by
fdt_create_phandle, and memcpy is used to get the value, since DTS is
big endian, the value cannot be used directly on little endian SoCs,
it should be converted by cpu_to_fdt32.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 board/freescale/common/fman.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/freescale/common/fman.c b/board/freescale/common/fman.c
index 26cf517..b5025ab 100644
--- a/board/freescale/common/fman.c
+++ b/board/freescale/common/fman.c
@@ -52,6 +52,8 @@ int fdt_set_phy_handle(void *fdt, char *compat, phys_addr_t addr,
 	if (!ph)
 		return -FDT_ERR_BADPHANDLE;
 
+	ph = cpu_to_fdt32(ph);
+
 	offset = fdt_node_offset_by_compat_reg(fdt, compat, addr);
 	if (offset < 0)
 		return offset;
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-15  0:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-10 11:20 [U-Boot] [PATCH] freescale: fman: make sure phy-handle property is big endian shh.xie at gmail.com
2015-12-15  0:42 ` York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox