Masahiro Yamada | 75f82d0 | 2018-03-05 01:20:11 +0900 | [diff] [blame] | 1 | #ifdef USE_HOSTCC |
| 2 | #include "../scripts/dtc/libfdt/libfdt_env.h" |
| 3 | #else |
| 4 | /* |
| 5 | * This position of the include guard is intentional. |
| 6 | * Using the same guard name as that of scripts/dtc/libfdt/libfdt_env.h |
| 7 | * prevents it from being included. |
| 8 | */ |
Rob Herring | cd5f70d | 2018-05-19 14:13:53 +0200 | [diff] [blame] | 9 | #ifndef LIBFDT_ENV_H |
| 10 | #define LIBFDT_ENV_H |
Masahiro Yamada | 1d95082 | 2017-10-17 22:30:20 +0900 | [diff] [blame] | 11 | |
| 12 | #include <linux/string.h> |
Simon Glass | 89117ac | 2019-10-27 09:47:39 -0600 | [diff] [blame] | 13 | #include <linux/kernel.h> |
Masahiro Yamada | 1d95082 | 2017-10-17 22:30:20 +0900 | [diff] [blame] | 14 | |
| 15 | #include <asm/byteorder.h> |
| 16 | |
| 17 | typedef __be16 fdt16_t; |
| 18 | typedef __be32 fdt32_t; |
| 19 | typedef __be64 fdt64_t; |
Jean-Jacques Hiblot | 487f917 | 2019-10-22 10:05:22 +0200 | [diff] [blame] | 20 | typedef __be64 unaligned_fdt64_t __aligned(4); |
Masahiro Yamada | 1d95082 | 2017-10-17 22:30:20 +0900 | [diff] [blame] | 21 | |
| 22 | #define fdt32_to_cpu(x) be32_to_cpu(x) |
| 23 | #define cpu_to_fdt32(x) cpu_to_be32(x) |
| 24 | #define fdt64_to_cpu(x) be64_to_cpu(x) |
| 25 | #define cpu_to_fdt64(x) cpu_to_be64(x) |
| 26 | |
| 27 | /* U-Boot: for strtoul in fdt_overlay.c */ |
| 28 | #include <vsprintf.h> |
| 29 | |
| 30 | #define strtoul(cp, endp, base) simple_strtoul(cp, endp, base) |
| 31 | |
Rob Herring | cd5f70d | 2018-05-19 14:13:53 +0200 | [diff] [blame] | 32 | #endif /* LIBFDT_ENV_H */ |
Masahiro Yamada | 75f82d0 | 2018-03-05 01:20:11 +0900 | [diff] [blame] | 33 | #endif |