[U-Boot] [PATCH 0/8] 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.
Stephen Warren (8): 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 + 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 - doc/README.fdt-control | 3 +-- dts/Makefile | 25 +++++++++------------ include/configs/exynos5250-dt.h | 1 - include/configs/microblaze-generic.h | 2 +- 15 files changed, 16 insertions(+), 112 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

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 --- .../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

On Mon, Jun 10, 2013 at 4:16 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
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

On 06/19/2013 10:36 PM, Simon Glass wrote:
On Mon, Jun 10, 2013 at 4:16 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
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
M

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.
Signed-off-by: Stephen Warren swarren@nvidia.com --- .gitignore | 1 + dts/Makefile | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/.gitignore b/.gitignore index 4116448..be9abd6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ *.patch *.bin *.cfgtmp +*.dtstmp
# Build tree /build-* diff --git a/dts/Makefile b/dts/Makefile index 03e163e..4d81d79 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).dtstmp + $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
process_lds = \ $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'

Hi Stephen,
On Mon, Jun 10, 2013 at 4:16 PM, 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.
Signed-off-by: Stephen Warren swarren@nvidia.com
.gitignore | 1 + dts/Makefile | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/.gitignore b/.gitignore index 4116448..be9abd6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ *.patch *.bin *.cfgtmp +*.dtstmp
# Build tree /build-* diff --git a/dts/Makefile b/dts/Makefile index 03e163e..4d81d79 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).dtstmp
$(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
When you get an error here, will dtc report a bogus filename? Or will the CPP line information deal with that> - iwc please add a comment to the commit message.
process_lds = \ $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p' -- 1.8.1.5
Regards, Simon

On 06/19/2013 02:37 PM, Simon Glass wrote:
Hi Stephen,
On Mon, Jun 10, 2013 at 4:16 PM, Stephen Warren <swarren@wwwdotorg.org mailto:swarren@wwwdotorg.org> wrote:
...
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.
...
diff --git a/.gitignore b/.gitignore
...
$(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
...
+ $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dtstmp + $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
When you get an error here, will dtc report a bogus filename? Or will the CPP line information deal with that> - iwc please add a comment to the commit message.
Added this to commit description:
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.
(note the patch that refers to will be new in v2 of the series).

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 --- dts/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dts/Makefile b/dts/Makefile index 4d81d79..ec89f8b 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).dtstmp - $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp + $(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
process_lds = \ $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'

Hi Stephen,
On Mon, Jun 10, 2013 at 4:16 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
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 4d81d79..ec89f8b 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -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).dtstmp
$(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
$(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
.dts.tmp perhaps?
process_lds = \ $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p' -- 1.8.1.5
Regards, Simon

On 06/19/2013 02:51 PM, Simon Glass wrote:
Hi Stephen,
On Mon, Jun 10, 2013 at 4:16 PM, Stephen Warren <swarren@wwwdotorg.org mailto:swarren@wwwdotorg.org> wrote:
From: Stephen Warren <swarren@nvidia.com <mailto: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.
$(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dtstmp - $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp + $(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
.dts.tmp perhaps?
I chose dtstmp to match *.cfgtmp which I found in .gitignore. Still, I have no idea what those files are, so there's probably no reason to be consistent with them. I can change this if you want (in patch 2/8).

On Wed, Jun 19, 2013 at 1:56 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
On 06/19/2013 02:51 PM, Simon Glass wrote:
Hi Stephen,
On Mon, Jun 10, 2013 at 4:16 PM, Stephen Warren <swarren@wwwdotorg.org mailto:swarren@wwwdotorg.org> wrote:
From: Stephen Warren <swarren@nvidia.com <mailto: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.
$(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dtstmp - $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp + $(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
.dts.tmp perhaps?
I chose dtstmp to match *.cfgtmp which I found in .gitignore. Still, I have no idea what those files are, so there's probably no reason to be consistent with them. I can change this if you want (in patch 2/8).
OK thanks.
Regards, Simon

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 --- 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";

On Mon, Jun 10, 2013 at 4:17 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
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

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 --- dts/Makefile | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/dts/Makefile b/dts/Makefile index ec89f8b..f1dad07 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 \

On Mon, Jun 10, 2013 at 4:17 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
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

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 --- 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

Hi,
I think we can wait some more time to mature the fdt support on u-boot, as not many boards were using this future. may be I am also incorrect.
And need to remove the CONFIG_ARCH_DEVICE_TREE references in dts/Makefile to for working this.
-- Thanks, Jagan.
On Tue, Jun 11, 2013 at 4:47 AM, Stephen Warren swarren@wwwdotorg.org wrote:
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
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
-- 1.8.1.5
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

On 06/11/2013 12:52 AM, Jagan Teki wrote:
Hi,
I think we can wait some more time to mature the fdt support on u-boot, as not many boards were using this future. may be I am also incorrect.
Sorry, I don't understand what this means.
And need to remove the CONFIG_ARCH_DEVICE_TREE references in dts/Makefile to for working this.
That's what patch 5/8 does.

On Mon, Jun 10, 2013 at 4:17 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
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

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 --- dts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dts/Makefile b/dts/Makefile index f1dad07..b9add54 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).dtstmp + $(CPP) $(DTS_CPPFLAGS) $< -o $(DT_BIN).dtstmp $(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dtstmp
process_lds = \

On Mon, Jun 10, 2013 at 4:17 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
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

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 --- dts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dts/Makefile b/dts/Makefile index b9add54..f01258a 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 10, 2013 at 4:17 PM, Stephen Warren swarren@wwwdotorg.orgwrote:
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
This series looks good and I'm pleased that it seems we are now able to drop support for the older dtc. It is slightly concerning that there has been no new dtc release for so long, but we should try to minimise the pain caused to U-Boot.
We have local patches which enable building multiple .dts files as the kernel does. Once this lands we can perhaps send out a patch or two for that.
Regards, Simon

On Mon, Jun 10, 2013 at 05:16:56PM -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.
Please add a dtc-version Makefile variable and corresponding tools/dtc-version.sh script, ala gcc/binutils so that we can error out gracefully if dtc isn't supporting the options we need.

On 06/11/2013 10:19 AM, Tom Rini wrote:
On Mon, Jun 10, 2013 at 05:16:56PM -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.
Please add a dtc-version Makefile variable and corresponding tools/dtc-version.sh script, ala gcc/binutils so that we can error out gracefully if dtc isn't supporting the options we need.
Hmm. dtc doesn't really seem to do releases. Hence, there's no version number available to check for here:-( (i.e. the features this series rely on were added after 1.3.0, which is the most recent, but quite old, tagged release).
I suppose I could ping them yet again on tagging a release...

On Tue, Jun 11, 2013 at 10:36:14AM -0600, Stephen Warren wrote:
On 06/11/2013 10:19 AM, Tom Rini wrote:
On Mon, Jun 10, 2013 at 05:16:56PM -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.
Please add a dtc-version Makefile variable and corresponding tools/dtc-version.sh script, ala gcc/binutils so that we can error out gracefully if dtc isn't supporting the options we need.
Hmm. dtc doesn't really seem to do releases. Hence, there's no version number available to check for here:-( (i.e. the features this series rely on were added after 1.3.0, which is the most recent, but quite old, tagged release).
I suppose I could ping them yet again on tagging a release...
Yeah, I can imagine a release might also help encourage distributions to update...

On Tue, Jun 11, 2013 at 12:19:52PM -0400, Tom Rini wrote:
On Mon, Jun 10, 2013 at 05:16:56PM -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.
Please add a dtc-version Makefile variable and corresponding tools/dtc-version.sh script, ala gcc/binutils so that we can error out gracefully if dtc isn't supporting the options we need.
For clarity, we need some sort of graceful error-out, be it version check or flag-is-supported check. I fear this is going to lead to a lot of people not being able to compile and I'd like to be able to give a clear error message.

On 06/19/2013 06:46 AM, Tom Rini wrote:
On Tue, Jun 11, 2013 at 12:19:52PM -0400, Tom Rini wrote:
On Mon, Jun 10, 2013 at 05:16:56PM -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.
Please add a dtc-version Makefile variable and corresponding tools/dtc-version.sh script, ala gcc/binutils so that we can error out gracefully if dtc isn't supporting the options we need.
For clarity, we need some sort of graceful error-out, be it version check or flag-is-supported check. I fear this is going to lead to a lot of people not being able to compile and I'd like to be able to give a clear error message.
I've implemented this check and have the patches ready. I'm just waiting for a dtc release that has all the required features, so that there actually is a version number the code can check for.
It sounds like there's agreement to make the dtc release by the end of this week, unless anyone comes forward and objects, and they haven't yet:-)

On Wed, Jun 19, 2013 at 09:38:17AM -0600, Stephen Warren wrote:
On 06/19/2013 06:46 AM, Tom Rini wrote:
On Tue, Jun 11, 2013 at 12:19:52PM -0400, Tom Rini wrote:
On Mon, Jun 10, 2013 at 05:16:56PM -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.
Please add a dtc-version Makefile variable and corresponding tools/dtc-version.sh script, ala gcc/binutils so that we can error out gracefully if dtc isn't supporting the options we need.
For clarity, we need some sort of graceful error-out, be it version check or flag-is-supported check. I fear this is going to lead to a lot of people not being able to compile and I'd like to be able to give a clear error message.
I've implemented this check and have the patches ready. I'm just waiting for a dtc release that has all the required features, so that there actually is a version number the code can check for.
It sounds like there's agreement to make the dtc release by the end of this week, unless anyone comes forward and objects, and they haven't yet:-)
Sounds good to me, thanks!
participants (5)
-
Jagan Teki
-
Michal Simek
-
Simon Glass
-
Stephen Warren
-
Tom Rini