[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 37/72] dt: add helper for phandle allocation
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 37/72] dt: add helper for phandle allocation |
Date: |
Sun, 24 Jun 2012 01:07:01 +0200 |
Phandle references work by having 2 pieces:
- a "phandle" 1-cell property in the device tree node
- a reference to the same value in a property we want to point
to the other node
To generate the 1-cell property, we need an allocation mechanism that
gives us a unique number space. This patch adds an allocator for these
properties.
Signed-off-by: Alexander Graf <address@hidden>
---
device_tree.c | 7 +++++++
device_tree.h | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/device_tree.c b/device_tree.c
index d037896..7541274 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -191,6 +191,13 @@ int qemu_devtree_setprop_phandle(void *fdt, const char
*node_path,
return qemu_devtree_setprop_cell(fdt, node_path, property, phandle);
}
+uint32_t qemu_devtree_alloc_phandle(void *fdt)
+{
+ static int phandle = 0x8000;
+
+ return 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 5f76f40..97af345 100644
--- a/device_tree.h
+++ b/device_tree.h
@@ -27,6 +27,7 @@ int qemu_devtree_setprop_phandle(void *fdt, const char
*node_path,
const char *property,
const char *target_node_path);
uint32_t qemu_devtree_get_phandle(void *fdt, const char *path);
+uint32_t qemu_devtree_alloc_phandle(void *fdt);
int qemu_devtree_nop_node(void *fdt, const char *node_path);
int qemu_devtree_add_subnode(void *fdt, const char *name);
--
1.6.0.2
- [Qemu-ppc] [PATCH 09/72] ppc: Avoid AREG0 for integer and vector helpers, (continued)
- [Qemu-ppc] [PATCH 09/72] ppc: Avoid AREG0 for integer and vector helpers, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 17/72] ppc: Split off misc helpers, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 04/72] ppc: Fix coding style in helper.c, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 25/72] booke_206_tlbwe: Discard invalid bits in MAS2, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 23/72] PPC: mpc8544ds: Span initial TLB entry over as much RAM as we need, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 24/72] Avoid segfault in cpu_dump_state, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 28/72] spapr_vscsi: Error handling fixes, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 20/72] ppc: Move load and store helpers, switch to AREG0 free mode, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 31/72] dt: allow add_subnode to create root subnodes, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 34/72] dt: temporarily disable subtree creation failure check, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 37/72] dt: add helper for phandle allocation,
Alexander Graf <=
- [Qemu-ppc] [PATCH 38/72] dt: add helper for 64bit cell adds, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 41/72] PPC: e500: dt: create /cpus node dynamically, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 26/72] ppc64: Rudimentary Support for extra page sizes on server CPUs, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 40/72] PPC: e500: dt: create memory node dynamically, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 27/72] pseries: Correctly create ibm, segment-page-sizes property, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 06/72] ppc: Split FPU and SPE ops, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 49/72] PPC: e500: dt: create pci node dynamically, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 56/72] PPC: e500: Use new MPIC dt format, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 57/72] PPC: e500: Use new SOC dt format, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 55/72] Revert "dt: temporarily disable subtree creation failure check", Alexander Graf, 2012/06/23