On 10/28/2014 06:37 PM, Leif Lindholm wrote:
On Tue, Oct 28, 2014 at 01:46:49PM +0800, Fu Wei wrote:
On 10/27/2014 09:24 PM, Leif Lindholm wrote:
On Mon, Oct 27, 2014 at 04:40:50PM +0800, Fu Wei wrote:
fdt: Add grub_fdt_set_reg64 macro into fdt.h header file for inserting "reg" properiy, while #address-cells = <0x2> and #size-cells = <0x2>
Signed-off-by: Fu Wei fu.wei@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.9.1
Looks good.
Reviewed-by: Leif Lindholm leif.lindholm@linaro.org (GRUB does not tend to use these, but it doesn't hurt.)
If you think they don't tend to use these, I think we can just make it in multiboot.h Because I also think it doesn't common enough to be in fdt.h for now
any idea?
No, I just meant the Reviewed-by: bit :) The patch is fine.
Ah, Sorry for misunderstanding. Got you.
/ Leif