[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 32/72] dt: add helpers for multi-cell adds
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 32/72] dt: add helpers for multi-cell adds |
Date: |
Sun, 24 Jun 2012 01:06:56 +0200 |
We have device tree helpers that allow us to create single cell (u32)
wide properties. However, when creating properties that contain an array of
cells, we need to jump through hoops, manually passing in an array with
converted endianness.
To ease the pain of this, create a generic macro helper that allows us
to pass the cells as arguments.
Signed-off-by: Alexander Graf <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
---
device_tree.h | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/device_tree.h b/device_tree.h
index 4378685..1e671e2 100644
--- a/device_tree.h
+++ b/device_tree.h
@@ -25,4 +25,16 @@ int qemu_devtree_setprop_string(void *fdt, const char
*node_path,
int qemu_devtree_nop_node(void *fdt, const char *node_path);
int qemu_devtree_add_subnode(void *fdt, const char *name);
+#define qemu_devtree_setprop_cells(fdt, node_path, property, ...) \
+ do { \
+ uint32_t qdt_tmp[] = { __VA_ARGS__ }; \
+ int i; \
+ \
+ for (i = 0; i < ARRAY_SIZE(qdt_tmp); i++) { \
+ qdt_tmp[i] = cpu_to_be32(qdt_tmp[i]); \
+ } \
+ qemu_devtree_setprop(fdt, node_path, property, qdt_tmp, \
+ sizeof(qdt_tmp)); \
+ } while (0)
+
#endif /* __DEVICE_TREE_H__ */
--
1.6.0.2
- [Qemu-devel] [PATCH 20/72] ppc: Move load and store helpers, switch to AREG0 free mode, (continued)
- [Qemu-devel] [PATCH 20/72] ppc: Move load and store helpers, switch to AREG0 free mode, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 06/72] ppc: Split FPU and SPE ops, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 25/72] booke_206_tlbwe: Discard invalid bits in MAS2, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 24/72] Avoid segfault in cpu_dump_state, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 23/72] PPC: mpc8544ds: Span initial TLB entry over as much RAM as we need, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 28/72] spapr_vscsi: Error handling fixes, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 30/72] raw-posix: Fix build without is_allocated support, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 31/72] dt: allow add_subnode to create root subnodes, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 33/72] dt: add helper for phandle references, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 29/72] spapr: Add "memop" hypercall, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 32/72] dt: add helpers for multi-cell adds,
Alexander Graf <=
- [Qemu-devel] [PATCH 01/72] ppc: Fix coding style in op_helper.c, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 08/72] ppc: Split integer and vector ops, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 26/72] ppc64: Rudimentary Support for extra page sizes on server CPUs, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 37/72] dt: add helper for phandle allocation, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 38/72] dt: add helper for 64bit cell adds, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 34/72] dt: temporarily disable subtree creation failure check, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 40/72] PPC: e500: dt: create memory node dynamically, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 41/72] PPC: e500: dt: create /cpus node dynamically, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 35/72] dt: add helper for phandle enumeration, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 42/72] PPC: e500: dt: create /hypervisor node dynamically, Alexander Graf, 2012/06/23