UPSTREAM: 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.

Change-Id: I6f5ea1067cd3ada1c8ece0c39b7bf43382c58ff6
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Masahiro Yamada 2018-01-21 19:19:18 +09:00 committed by Kever Yang
parent c78841b69b
commit fbedfcfba2
2 changed files with 6 additions and 25 deletions

View File

@ -1,24 +1,5 @@
/* #ifdef USE_HOSTCC
* libfdt - Flat Device Tree manipulation (build/run environment adaptation) #include "../scripts/dtc/libfdt/libfdt_env.h"
* Copyright (C) 2007 Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com #else
* Original version written by David Gibson, IBM Corporation. #include <linux/libfdt_env.h>
* #endif
* 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 */

View File

@ -253,7 +253,7 @@ endif # !LOGO_BMP
# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
# Define _GNU_SOURCE to obtain the getline prototype from stdio.h # Define _GNU_SOURCE to obtain the getline prototype from stdio.h
# #
HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \
$(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \ $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
-I$(srctree)/lib/libfdt \ -I$(srctree)/lib/libfdt \
-I$(srctree)/tools \ -I$(srctree)/tools \