diff options
author | Thierry Reding <treding@nvidia.com> | 2019-03-21 19:09:59 +0100 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-04-11 20:10:50 -0600 |
commit | 155d0a08fb9bf0ab39c3db8961bd618f49897630 (patch) | |
tree | 91710b732839ea5a96cbad530ab4b6724f3da6dc /include/fdtdec.h | |
parent | ea1df3e07cc5a4b155e69fcb7f583cb7f4c2cbe3 (diff) |
fdtdec: Add cpu_to_fdt_{addr, size}() macros
These macros are useful for converting the endianness of variables of
type fdt_addr_t and fdt_size_t.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'include/fdtdec.h')
-rw-r--r-- | include/fdtdec.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h index ad00f79f20..be34dca756 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -27,11 +27,15 @@ typedef phys_size_t fdt_size_t; #define FDT_ADDR_T_NONE (-1U) #define fdt_addr_to_cpu(reg) be64_to_cpu(reg) #define fdt_size_to_cpu(reg) be64_to_cpu(reg) +#define cpu_to_fdt_addr(reg) cpu_to_be64(reg) +#define cpu_to_fdt_size(reg) cpu_to_be64(reg) typedef fdt64_t fdt_val_t; #else #define FDT_ADDR_T_NONE (-1U) #define fdt_addr_to_cpu(reg) be32_to_cpu(reg) #define fdt_size_to_cpu(reg) be32_to_cpu(reg) +#define cpu_to_fdt_addr(reg) cpu_to_be32(reg) +#define cpu_to_fdt_size(reg) cpu_to_be32(reg) typedef fdt32_t fdt_val_t; #endif |