aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-01-21 19:19:18 +0900
committerTom Rini <trini@konsulko.com>2018-01-28 12:27:31 -0500
commit662282203ac535d98d523700bfdba09664b2225d (patch)
tree633aaac05f90519d382a1ac27ca3f35b5bc9ff41 /include
parent144fbea96952b4959d5a11f9ab61e0e645e9eb5b (diff)
downloadu-boot-662282203ac535d98d523700bfdba09664b2225d.zip
u-boot-662282203ac535d98d523700bfdba09664b2225d.tar.gz
u-boot-662282203ac535d98d523700bfdba09664b2225d.tar.bz2
libfdt: migrate include/libfdt_env.h to a wrapper
libfdt_env.h is supposed to provide system-dependent defines. scripts/dtc/libfdt/libfdt_env.h from upstream DTC is suitable for user-space, so we should use this for USE_HOSTCC case. For compiling U-Boot, we need to override such system-dependent defines, so use <linux/libfdt_env.h> imported from Linux. <libfdt.h> selects a proper one. Maybe, we should split header inclusion completely, but I do not want too many patches at one. I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/libfdt_env.h29
1 files changed, 5 insertions, 24 deletions
diff --git a/include/libfdt_env.h b/include/libfdt_env.h
index ea26979..d7e9d32 100644
--- a/include/libfdt_env.h
+++ b/include/libfdt_env.h
@@ -1,24 +1,5 @@
-/*
- * libfdt - Flat Device Tree manipulation (build/run environment adaptation)
- * Copyright (C) 2007 Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com
- * Original version written by David Gibson, IBM Corporation.
- *
- * SPDX-License-Identifier: LGPL-2.1+
- */
-
-#ifndef _LIBFDT_ENV_H
-#define _LIBFDT_ENV_H
-
-#include "compiler.h"
-#include "linux/types.h"
-
-typedef __be16 fdt16_t;
-typedef __be32 fdt32_t;
-typedef __be64 fdt64_t;
-
-#define fdt32_to_cpu(x) be32_to_cpu(x)
-#define cpu_to_fdt32(x) cpu_to_be32(x)
-#define fdt64_to_cpu(x) be64_to_cpu(x)
-#define cpu_to_fdt64(x) cpu_to_be64(x)
-
-#endif /* _LIBFDT_ENV_H */
+#ifdef USE_HOSTCC
+#include "../scripts/dtc/libfdt/libfdt_env.h"
+#else
+#include <linux/libfdt_env.h>
+#endif