Skip to contentSkip to conversation

freescale: fman: make sure phy-handle property is big endian

PATCH New shh.xie at gmail.com 2 participants 2 messages Nov 10, 2015 – Dec 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 freescale: fman: make sure phy-handle property is big endian

From: Shaohui Xie <[email protected]>

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.

---
 board/freescale/common/fman.c | 2 ++
 1 file changed, 2 insertions(+)
board/freescale/common/fman.c +2 -0
index 26cf517..b5025ab 100644
@@ -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;
Signature · 1 line
2.1.0.27.g96db324
Applied
#1 lore raw

PATCH 1/1 freescale: fman: make sure phy-handle property is big endian

Quoted 9 lines · shh.xie at gmail.com

From: Shaohui Xie <[email protected]>

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.

---

Applied to fsl-qoriq master. Awaiting upstream.

York