[U-Boot] [PATCH V2 0/9] rely on latest dtc, simplify

From: Stephen Warren swarren@nvidia.com
This is a series of patches which simplifies the rules to build *.dts in U-Boot by relying on features in the latest dtc. The include rules are made more consistent between cpp (when processing *.dts) and dtc. The cpp flags are made more consistent with the way the kernel processes *.dts to allow better portability of *.dts between the two.
I'm sending V2 now that dtc-1.4.0 has been tagged/released, and hence there's a version number that patch 1/9 "Validate dtc is new enough" can check for. I'll leave it up to you whether this series is applicable for the current or next release.
Stephen Warren (9): Validate dtc is new enough xilinx: move microblaze-generic .dts to standard location dts/Makefile: simplify dtc invocation dts/Makefile: unify cpp/dtc include paths dt: don't use ARCH_CPU_DTS dts/Makefile: don't define ARCH_CPU_DTS, BOARD_DTS config: don't define CONFIG_ARCH_DEVICE_TREE dts/Makefile: don't use cpp -P dts/Makefile: pass -undef -D__DTS__ to cpp
.gitignore | 1 + Makefile | 8 ++++++- arch/arm/cpu/armv7/tegra114/config.mk | 19 ---------------- arch/arm/cpu/armv7/tegra20/config.mk | 26 ---------------------- arch/arm/cpu/armv7/tegra30/config.mk | 19 ---------------- arch/microblaze/config.mk | 2 -- arch/x86/cpu/coreboot/config.mk | 23 ------------------- board/chromebook-x86/dts/link.dts | 2 +- board/samsung/dts/exynos5250-smdk5250.dts | 2 +- board/samsung/dts/exynos5250-snow.dts | 2 +- .../microblaze.dts => dts/microblaze-generic.dts} | 0 board/xilinx/dts/microblaze.dts | 1 - config.mk | 1 + doc/README.fdt-control | 3 +-- dts/Makefile | 25 +++++++++------------ include/configs/exynos5250-dt.h | 1 - include/configs/microblaze-generic.h | 2 +- tools/dtc-version.sh | 20 +++++++++++++++++ 18 files changed, 44 insertions(+), 113 deletions(-) delete mode 100644 arch/arm/cpu/armv7/tegra114/config.mk delete mode 100644 arch/arm/cpu/armv7/tegra20/config.mk delete mode 100644 arch/arm/cpu/armv7/tegra30/config.mk delete mode 100644 arch/x86/cpu/coreboot/config.mk rename board/xilinx/{microblaze-generic/dts/microblaze.dts => dts/microblaze-generic.dts} (100%) delete mode 100644 board/xilinx/dts/microblaze.dts create mode 100755 tools/dtc-version.sh

From: Stephen Warren swarren@nvidia.com
Subsequent patches assume that dtc supports various recent features. These are available in dtc 1.4.0. Validate that dtc is at least that version.
Signed-off-by: Stephen Warren swarren@nvidia.com --- v2: New patch. --- Makefile | 8 +++++++- config.mk | 1 + tools/dtc-version.sh | 20 ++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 tools/dtc-version.sh
diff --git a/Makefile b/Makefile index 50880c9..f167458 100644 --- a/Makefile +++ b/Makefile @@ -428,7 +428,7 @@ endif
all: $(ALL-y) $(SUBDIR_EXAMPLES)
-$(obj)u-boot.dtb: $(obj)u-boot +$(obj)u-boot.dtb: checkdtc $(obj)u-boot $(MAKE) -C dts binary mv $(obj)dts/dt.dtb $@
@@ -686,6 +686,12 @@ checkgcc4: false; \ fi
+checkdtc: + @if test $(call dtc-version) -lt 0104; then \ + echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer'; \ + false; \ + fi + # # Auto-generate the autoconf.mk file (which is included by all makefiles) # diff --git a/config.mk b/config.mk index 6e17ed8..32643ec 100644 --- a/config.mk +++ b/config.mk @@ -136,6 +136,7 @@ endif # Usage gcc-ver := $(call cc-version) cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC)) binutils-version = $(shell $(SHELL) $(SRCTREE)/tools/binutils-version.sh $(AS)) +dtc-version = $(shell $(SHELL) $(SRCTREE)/tools/dtc-version.sh $(DTC))
# # Include the make variables (CC, etc...) diff --git a/tools/dtc-version.sh b/tools/dtc-version.sh new file mode 100755 index 0000000..e8c94d3 --- /dev/null +++ b/tools/dtc-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# dtc-version dtc-command +# +# Prints the dtc version of `dtc-command' in a canonical 4-digit form +# such as `0222' for binutils 2.22 +# + +dtc="$*" + +if [ ${#dtc} -eq 0 ]; then + echo "Error: No dtc command specified." + printf "Usage:\n\t$0 <dtc-command>\n" + exit 1 +fi + +MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1) +MINOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 2) + +printf "%02d%02d\n" $MAJOR $MINOR

