diff --git a/tools/Makefile b/tools/Makefile index 2b87e184f3..acbcd87af2 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -58,12 +58,17 @@ hostprogs-y += dumpimage mkimage hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o -# Flattened device tree objects -LIBFDT_CSRCS := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c \ - fdt_empty_tree.c fdt_addresses.c fdt_overlay.c \ - fdt_region.c -LIBFDT_OBJS := $(addprefix lib/libfdt/, $(patsubst %.c, %.o, $(LIBFDT_CSRCS))) +# The following files are synced with upstream DTC. +# Use synced versions from scripts/dtc/libfdt/. +LIBFDT_SRCS_SYNCED := fdt.c fdt_sw.c fdt_strerror.c fdt_empty_tree.c \ + fdt_addresses.c fdt_overlay.c +# The following files are locally modified for U-Boot (unfotunately). +# Use U-Boot own versions from lib/libfdt/. +LIBFDT_SRCS_UNSYNCED := fdt_ro.c fdt_wip.c fdt_rw.c fdt_region.c + +LIBFDT_OBJS := $(addprefix libfdt/, $(patsubst %.c, %.o, $(LIBFDT_SRCS_SYNCED))) \ + $(addprefix lib/libfdt/, $(patsubst %.c, %.o, $(LIBFDT_SRCS_UNSYNCED))) RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \ rsa-sign.o rsa-verify.o rsa-checksum.o \ diff --git a/tools/libfdt/fdt.c b/tools/libfdt/fdt.c new file mode 100644 index 0000000000..8ba8091921 --- /dev/null +++ b/tools/libfdt/fdt.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt.c" diff --git a/tools/libfdt/fdt_addresses.c b/tools/libfdt/fdt_addresses.c new file mode 100644 index 0000000000..242a2c083b --- /dev/null +++ b/tools/libfdt/fdt_addresses.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_addresses.c" diff --git a/tools/libfdt/fdt_empty_tree.c b/tools/libfdt/fdt_empty_tree.c new file mode 100644 index 0000000000..9ccbb1f94e --- /dev/null +++ b/tools/libfdt/fdt_empty_tree.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_empty_tree.c" diff --git a/tools/libfdt/fdt_overlay.c b/tools/libfdt/fdt_overlay.c new file mode 100644 index 0000000000..801ec374b1 --- /dev/null +++ b/tools/libfdt/fdt_overlay.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_overlay.c" diff --git a/tools/libfdt/fdt_strerror.c b/tools/libfdt/fdt_strerror.c new file mode 100644 index 0000000000..d7ed70bea4 --- /dev/null +++ b/tools/libfdt/fdt_strerror.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_strerror.c" diff --git a/tools/libfdt/fdt_sw.c b/tools/libfdt/fdt_sw.c new file mode 100644 index 0000000000..ed6b327573 --- /dev/null +++ b/tools/libfdt/fdt_sw.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_sw.c"