* [PATCH 1/5] Add grub_fdt_set_reg64 macro into fdt.h header file for
@ 2014-12-18 17:59 Fu Wei
0 siblings, 0 replies; only message in thread
From: Fu Wei @ 2014-12-18 17:59 UTC (permalink / raw)
To: grub-devel, Leif Lindholm, Ian Campbell
Cc: Roy Franz, Jon Masters, linaro-uefi
inserting "reg" properiy, while #address-cells = <0x2> and #size-cells = <0x2>
Signed-off-by: Fu Wei <fu.wei@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
---
include/grub/fdt.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/grub/fdt.h b/include/grub/fdt.h
index 3016998..fdfca75 100644
--- a/include/grub/fdt.h
+++ b/include/grub/fdt.h
@@ -117,4 +117,16 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name,
grub_fdt_set_prop ((fdt), (nodeoffset), (name), &_val, 8); \
})
+/* Setup "reg" property for
+ * #address-cells = <0x2>
+ * #size-cells = <0x2>
+ */
+#define grub_fdt_set_reg64(fdt, nodeoffset, addr, size) \
+({ \
+ grub_uint64_t reg_64[2]; \
+ reg_64[0] = grub_cpu_to_be64(addr); \
+ reg_64[1] = grub_cpu_to_be64(size); \
+ grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \
+})
+
#endif /* ! GRUB_FDT_HEADER */
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-12-18 17:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-18 17:59 [PATCH 1/5] Add grub_fdt_set_reg64 macro into fdt.h header file for Fu Wei
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.