Hi Stephen,
On Mon, Jun 24, 2013 at 8:43 AM, Stephen Warren swarren@wwwdotorg.orgwrote:
From: Stephen Warren swarren@nvidia.com
Subsequent patches assume that dtc supports various recent features. These are available in dtc 1.4.0. Validate that dtc is at least that version.
Signed-off-by: Stephen Warren swarren@nvidia.com
v2: New patch.
Acked-by: Simon Glass sjg@chromium.org
See note below.
Makefile | 8 +++++++- config.mk | 1 + tools/dtc-version.sh | 20 ++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 tools/dtc-version.sh
diff --git a/Makefile b/Makefile index 50880c9..f167458 100644 --- a/Makefile +++ b/Makefile @@ -428,7 +428,7 @@ endif
all: $(ALL-y) $(SUBDIR_EXAMPLES)
-$(obj)u-boot.dtb: $(obj)u-boot +$(obj)u-boot.dtb: checkdtc $(obj)u-boot
Any reason this is not in dts/Makefile? Still this is fine.
$(MAKE) -C dts binary mv $(obj)dts/dt.dtb $@
@@ -686,6 +686,12 @@ checkgcc4: false; \ fi
+checkdtc:
@if test $(call dtc-version) -lt 0104; then \
echo '*** Your dtc is too old, please upgrade to dtc 1.4
or newer'; \
false; \
fi
# # Auto-generate the autoconf.mk file (which is included by all makefiles) # diff --git a/config.mk b/config.mk index 6e17ed8..32643ec 100644 --- a/config.mk +++ b/config.mk @@ -136,6 +136,7 @@ endif # Usage gcc-ver := $(call cc-version) cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC)) binutils-version = $(shell $(SHELL) $(SRCTREE)/tools/binutils-version.sh $(AS)) +dtc-version = $(shell $(SHELL) $(SRCTREE)/tools/dtc-version.sh $(DTC))
# # Include the make variables (CC, etc...) diff --git a/tools/dtc-version.sh b/tools/dtc-version.sh new file mode 100755 index 0000000..e8c94d3 --- /dev/null +++ b/tools/dtc-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# dtc-version dtc-command +# +# Prints the dtc version of `dtc-command' in a canonical 4-digit form +# such as `0222' for binutils 2.22 +#
+dtc="$*"
+if [ ${#dtc} -eq 0 ]; then
echo "Error: No dtc command specified."
printf "Usage:\n\t$0 <dtc-command>\n"
exit 1
+fi
+MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1) +MINOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 2)
+printf "%02d%02d\n" $MAJOR $MINOR
1.8.1.5

On 06/24/2013 06:45 PM, Simon Glass wrote:
Hi Stephen,
On Mon, Jun 24, 2013 at 8:43 AM, Stephen Warren <swarren@wwwdotorg.org mailto:swarren@wwwdotorg.org> wrote:
From: Stephen Warren <swarren@nvidia.com <mailto:swarren@nvidia.com>> Subsequent patches assume that dtc supports various recent features. These are available in dtc 1.4.0. Validate that dtc is at least that version.
Acked-by: Simon Glass <sjg@chromium.org mailto:sjg@chromium.org>
See note below.
diff --git a/Makefile b/Makefile
-$(obj)u-boot.dtb: $(obj)u-boot +$(obj)u-boot.dtb: checkdtc $(obj)u-boot
Any reason this is not in dts/Makefile? Still this is fine.
I guess that would have worked too. One advantage of the current placement is that make just happens to evaluate the rule really early (at least with more than -j1!), so you don't build a lot before it errors out, thus giving you quicker feedback. It also keeps all the tool version checks in one file; perhaps easier maintenance?

