[U-Boot] [PATCH 1/2] [v2] fdt: add support for the ePAPR "phandle" property

Timur Tabi timur at freescale.com
Fri May 6 21:56:37 CEST 2011


The ePAPR specification says that phandle properties should be called
"phandle", and not "linux,phandle".  To facilitate the migration from
"linux,phandle" to "phandle", we update some functions to support both
properties.

Signed-off-by: Timur Tabi <timur at freescale.com>
---

Upstream libfdt already has the ePAPR changes, so would someone please pull
in those changes?

 common/fdt_support.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 496040b..85715ff 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -1187,6 +1187,12 @@ int fdt_alloc_phandle(void *blob)
 
 	for (offset = fdt_next_node(blob, -1, NULL); offset >= 0;
 	     offset = fdt_next_node(blob, offset, NULL)) {
+		/* Check the ePAPR-compliant "phandle" property name */
+		val = fdt_getprop(blob, offset, "phandle", &len);
+		if (val)
+			phandle = max(*val, phandle);
+
+		/* Also check the deprecated "linux,phandle" property name */
 		val = fdt_getprop(blob, offset, "linux,phandle", &len);
 		if (val)
 			phandle = max(*val, phandle);
-- 
1.7.3.4




More information about the U-Boot mailing list