Skip to contentSkip to conversation

xen/dts: fix DT_ROOT_NODE_ADDR_CELLS_DEFAULT

PATCH Applied Julien Grall 2 participants 3 messages Sep 9, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/dts: fix DT_ROOT_NODE_ADDR_CELLS_DEFAULT

The commit dbd1243 "xen/arm: Add helpers to use the device tree" introduced DT_ROOT_NODE_ADDR_CELLS_DEFAULT with is used for default value when #address-cells is not found in the device tree. This value is wrong due to a bad copy from Linux code.

The ePAR (section 2.3.5) says: "If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."

---
 xen/include/xen/device_tree.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/xen/device_tree.h +1 -1
index 402cef2..5cc1905 100644
@@ -233,7 +233,7 @@ struct dt_device_node * __init dt_find_interrupt_controller(const char *compat);
 #define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l)
 
 /* Default #address and #size cells */
-#define DT_ROOT_NODE_ADDR_CELLS_DEFAULT 1
+#define DT_ROOT_NODE_ADDR_CELLS_DEFAULT 2
 #define DT_ROOT_NODE_SIZE_CELLS_DEFAULT 1
 
 #define for_each_property_of_node(dn, pp)                   \
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Julien Grall

The commit dbd1243 "xen/arm: Add helpers to use the device tree" introduced DT_ROOT_NODE_ADDR_CELLS_DEFAULT with is used for default value when #address-cells is not found in the device tree. This value is wrong due to a bad copy from Linux code.

The ePAR (section 2.3.5) says: "If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."

Quoted 17 lines
---
 xen/include/xen/device_tree.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/xen/device_tree.h +1 -1
index 402cef2..5cc1905 100644
@@ -233,7 +233,7 @@ struct dt_device_node * __init dt_find_interrupt_controller(const char *compat);
 #define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l)
 
 /* Default #address and #size cells */
-#define DT_ROOT_NODE_ADDR_CELLS_DEFAULT 1
+#define DT_ROOT_NODE_ADDR_CELLS_DEFAULT 2
 #define DT_ROOT_NODE_SIZE_CELLS_DEFAULT 1
 
 #define for_each_property_of_node(dn, pp)                   \
Applied
#2 lore raw
Quoted 6 lines · Ian Campbell
Quoted 5 lines · Julien Grall

The commit dbd1243 "xen/arm: Add helpers to use the device tree" introduced DT_ROOT_NODE_ADDR_CELLS_DEFAULT with is used for default value when #address-cells is not found in the device tree. This value is wrong due to a bad copy from Linux code.

Quoted 6 lines
Quoted 4 lines

The ePAR (section 2.3.5) says: "If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."

applied.