Hi Stephen,
On Tue, Jun 25, 2013 at 7:47 AM, Stephen Warren swarren@wwwdotorg.orgwrote:
On 06/24/2013 06:45 PM, Simon Glass wrote:
Hi Stephen,
On Mon, Jun 24, 2013 at 8:43 AM, Stephen Warren <swarren@wwwdotorg.org mailto:swarren@wwwdotorg.org> wrote:
From: Stephen Warren <swarren@nvidia.com <mailto:swarren@nvidia.com
Subsequent patches assume that dtc supports various recent features. These are available in dtc 1.4.0. Validate that dtc is at least that version.
Acked-by: Simon Glass <sjg@chromium.org mailto:sjg@chromium.org>
See note below.
diff --git a/Makefile b/Makefile
-$(obj)u-boot.dtb: $(obj)u-boot +$(obj)u-boot.dtb: checkdtc $(obj)u-boot
Any reason this is not in dts/Makefile? Still this is fine.
I guess that would have worked too. One advantage of the current placement is that make just happens to evaluate the rule really early (at least with more than -j1!), so you don't build a lot before it errors out, thus giving you quicker feedback. It also keeps all the tool version checks in one file; perhaps easier maintenance?
Sounds good to me.
Regards, Simon

On Mon, Jun 24, 2013 at 09:43 -0600, Stephen Warren wrote:
+checkdtc:
- @if test $(call dtc-version) -lt 0104; then \
echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer'; \
false; \
- fi
... and ...
--- /dev/null +++ b/tools/dtc-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# dtc-version dtc-command +# +# Prints the dtc version of `dtc-command' in a canonical 4-digit form +# such as `0222' for binutils 2.22 +#
So the numbers get converted to something that's neatly aligned and free of whitespace and can get sorted alphabetically.
But the numbers get passed to $SHELL and the builtin test(1) command, and get compared numerically ('-lt' operator).
Does that mean that the test break with digits beyond seven, when numbers no longer can get interpreted as valid octal numbers?
virtually yours Gerhard Sittig

On 06/25/2013 11:22 AM, Gerhard Sittig wrote:
On Mon, Jun 24, 2013 at 09:43 -0600, Stephen Warren wrote:
+checkdtc:
- @if test $(call dtc-version) -lt 0104; then \
echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer'; \
false; \
- fi
... and ...
--- /dev/null +++ b/tools/dtc-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# dtc-version dtc-command +# +# Prints the dtc version of `dtc-command' in a canonical 4-digit form +# such as `0222' for binutils 2.22 +#
So the numbers get converted to something that's neatly aligned and free of whitespace and can get sorted alphabetically.
But the numbers get passed to $SHELL and the builtin test(1) command, and get compared numerically ('-lt' operator).
Does that mean that the test break with digits beyond seven, when numbers no longer can get interpreted as valid octal numbers?
I'm pretty sure sh treats the numbers as decimal. Testing appears to support this:
[swarren@swarren-lx1 kernel.git]$ if [ 0104 -lt 0104 ]; then echo yes; else echo no; fi no
[swarren@swarren-lx1 kernel.git]$ if [ 0103 -lt 0104 ]; then echo yes; else echo no; fi yes
[swarren@swarren-lx1 kernel.git]$ if [ 0803 -lt 0104 ]; then echo yes; else echo no; fi no
[swarren@swarren-lx1 kernel.git]$ if [ 0802 -lt 0804 ]; then echo yes; else echo no; fi yes
[swarren@swarren-lx1 kernel.git]$ if [ 0804 -lt 0804 ]; then echo yes; else echo no; fi no
[swarren@swarren-lx1 kernel.git]$ if [ 0806 -lt 0804 ]; then echo yes; else echo no; fi no

