blob: 0d209a64928664f4c30ff2f6fd26aa475fb82550 [file] [log] [blame]
Masahiro Yamadab08c8c42018-03-05 01:20:11 +09001#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 */
Masahiro Yamada50a327d2017-10-17 22:30:20 +09009#ifndef _LIBFDT_ENV_H
10#define _LIBFDT_ENV_H
11
12#include <linux/string.h>
13
14#include <asm/byteorder.h>
15
16typedef __be16 fdt16_t;
17typedef __be32 fdt32_t;
18typedef __be64 fdt64_t;
19
20#define fdt32_to_cpu(x) be32_to_cpu(x)
21#define cpu_to_fdt32(x) cpu_to_be32(x)
22#define fdt64_to_cpu(x) be64_to_cpu(x)
23#define cpu_to_fdt64(x) cpu_to_be64(x)
24
25/* U-Boot: for strtoul in fdt_overlay.c */
26#include <vsprintf.h>
27
28#define strtoul(cp, endp, base) simple_strtoul(cp, endp, base)
29
30#endif /* _LIBFDT_ENV_H */
Masahiro Yamadab08c8c42018-03-05 01:20:11 +090031#endif