diff mbox

xen/dts: fix DT_ROOT_NODE_ADDR_CELLS_DEFAULT

Message ID 1378727947-3775-1-git-send-email-julien.grall@linaro.org
State Accepted, archived
Headers show

Commit Message

Julien Grall Sept. 9, 2013, 11:59 a.m. UTC
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."

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/xen/device_tree.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ian Campbell Sept. 9, 2013, 12:08 p.m. UTC | #1
On Mon, 2013-09-09 at 12:59 +0100, Julien Grall wrote:
> 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."
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  xen/include/xen/device_tree.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index 402cef2..5cc1905 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -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)                   \
Ian Campbell Sept. 9, 2013, 2:07 p.m. UTC | #2
On Mon, 2013-09-09 at 13:08 +0100, Ian Campbell wrote:
> On Mon, 2013-09-09 at 12:59 +0100, Julien Grall wrote:
> > 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."
> > 
> > Signed-off-by: Julien Grall <julien.grall@linaro.org>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

applied.
diff mbox

Patch

diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 402cef2..5cc1905 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -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)                   \