From: Stephen Warren swarren@nvidia.com
Aside from microblaze, all other SoCs/boards/vendors store their DT files in board/$vendor/dts/$soc-$board.dts. Move microblaze-generic.dts to this location for consistency.
Signed-off-by: Stephen Warren swarren@nvidia.com Acked-by: Simon Glass sjg@chromium.org Acked-by: Michal Simek monstr@monstr.eu --- .../dts/microblaze.dts => dts/microblaze-generic.dts} | 0 board/xilinx/dts/microblaze.dts | 1 - include/configs/microblaze-generic.h | 2 +- 3 files changed, 1 insertion(+), 2 deletions(-) rename board/xilinx/{microblaze-generic/dts/microblaze.dts => dts/microblaze-generic.dts} (100%) delete mode 100644 board/xilinx/dts/microblaze.dts
diff --git a/board/xilinx/microblaze-generic/dts/microblaze.dts b/board/xilinx/dts/microblaze-generic.dts similarity index 100% rename from board/xilinx/microblaze-generic/dts/microblaze.dts rename to board/xilinx/dts/microblaze-generic.dts diff --git a/board/xilinx/dts/microblaze.dts b/board/xilinx/dts/microblaze.dts deleted file mode 100644 index bf984b0..0000000 --- a/board/xilinx/dts/microblaze.dts +++ /dev/null @@ -1 +0,0 @@ -/include/ BOARD_DTS diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 17f53ba..ad91d21 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -34,7 +34,7 @@ /* Open Firmware DTS */ #define CONFIG_OF_CONTROL 1 #define CONFIG_OF_EMBED 1 -#define CONFIG_DEFAULT_DEVICE_TREE microblaze +#define CONFIG_DEFAULT_DEVICE_TREE microblaze-generic
/* linear and spi flash memory */ #ifdef XILINX_FLASH_START

From: Stephen Warren swarren@nvidia.com
The invocation of dtc is significantly more complex that it could be, in order to work around an issue on old versions of dtc, which print a message to stdout every time they run.
Remove this workaround, on the assumption that people have or will upgrade to a newer version of dtc. This simplifies the build rule significantly.
Related, split the invocation of cpp and dtc into separate commands rather than a pipeline, so that if either fail, it is detected. This has the nice benefit of saving off the result of the pre-processing step, allowing it to be easily inspected.
Assuming a new enough dtc (which an earlier patch enforces), dtc will parse #line directives in its input file, and generate correct file and line numbers in error messages, even though cpp is unconditionally applied to its input file.
Signed-off-by: Stephen Warren swarren@nvidia.com --- v2: * Added note to commit description re: line numbers. * s/.dtstmp/dts.tmp/ in temporary filenames. --- .gitignore | 1 + dts/Makefile | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/.gitignore b/.gitignore index 4116448..7aa4adc 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ *.patch *.bin *.cfgtmp +*.dts.tmp
# Build tree /build-* diff --git a/dts/Makefile b/dts/Makefile index 03e163e..722cc37 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -51,13 +51,8 @@ all: $(obj).depend $(LIB) DT_BIN := $(obj)dt.dtb
$(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts - rc=$$( \ - cat $< | $(CPP) -P $(DTS_CPPFLAGS) - | \ - { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \ - echo $$? >&3 ; } | \ - grep -v '^DTC: dts->dtb on file' ; \ - } 3>&1 1>&2 ) ; \ - exit $$rc + $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp + $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
process_lds = \ $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'

On Mon, Jun 24, 2013 at 8:43 AM, Stephen Warren swarren@wwwdotorg.orgwrote:
From: Stephen Warren swarren@nvidia.com The invocation of dtc is significantly more complex that it could be, in order to work around an issue on old versions of dtc, which print a message to stdout every time they run.
Remove this workaround, on the assumption that people have or will upgrade to a newer version of dtc. This simplifies the build rule significantly.
Related, split the invocation of cpp and dtc into separate commands rather than a pipeline, so that if either fail, it is detected. This has the nice benefit of saving off the result of the pre-processing step, allowing it to be easily inspected.
Assuming a new enough dtc (which an earlier patch enforces), dtc will parse #line directives in its input file, and generate correct file and line numbers in error messages, even though cpp is unconditionally applied to its input file.
Signed-off-by: Stephen Warren swarren@nvidia.com
Acked-by: Simon Glass sjg@chromium.org

