diff options
author | Rob Herring <robh@kernel.org> | 2015-04-29 17:02:30 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2015-04-29 18:17:17 -0400 |
commit | f1ec7187167ce225d2744b20a90afef5f10fd6cd (patch) | |
tree | 06c5e68c83eff9ed02a4b6eb400aa34e020cfbfa | |
parent | 695e9fdd20d3f75705bd89633ad3d3276450bce6 (diff) |
libfdt: add fdt type definitions
In preparation for libfdt/dtc update, add the new fdt specific types.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
-rw-r--r-- | arch/arm/boot/compressed/libfdt_env.h | 4 | ||||
-rw-r--r-- | arch/powerpc/boot/libfdt_env.h | 4 | ||||
-rw-r--r-- | arch/powerpc/boot/of.h | 2 | ||||
-rw-r--r-- | include/linux/libfdt_env.h | 4 |
4 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/boot/compressed/libfdt_env.h b/arch/arm/boot/compressed/libfdt_env.h index 1f4e71876b00..17ae0f3efac8 100644 --- a/arch/arm/boot/compressed/libfdt_env.h +++ b/arch/arm/boot/compressed/libfdt_env.h | |||
@@ -5,6 +5,10 @@ | |||
5 | #include <linux/string.h> | 5 | #include <linux/string.h> |
6 | #include <asm/byteorder.h> | 6 | #include <asm/byteorder.h> |
7 | 7 | ||
8 | typedef __be16 fdt16_t; | ||
9 | typedef __be32 fdt32_t; | ||
10 | typedef __be64 fdt64_t; | ||
11 | |||
8 | #define fdt16_to_cpu(x) be16_to_cpu(x) | 12 | #define fdt16_to_cpu(x) be16_to_cpu(x) |
9 | #define cpu_to_fdt16(x) cpu_to_be16(x) | 13 | #define cpu_to_fdt16(x) cpu_to_be16(x) |
10 | #define fdt32_to_cpu(x) be32_to_cpu(x) | 14 | #define fdt32_to_cpu(x) be32_to_cpu(x) |
diff --git a/arch/powerpc/boot/libfdt_env.h b/arch/powerpc/boot/libfdt_env.h index 8dcd744e5728..7e3789ea396b 100644 --- a/arch/powerpc/boot/libfdt_env.h +++ b/arch/powerpc/boot/libfdt_env.h | |||
@@ -10,6 +10,10 @@ typedef u32 uint32_t; | |||
10 | typedef u64 uint64_t; | 10 | typedef u64 uint64_t; |
11 | typedef unsigned long uintptr_t; | 11 | typedef unsigned long uintptr_t; |
12 | 12 | ||
13 | typedef __be16 fdt16_t; | ||
14 | typedef __be32 fdt32_t; | ||
15 | typedef __be64 fdt64_t; | ||
16 | |||
13 | #define fdt16_to_cpu(x) be16_to_cpu(x) | 17 | #define fdt16_to_cpu(x) be16_to_cpu(x) |
14 | #define cpu_to_fdt16(x) cpu_to_be16(x) | 18 | #define cpu_to_fdt16(x) cpu_to_be16(x) |
15 | #define fdt32_to_cpu(x) be32_to_cpu(x) | 19 | #define fdt32_to_cpu(x) be32_to_cpu(x) |
diff --git a/arch/powerpc/boot/of.h b/arch/powerpc/boot/of.h index 5603320dce07..53f8f27f94e4 100644 --- a/arch/powerpc/boot/of.h +++ b/arch/powerpc/boot/of.h | |||
@@ -21,7 +21,9 @@ int of_setprop(const void *phandle, const char *name, const void *buf, | |||
21 | /* Console functions */ | 21 | /* Console functions */ |
22 | void of_console_init(void); | 22 | void of_console_init(void); |
23 | 23 | ||
24 | typedef u16 __be16; | ||
24 | typedef u32 __be32; | 25 | typedef u32 __be32; |
26 | typedef u64 __be64; | ||
25 | 27 | ||
26 | #ifdef __LITTLE_ENDIAN__ | 28 | #ifdef __LITTLE_ENDIAN__ |
27 | #define cpu_to_be16(x) swab16(x) | 29 | #define cpu_to_be16(x) swab16(x) |
diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h index 01508c7b8c81..2a663c6bb428 100644 --- a/include/linux/libfdt_env.h +++ b/include/linux/libfdt_env.h | |||
@@ -5,6 +5,10 @@ | |||
5 | 5 | ||
6 | #include <asm/byteorder.h> | 6 | #include <asm/byteorder.h> |
7 | 7 | ||
8 | typedef __be16 fdt16_t; | ||
9 | typedef __be32 fdt32_t; | ||
10 | typedef __be64 fdt64_t; | ||
11 | |||
8 | #define fdt32_to_cpu(x) be32_to_cpu(x) | 12 | #define fdt32_to_cpu(x) be32_to_cpu(x) |
9 | #define cpu_to_fdt32(x) cpu_to_be32(x) | 13 | #define cpu_to_fdt32(x) cpu_to_be32(x) |
10 | #define fdt64_to_cpu(x) be64_to_cpu(x) | 14 | #define fdt64_to_cpu(x) be64_to_cpu(x) |