[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 03/31] dt: add helper for phandle ref
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 03/31] dt: add helper for phandle references |
Date: |
Wed, 06 Jun 2012 15:06:49 +1000 |
On Wed, 2012-06-06 at 01:52 +0200, Alexander Graf wrote:
> Phandles are the fancy device tree name for "pointer to another node".
> To create a phandle property, we most likely want to reference to the
> node we're pointing to by its path. So create a helper that allows
> us to do so.
>
> Signed-off-by: Alexander Graf <address@hidden>
> ---
> device_tree.c | 7 +++++++
> device_tree.h | 2 ++
> 2 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/device_tree.c b/device_tree.c
> index b1dff4f..8e9262c 100644
> --- a/device_tree.c
> +++ b/device_tree.c
> @@ -162,6 +162,13 @@ int qemu_devtree_setprop_string(void *fdt, const char
> *node_path,
> return r;
> }
>
> +int qemu_devtree_setprop_phandle(void *fdt, const char *node_path,
> + const char *property, const char *string)
"string" is a bit of a misnomer for this argument, considering its a
node_path. Maybe "target", or "target_node_path"
> +{
> + uint32_t phandle = fdt_get_phandle(fdt, findnode_nofail(fdt, string));
> + return qemu_devtree_setprop_cell(fdt, node_path, property, phandle);
> +}
> +
> int qemu_devtree_nop_node(void *fdt, const char *node_path)
> {
> int r;
> diff --git a/device_tree.h b/device_tree.h
> index 9db7f86..2e87c58 100644
> --- a/device_tree.h
> +++ b/device_tree.h
> @@ -31,6 +31,8 @@ int qemu_devtree_setprop_cell4(void *fdt, const char
> *node_path,
> uint32_t val2, uint32_t val3, uint32_t val4);
> int qemu_devtree_setprop_string(void *fdt, const char *node_path,
> const char *property, const char *string);
> +int qemu_devtree_setprop_phandle(void *fdt, const char *node_path,
> + const char *property, const char *string);
> int qemu_devtree_nop_node(void *fdt, const char *node_path);
> int qemu_devtree_add_subnode(void *fdt, const char *name);
>
- [Qemu-ppc] [PATCH 18/31] PPC: e500: dt: create global-utils node dynamically, (continued)
[Qemu-ppc] [PATCH 03/31] dt: add helper for phandle references, Alexander Graf, 2012/06/05
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 03/31] dt: add helper for phandle references,
Peter Crosthwaite <=
[Qemu-ppc] [PATCH 14/31] PPC: e500: dt: create /chosen node dynamically, Alexander Graf, 2012/06/05
[Qemu-ppc] [PATCH 11/31] PPC: e500: dt: create /cpus node dynamically, Alexander Graf, 2012/06/05
[Qemu-ppc] [PATCH 15/31] PPC: e500: dt: create /soc8544 node dynamically, Alexander Graf, 2012/06/05
[Qemu-ppc] [PATCH 30/31] dt: Add global option to set phandle start offset, Alexander Graf, 2012/06/05
[Qemu-ppc] [PATCH 29/31] PPC: e500: Extend address/size of / to 64bit, Alexander Graf, 2012/06/05
[Qemu-ppc] [PATCH 01/31] dt: allow add_subnode to create root subnodes, Alexander Graf, 2012/06/05
[Qemu-ppc] [PATCH 16/31] PPC: e500: dt: create serial nodes dynamically, Alexander Graf, 2012/06/05
[Qemu-ppc] [PATCH 19/31] PPC: e500: dt: create pci node dynamically, Alexander Graf, 2012/06/05
[Qemu-ppc] [PATCH 28/31] PPC: e500: Define addresses as always 64bit, Alexander Graf, 2012/06/05