From: Stephen Warren swarren@nvidia.com
*.dts may use #include (via cpp) or /include/ (via dtc; assuming a newer dtc). The choice is up to the creator of the DT. Create a common variable DTC_INCDIRS that lists the paths searched by include statements, and update cpp and dtc invocation to use them.
For cpp, also specify -nostdinc to ensure the same set of paths is available to both type of include statement.
For dtc, create a new DTC_FLAGS variable to hold all the flags passed to dtc.
Signed-off-by: Stephen Warren swarren@nvidia.com Acked-by: Simon Glass sjg@chromium.org --- dts/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dts/Makefile b/dts/Makefile index 722cc37..ce774e0 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -37,11 +37,18 @@ $(if $(CONFIG_ARCH_DEVICE_TREE),,\ $(error Your architecture does not have device tree support enabled. \ Please define CONFIG_ARCH_DEVICE_TREE))
+DTS_INCDIRS = $(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts +DTS_INCDIRS += $(SRCTREE)/board/$(VENDOR)/dts +DTS_INCDIRS += $(SRCTREE)/arch/$(ARCH)/dts + # We preprocess the device tree file provide a useful define DTS_CPPFLAGS := -x assembler-with-cpp \ -DARCH_CPU_DTS="$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi" \ -DBOARD_DTS="$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts" \ - -I$(SRCTREE)/board/$(VENDOR)/dts -I$(SRCTREE)/arch/$(ARCH)/dts + -nostdinc $(addprefix -I,$(DTS_INCDIRS)) + +DTC_FLAGS := -R 4 -p 0x1000 \ + $(addprefix -i ,$(DTS_INCDIRS))
all: $(obj).depend $(LIB)
@@ -52,7 +59,7 @@ DT_BIN := $(obj)dt.dtb
$(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp - $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp + $(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
process_lds = \ $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'

From: Stephen Warren swarren@nvidia.com
Now that we assume dtc supports the -i option, we don't need to use ARCH_CPU_DTS in *.dts{,i}; we simply specify the include filename directly, and dtc will find it.
Signed-off-by: Stephen Warren swarren@nvidia.com Acked-by: Simon Glass sjg@chromium.org --- board/chromebook-x86/dts/link.dts | 2 +- board/samsung/dts/exynos5250-smdk5250.dts | 2 +- board/samsung/dts/exynos5250-snow.dts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/board/chromebook-x86/dts/link.dts b/board/chromebook-x86/dts/link.dts index d0738cb..c95ee8a 100644 --- a/board/chromebook-x86/dts/link.dts +++ b/board/chromebook-x86/dts/link.dts @@ -1,6 +1,6 @@ /dts-v1/;
-/include/ ARCH_CPU_DTS +/include/ "coreboot.dtsi"
/ { #address-cells = <1>; diff --git a/board/samsung/dts/exynos5250-smdk5250.dts b/board/samsung/dts/exynos5250-smdk5250.dts index 8da973b..538b820 100644 --- a/board/samsung/dts/exynos5250-smdk5250.dts +++ b/board/samsung/dts/exynos5250-smdk5250.dts @@ -10,7 +10,7 @@ */
/dts-v1/; -/include/ ARCH_CPU_DTS +/include/ "exynos5250.dtsi"
/ { model = "SAMSUNG SMDK5250 board based on EXYNOS5250"; diff --git a/board/samsung/dts/exynos5250-snow.dts b/board/samsung/dts/exynos5250-snow.dts index 24658c1..30c22c9 100644 --- a/board/samsung/dts/exynos5250-snow.dts +++ b/board/samsung/dts/exynos5250-snow.dts @@ -10,7 +10,7 @@ */
/dts-v1/; -/include/ ARCH_CPU_DTS +/include/ "exynos5250.dtsi"
/ { model = "Google Snow";

From: Stephen Warren swarren@nvidia.com
Now that nothing uses the defines ARCH_CPU_DTS, BOARD_DTS, stop defining them.
Signed-off-by: Stephen Warren swarren@nvidia.com Acked-by: Simon Glass sjg@chromium.org --- dts/Makefile | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/dts/Makefile b/dts/Makefile index ce774e0..42ba42f 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -33,18 +33,11 @@ $(error Please define CONFIG_DEFAULT_DEVICE_TREE in your board header file)) DEVICE_TREE = $(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE)) endif
-$(if $(CONFIG_ARCH_DEVICE_TREE),,\ -$(error Your architecture does not have device tree support enabled. \ -Please define CONFIG_ARCH_DEVICE_TREE)) - DTS_INCDIRS = $(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts DTS_INCDIRS += $(SRCTREE)/board/$(VENDOR)/dts DTS_INCDIRS += $(SRCTREE)/arch/$(ARCH)/dts
-# We preprocess the device tree file provide a useful define DTS_CPPFLAGS := -x assembler-with-cpp \ - -DARCH_CPU_DTS="$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi" \ - -DBOARD_DTS="$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts" \ -nostdinc $(addprefix -I,$(DTS_INCDIRS))
DTC_FLAGS := -R 4 -p 0x1000 \

From: Stephen Warren swarren@nvidia.com
Now that nothing uses CONFIG_ARCH_DEVICE_TREE, stop defining it.
Signed-off-by: Stephen Warren swarren@nvidia.com Acked-by: Simon Glass sjg@chromium.org --- arch/arm/cpu/armv7/tegra114/config.mk | 19 ------------------- arch/arm/cpu/armv7/tegra20/config.mk | 26 -------------------------- arch/arm/cpu/armv7/tegra30/config.mk | 19 ------------------- arch/microblaze/config.mk | 2 -- arch/x86/cpu/coreboot/config.mk | 23 ----------------------- doc/README.fdt-control | 3 +-- include/configs/exynos5250-dt.h | 1 - 7 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 arch/arm/cpu/armv7/tegra114/config.mk delete mode 100644 arch/arm/cpu/armv7/tegra20/config.mk delete mode 100644 arch/arm/cpu/armv7/tegra30/config.mk delete mode 100644 arch/x86/cpu/coreboot/config.mk
diff --git a/arch/arm/cpu/armv7/tegra114/config.mk b/arch/arm/cpu/armv7/tegra114/config.mk deleted file mode 100644 index cb1a19d..0000000 --- a/arch/arm/cpu/armv7/tegra114/config.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved. -# -# (C) Copyright 2002 -# Gary Jennejohn, DENX Software Engineering, garyj@denx.de -# -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. -# -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -CONFIG_ARCH_DEVICE_TREE := tegra114 diff --git a/arch/arm/cpu/armv7/tegra20/config.mk b/arch/arm/cpu/armv7/tegra20/config.mk deleted file mode 100644 index 6432e75..0000000 --- a/arch/arm/cpu/armv7/tegra20/config.mk +++ /dev/null @@ -1,26 +0,0 @@ -# -# (C) Copyright 2010,2011 -# NVIDIA Corporation <www.nvidia.com> -# -# (C) Copyright 2002 -# Gary Jennejohn, DENX Software Engineering, garyj@denx.de -# -# See file CREDITS for list of people who contributed to this -# project. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA -# -CONFIG_ARCH_DEVICE_TREE := tegra20 diff --git a/arch/arm/cpu/armv7/tegra30/config.mk b/arch/arm/cpu/armv7/tegra30/config.mk deleted file mode 100644 index 719ca81..0000000 --- a/arch/arm/cpu/armv7/tegra30/config.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved. -# -# (C) Copyright 2002 -# Gary Jennejohn, DENX Software Engineering, garyj@denx.de -# -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. -# -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -CONFIG_ARCH_DEVICE_TREE := tegra30 diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk index b4935f0..aca79e2 100644 --- a/arch/microblaze/config.mk +++ b/arch/microblaze/config.mk @@ -31,5 +31,3 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds - -CONFIG_ARCH_DEVICE_TREE := microblaze diff --git a/arch/x86/cpu/coreboot/config.mk b/arch/x86/cpu/coreboot/config.mk deleted file mode 100644 index 4858fc3..0000000 --- a/arch/x86/cpu/coreboot/config.mk +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (c) 2012 The Chromium OS Authors. -# -# See file CREDITS for list of people who contributed to this -# project. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA -# - -CONFIG_ARCH_DEVICE_TREE := coreboot diff --git a/doc/README.fdt-control b/doc/README.fdt-control index 95a88a7..8512beb 100644 --- a/doc/README.fdt-control +++ b/doc/README.fdt-control @@ -135,8 +135,7 @@ file into board/<vendor>/dts/<name>.dts
This should include your CPU or SOC's device tree file, placed in -arch/<arch>/dts, and then make any adjustments required. The name of this -is CONFIG_ARCH_DEVICE_TREE.dts. +arch/<arch>/dts, and then make any adjustments required.
If CONFIG_OF_EMBED is defined, then it will be picked up and built into the U-Boot image (including u-boot.bin). diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h index 8a82892..a749c42 100644 --- a/include/configs/exynos5250-dt.h +++ b/include/configs/exynos5250-dt.h @@ -39,7 +39,6 @@ #define CONFIG_DISPLAY_BOARDINFO
/* Enable fdt support for Exynos5250 */ -#define CONFIG_ARCH_DEVICE_TREE exynos5250 #define CONFIG_OF_CONTROL #define CONFIG_OF_SEPARATE

From: Stephen Warren swarren@nvidia.com
Recent dtc supports #line directives in the input source code, and even uses them to generate useful line numbers in any messages it emits. Stop passing -P to cpp, since there's no need any more.
Signed-off-by: Stephen Warren swarren@nvidia.com Acked-by: Simon Glass sjg@chromium.org --- dts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dts/Makefile b/dts/Makefile index 42ba42f..805d2cc 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -51,7 +51,7 @@ all: $(obj).depend $(LIB) DT_BIN := $(obj)dt.dtb
$(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts - $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp + $(CPP) $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp $(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
process_lds = \

From: Stephen Warren swarren@nvidia.com
This brings U-Boot's cpp invocation into line with the way the Linux kernel invokes cpp on device trees. Consistency will be useful to ensure *.dts is portable between the two.
-undef also has the added advantage of not defining "linux", so DT property names such as "linux,keymap" don't get mangled.
Signed-off-by: Stephen Warren swarren@nvidia.com Acked-by: Simon Glass sjg@chromium.org --- dts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dts/Makefile b/dts/Makefile index 805d2cc..b125bd3 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -37,7 +37,7 @@ DTS_INCDIRS = $(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts DTS_INCDIRS += $(SRCTREE)/board/$(VENDOR)/dts DTS_INCDIRS += $(SRCTREE)/arch/$(ARCH)/dts
-DTS_CPPFLAGS := -x assembler-with-cpp \ +DTS_CPPFLAGS := -x assembler-with-cpp -undef -D__DTS__ \ -nostdinc $(addprefix -I,$(DTS_INCDIRS))
DTC_FLAGS := -R 4 -p 0x1000 \

On Mon, Jun 24, 2013 at 09:43:40AM -0600, Stephen Warren wrote:
From: Stephen Warren swarren@nvidia.com
This is a series of patches which simplifies the rules to build *.dts in U-Boot by relying on features in the latest dtc. The include rules are made more consistent between cpp (when processing *.dts) and dtc. The cpp flags are made more consistent with the way the kernel processes *.dts to allow better portability of *.dts between the two.
I'm sending V2 now that dtc-1.4.0 has been tagged/released, and hence there's a version number that patch 1/9 "Validate dtc is new enough" can check for. I'll leave it up to you whether this series is applicable for the current or next release.
OK, thanks. I'm going to hold this out of the upcoming release but spell out in the release notes that change is coming.

On 06/24/2013 08:43 AM, Stephen Warren wrote:
From: Stephen Warren swarren@nvidia.com
This is a series of patches which simplifies the rules to build *.dts in U-Boot by relying on features in the latest dtc. The include rules are made more consistent between cpp (when processing *.dts) and dtc. The cpp flags are made more consistent with the way the kernel processes *.dts to allow better portability of *.dts between the two.
I'm sending V2 now that dtc-1.4.0 has been tagged/released, and hence there's a version number that patch 1/9 "Validate dtc is new enough" can check for. I'll leave it up to you whether this series is applicable for the current or next release.
Tom,
Do you want me to repost this series now the release is out? I have at least picked up some acks locally.
Note that at least a couple of distros have already packaged the new version of dtc in their latest releases; see the links at:
https://bugs.launchpad.net/debian/+source/device-tree-compiler/+bug/1194183

On Tue, Jul 23, 2013 at 05:31:39PM -0700, Stephen Warren wrote:
On 06/24/2013 08:43 AM, Stephen Warren wrote:
From: Stephen Warren swarren@nvidia.com
This is a series of patches which simplifies the rules to build *.dts in U-Boot by relying on features in the latest dtc. The include rules are made more consistent between cpp (when processing *.dts) and dtc. The cpp flags are made more consistent with the way the kernel processes *.dts to allow better portability of *.dts between the two.
I'm sending V2 now that dtc-1.4.0 has been tagged/released, and hence there's a version number that patch 1/9 "Validate dtc is new enough" can check for. I'll leave it up to you whether this series is applicable for the current or next release.
Tom,
Do you want me to repost this series now the release is out? I have at least picked up some acks locally.
Yeah, lets do that to let the acks be picked up.
Note that at least a couple of distros have already packaged the new version of dtc in their latest releases; see the links at:
https://bugs.launchpad.net/debian/+source/device-tree-compiler/+bug/1194183
Good to see, thanks!
participants (5)
-
Gerhard Sittig
-
Simon Glass
-
Stephen Warren
-
Stephen Warren
-
Tom Rini