All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/3] Simplify dts/Makefile and support multiple DTBs generation
@ 2014-02-04  9:38 Masahiro Yamada
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild Masahiro Yamada
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Masahiro Yamada @ 2014-02-04  9:38 UTC (permalink / raw)
  To: u-boot

1/3 re-writes dts/Makefile more simply.
It does not change the behavior except removal of ./u-boot.dts

2/3 moves *.dts from board/$(VENDOR)/dts to arch/$(ARCH)/dts

3/3 adds multipe DTBs generation


This patch uses my Kbuild series as a prerequisite.
"Switch over to real Kbuild" series version 9
must be applied beforehand.


Changes in v2:
  - Rebase on Kbuild series v9
  - Add ';' which was missing in arch/arm/lib/board.c
  - Add 2/3 and 3/3

Masahiro Yamada (3):
  dts: re-write dts/Makefile more simply with Kbuild
  dts: move device tree sources to arch/$(ARCH)/dts/
  dts: generate multiple device tree blobs

 .gitignore                                         |  1 -
 Makefile                                           | 16 ++---
 arch/arm/dts/.gitignore                            |  1 +
 arch/arm/dts/Makefile                              | 37 ++++++++++
 .../arm}/dts/exynos5250-arndale.dts                |  0
 .../arm}/dts/exynos5250-smdk5250.dts               |  0
 .../samsung => arch/arm}/dts/exynos5250-snow.dts   |  0
 .../arm}/dts/exynos5420-smdk5420.dts               |  0
 .../nvidia => arch/arm}/dts/tegra114-dalmore.dts   |  0
 .../arm}/dts/tegra20-colibri_t20_iris.dts          |  0
 {board/nvidia => arch/arm}/dts/tegra20-harmony.dts |  0
 .../arm}/dts/tegra20-medcom-wide.dts               |  0
 {board/compal => arch/arm}/dts/tegra20-paz00.dts   |  0
 .../arm}/dts/tegra20-plutux.dts                    |  0
 .../nvidia => arch/arm}/dts/tegra20-seaboard.dts   |  0
 .../arm}/dts/tegra20-tamonten.dtsi                 |  0
 .../arm}/dts/tegra20-tec.dts                       |  0
 .../arm}/dts/tegra20-trimslice.dts                 |  0
 {board/nvidia => arch/arm}/dts/tegra20-ventana.dts |  0
 .../nvidia => arch/arm}/dts/tegra20-whistler.dts   |  0
 {board/nvidia => arch/arm}/dts/tegra30-beaver.dts  |  0
 {board/nvidia => arch/arm}/dts/tegra30-cardhu.dts  |  0
 .../arm}/dts/tegra30-tamonten.dtsi                 |  0
 .../arm}/dts/tegra30-tec-ng.dts                    |  0
 {board/xilinx => arch/arm}/dts/zynq-microzed.dts   |  0
 {board/xilinx => arch/arm}/dts/zynq-zc702.dts      |  0
 {board/xilinx => arch/arm}/dts/zynq-zc706.dts      |  0
 .../xilinx => arch/arm}/dts/zynq-zc770-xm010.dts   |  0
 .../xilinx => arch/arm}/dts/zynq-zc770-xm012.dts   |  0
 .../xilinx => arch/arm}/dts/zynq-zc770-xm013.dts   |  0
 {board/xilinx => arch/arm}/dts/zynq-zed.dts        |  0
 arch/arm/lib/board.c                               |  2 +-
 arch/microblaze/dts/.gitignore                     |  1 +
 arch/microblaze/dts/Makefile                       | 11 +++
 .../microblaze}/dts/microblaze-generic.dts         |  0
 arch/microblaze/lib/board.c                        |  2 +-
 arch/x86/dts/.gitignore                            |  1 +
 arch/x86/dts/Makefile                              | 12 ++++
 {board/chromebook-x86 => arch/x86}/dts/alex.dts    |  0
 {board/chromebook-x86 => arch/x86}/dts/link.dts    |  0
 arch/x86/lib/init_helpers.c                        |  2 +-
 common/board_f.c                                   |  2 +-
 dts/.gitignore                                     |  2 +
 dts/Makefile                                       | 81 ++++++++--------------
 include/common.h                                   |  2 +-
 scripts/Makefile.lib                               | 11 ++-
 46 files changed, 112 insertions(+), 72 deletions(-)
 create mode 100644 arch/arm/dts/.gitignore
 create mode 100644 arch/arm/dts/Makefile
 rename {board/samsung => arch/arm}/dts/exynos5250-arndale.dts (100%)
 rename {board/samsung => arch/arm}/dts/exynos5250-smdk5250.dts (100%)
 rename {board/samsung => arch/arm}/dts/exynos5250-snow.dts (100%)
 rename {board/samsung => arch/arm}/dts/exynos5420-smdk5420.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra114-dalmore.dts (100%)
 rename {board/toradex => arch/arm}/dts/tegra20-colibri_t20_iris.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra20-harmony.dts (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra20-medcom-wide.dts (100%)
 rename {board/compal => arch/arm}/dts/tegra20-paz00.dts (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra20-plutux.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra20-seaboard.dts (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra20-tamonten.dtsi (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra20-tec.dts (100%)
 rename {board/compulab => arch/arm}/dts/tegra20-trimslice.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra20-ventana.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra20-whistler.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra30-beaver.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra30-cardhu.dts (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra30-tamonten.dtsi (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra30-tec-ng.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-microzed.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc702.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc706.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm010.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm012.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm013.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zed.dts (100%)
 create mode 100644 arch/microblaze/dts/.gitignore
 create mode 100644 arch/microblaze/dts/Makefile
 rename {board/xilinx => arch/microblaze}/dts/microblaze-generic.dts (100%)
 create mode 100644 arch/x86/dts/.gitignore
 create mode 100644 arch/x86/dts/Makefile
 rename {board/chromebook-x86 => arch/x86}/dts/alex.dts (100%)
 rename {board/chromebook-x86 => arch/x86}/dts/link.dts (100%)
 create mode 100644 dts/.gitignore

-- 
1.8.3.2

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild
  2014-02-04  9:38 [U-Boot] [PATCH v2 0/3] Simplify dts/Makefile and support multiple DTBs generation Masahiro Yamada
@ 2014-02-04  9:38 ` Masahiro Yamada
  2014-02-15 23:38   ` Simon Glass
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/ Masahiro Yamada
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 3/3] dts: generate multiple device tree blobs Masahiro Yamada
  2 siblings, 1 reply; 18+ messages in thread
From: Masahiro Yamada @ 2014-02-04  9:38 UTC (permalink / raw)
  To: u-boot

Useful rules in scripts/Makefile.lib allows us to easily
generate a device tree blob and wrap it in assembly code.

We do not need to parse a linker script to get output format and arch.

This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

Changes in v2:
  - Rebase on Kbuild series v9
  - Add ';' which was missing in arch/arm/lib/board.c

 .gitignore                  |  1 -
 Makefile                    | 16 +++++-----
 arch/arm/lib/board.c        |  2 +-
 arch/microblaze/lib/board.c |  2 +-
 arch/x86/lib/init_helpers.c |  2 +-
 common/board_f.c            |  2 +-
 dts/.gitignore              |  2 ++
 dts/Makefile                | 72 +++++++++++++--------------------------------
 include/common.h            |  2 +-
 scripts/Makefile.lib        | 12 ++++----
 10 files changed, 41 insertions(+), 72 deletions(-)
 create mode 100644 dts/.gitignore

diff --git a/.gitignore b/.gitignore
index 24019b3..5882ff5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,7 +48,6 @@
 /u-boot.lds
 /u-boot.ubl
 /u-boot.ais
-/u-boot.dtb
 /u-boot.sb
 
 #
diff --git a/Makefile b/Makefile
index cb9c243..b425bfb 100644
--- a/Makefile
+++ b/Makefile
@@ -722,7 +722,7 @@ ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl
 ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
 ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
 ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
-ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin
+ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.bin
 ifneq ($(CONFIG_SPL_TARGET),)
 ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
 endif
@@ -746,11 +746,11 @@ endif
 
 all:		$(ALL-y)
 
-u-boot.dtb:	checkdtc u-boot
-		$(MAKE) $(build)=dts binary
-		mv dts/dt.dtb $@
+PHONY += dtbs
+dtbs dts/dt.dtb: checkdtc u-boot
+	$(Q)$(MAKE) $(build)=dts dtbs
 
-u-boot-dtb.bin:	u-boot.bin u-boot.dtb
+u-boot-dtb.bin: u-boot.bin dts/dt.dtb
 		cat $^ >$@
 
 u-boot.hex:	u-boot
@@ -877,8 +877,8 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin
 		rm spl/u-boot-spl-pad.bin
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
-u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin u-boot.dtb
-		cat u-boot-nodtb-tegra.bin u-boot.dtb > $@
+u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb
+		cat $^ > $@
 endif
 endif
 
@@ -1173,7 +1173,7 @@ include/license.h: tools/bin2header COPYING
 # Directories & files removed with 'make clean'
 CLEAN_DIRS  += $(MODVERDIR)
 CLEAN_FILES += u-boot.lds include/bmp_logo.h include/bmp_logo_data.h \
-	       board/*/config.tmp board/*/*/config.tmp dts/*.tmp \
+	       board/*/config.tmp board/*/*/config.tmp \
 	       include/autoconf.mk* include/spl-autoconf.mk \
 	       include/tpl-autoconf.mk
 
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index b770e25..38b9c7d 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -280,7 +280,7 @@ void board_init_f(ulong bootflag)
 	gd->mon_len = _bss_end_ofs;
 #ifdef CONFIG_OF_EMBED
 	/* Get a pointer to the FDT */
-	gd->fdt_blob = _binary_dt_dtb_start;
+	gd->fdt_blob = __dtb_db_begin;
 #elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
 	gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 896e73a..0f10c88 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -76,7 +76,7 @@ void board_init_f(ulong not_used)
 
 #ifdef CONFIG_OF_EMBED
 	/* Get a pointer to the FDT */
-	gd->fdt_blob = _binary_dt_dtb_start;
+	gd->fdt_blob = __dtb_dt_begin;
 #elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
 	gd->fdt_blob = (void *)__end;
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 582c0ff..b5d937f 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -92,7 +92,7 @@ int find_fdt(void)
 {
 #ifdef CONFIG_OF_EMBED
 	/* Get a pointer to the FDT */
-	gd->fdt_blob = _binary_dt_dtb_start;
+	gd->fdt_blob = __dtb_dt_begin;
 #elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
 	gd->fdt_blob = (ulong *)&_end;
diff --git a/common/board_f.c b/common/board_f.c
index aa70c3e..d0ee6f7 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -360,7 +360,7 @@ static int setup_fdt(void)
 {
 #ifdef CONFIG_OF_EMBED
 	/* Get a pointer to the FDT */
-	gd->fdt_blob = _binary_dt_dtb_start;
+	gd->fdt_blob = __dtb_dt_begin;
 #elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
 # ifdef CONFIG_SYS_SYM_OFFSETS
diff --git a/dts/.gitignore b/dts/.gitignore
new file mode 100644
index 0000000..1b37180
--- /dev/null
+++ b/dts/.gitignore
@@ -0,0 +1,2 @@
+*.dtb
+*.dtb.S
diff --git a/dts/Makefile b/dts/Makefile
index 1e7609a..c47fba7 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -7,64 +7,32 @@
 # This Makefile builds the internal U-Boot fdt if CONFIG_OF_CONTROL is
 # enabled. See doc/README.fdt-control for more details.
 
-DTS_INCDIRS =  $(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts
-DTS_INCDIRS += $(SRCTREE)/board/$(VENDOR)/dts
-DTS_INCDIRS += $(SRCTREE)/arch/$(ARCH)/dts
+DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
+ifeq ($(DEVICE_TREE),)
+DEVICE_TREE := notfound
+endif
 
-DTS_CPPFLAGS := -x assembler-with-cpp -undef -D__DTS__ \
-		-nostdinc $(addprefix -I,$(DTS_INCDIRS))
+DTS := $(srctree)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
 
-DTC_FLAGS := -R 4 -p 0x1000 \
-	$(addprefix -i ,$(DTS_INCDIRS))
+DTC_FLAGS += -i $(srctree)/arch/$(ARCH)/dts -R 4 -p 0x1000
 
-# Use a constant name for this so we can access it from C code.
-# objcopy doesn't seem to allow us to set the symbol name independently of
-# the filename.
-DT_BIN	:= $(obj)/dt.dtb
+$(obj)/dt.dtb: $(DTS) FORCE
+	$(call if_changed_dep,dtc)
 
-DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
-ifeq ($(DEVICE_TREE),)
-$(DT_BIN): FORCE
-	echo >&2 "Please define CONFIG_DEFAULT_DEVICE_TREE in your board header file"
-else
-$(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
-	$(CPP) $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp
-	$(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
-endif
+targets += dt.dtb
 
-process_lds = \
-	$(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'
+$(DTS):
+	@echo >&2
+	@echo >&2 "Device Tree Source is not specified."
+	@echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"
+	@echo >&2 "or build with 'DEVICE_TREE=<dts-file-name>' argument"
+	@/bin/false
 
-# Run the compiler and get the link script from the linker
-GET_LDS = $(CC) $(c_flags) $(ld_flags) -Wl,--verbose 2>&1
+.SECONDARY: $(obj)/dt.dtb.S
 
-$(obj)/dt.o: $(DT_BIN)
-	# We want the output format and arch.
-	# We also hope to win a prize for ugliest Makefile / shell interaction
-	# We look in the LDSCRIPT first.
-	# Then try the linker which should give us the answer.
-	# Then check it worked.
-	[ -n "$(LDSCRIPT)" ] && \
-		oformat=`$(call process_lds,cat $(LDSCRIPT),FORMAT)` && \
-		oarch=`$(call process_lds,cat $(LDSCRIPT),ARCH)` ;\
-	\
-	[ -z $${oformat} ] && \
-		oformat=`$(call process_lds,$(GET_LDS),FORMAT)` ;\
-	[ -z $${oarch} ] && \
-		oarch=`$(call process_lds,$(GET_LDS),ARCH)` ;\
-	\
-	[ -z $${oformat} ] && \
-		echo "Cannot read OUTPUT_FORMAT from lds file $(LDSCRIPT)" && \
-		exit 1 || true ;\
-	[ -z $${oarch} ] && \
-		echo "Cannot read OUTPUT_ARCH from lds file $(LDSCRIPT)" && \
-		exit 1 || true ;\
-	\
-	cd $(dir ${DT_BIN}) && \
-	$(OBJCOPY) -I binary -O $${oformat} -B $${oarch} \
-		$(notdir ${DT_BIN}) $(notdir $@)
-	rm $(DT_BIN)
+obj-$(CONFIG_OF_EMBED) := dt.dtb.o
 
-obj-$(CONFIG_OF_EMBED)	:= dt.o
+dtbs: $(obj)/dt.dtb
+	@:
 
-binary:	$(DT_BIN)
+clean-files := dt.dtb.S
diff --git a/include/common.h b/include/common.h
index c15e5a4..b590f3a 100644
--- a/include/common.h
+++ b/include/common.h
@@ -302,7 +302,7 @@ int	checkdram     (void);
 int	last_stage_init(void);
 extern ulong monitor_flash_len;
 int mac_read_from_eeprom(void);
-extern u8 _binary_dt_dtb_start[];	/* embedded device tree blob */
+extern u8 __dtb_dt_begin[];	/* embedded device tree blob */
 int set_cpu_clk_info(void);
 int print_cpuinfo(void);
 int update_flash_size(int flash_size);
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index d4b5cb5..ee3ceac 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -151,9 +151,10 @@ cpp_flags      = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE)     \
 
 ld_flags       = $(LDFLAGS) $(ldflags-y)
 
+# Modified for U-Boot
 dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc                    \
-		 -I$(srctree)/arch/$(SRCARCH)/boot/dts                   \
-		 -I$(srctree)/arch/$(SRCARCH)/boot/dts/include           \
+		 -I$(srctree)/board/$(VENDOR)/dts/                       \
+		 -I$(srctree)/arch/$(ARCH)/dts                           \
 		 -undef -D__DTS__
 
 # Finds the multi-part object the current object will be linked into
@@ -247,25 +248,24 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \
 
 # Generate an assembly file to wrap the output of the device tree compiler
 quiet_cmd_dt_S_dtb= DTB     $@
+# Modified for U-Boot
 cmd_dt_S_dtb=						\
 (							\
-	echo '\#include <asm-generic/vmlinux.lds.h>'; 	\
 	echo '.section .dtb.init.rodata,"a"';		\
-	echo '.balign STRUCT_ALIGNMENT';		\
 	echo '.global __dtb_$(*F)_begin';		\
 	echo '__dtb_$(*F)_begin:';			\
 	echo '.incbin "$<" ';				\
 	echo '__dtb_$(*F)_end:';			\
 	echo '.global __dtb_$(*F)_end';			\
-	echo '.balign STRUCT_ALIGNMENT'; 		\
 ) > $@
 
 $(obj)/%.dtb.S: $(obj)/%.dtb
 	$(call cmd,dt_S_dtb)
 
 quiet_cmd_dtc = DTC     $@
+# Modified for U-Boot
 cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
-	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
+	dtc -O dtb -o $@ -b 0 \
 		-i $(dir $<) $(DTC_FLAGS) \
 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \
 	cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-04  9:38 [U-Boot] [PATCH v2 0/3] Simplify dts/Makefile and support multiple DTBs generation Masahiro Yamada
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild Masahiro Yamada
@ 2014-02-04  9:38 ` Masahiro Yamada
  2014-02-05 21:47   ` Simon Glass
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 3/3] dts: generate multiple device tree blobs Masahiro Yamada
  2 siblings, 1 reply; 18+ messages in thread
From: Masahiro Yamada @ 2014-02-04  9:38 UTC (permalink / raw)
  To: u-boot

Unlike Linux Kernel, U-Boot historically had *.dts files under
board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.

I think arch/$(ARCH)/dts dicretory is a better location
to store both *.dts and *.dtsi files.

For example, before this commit, board/xilinx/dts directory
had both MicroBlaze dts (microblaze-generic.dts) and
ARM dts (zynq-*.dts), which are totally unrelated.

This commit moves *.dts to arch/$(ARCH)/dts/ directories,
allowing us to describe nicely mutiple DTBs generation in the next commit.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

Changes in v2:
  - Newly added

 {board/samsung => arch/arm}/dts/exynos5250-arndale.dts         | 0
 {board/samsung => arch/arm}/dts/exynos5250-smdk5250.dts        | 0
 {board/samsung => arch/arm}/dts/exynos5250-snow.dts            | 0
 {board/samsung => arch/arm}/dts/exynos5420-smdk5420.dts        | 0
 {board/nvidia => arch/arm}/dts/tegra114-dalmore.dts            | 0
 {board/toradex => arch/arm}/dts/tegra20-colibri_t20_iris.dts   | 0
 {board/nvidia => arch/arm}/dts/tegra20-harmony.dts             | 0
 {board/avionic-design => arch/arm}/dts/tegra20-medcom-wide.dts | 0
 {board/compal => arch/arm}/dts/tegra20-paz00.dts               | 0
 {board/avionic-design => arch/arm}/dts/tegra20-plutux.dts      | 0
 {board/nvidia => arch/arm}/dts/tegra20-seaboard.dts            | 0
 {board/avionic-design => arch/arm}/dts/tegra20-tamonten.dtsi   | 0
 {board/avionic-design => arch/arm}/dts/tegra20-tec.dts         | 0
 {board/compulab => arch/arm}/dts/tegra20-trimslice.dts         | 0
 {board/nvidia => arch/arm}/dts/tegra20-ventana.dts             | 0
 {board/nvidia => arch/arm}/dts/tegra20-whistler.dts            | 0
 {board/nvidia => arch/arm}/dts/tegra30-beaver.dts              | 0
 {board/nvidia => arch/arm}/dts/tegra30-cardhu.dts              | 0
 {board/avionic-design => arch/arm}/dts/tegra30-tamonten.dtsi   | 0
 {board/avionic-design => arch/arm}/dts/tegra30-tec-ng.dts      | 0
 {board/xilinx => arch/arm}/dts/zynq-microzed.dts               | 0
 {board/xilinx => arch/arm}/dts/zynq-zc702.dts                  | 0
 {board/xilinx => arch/arm}/dts/zynq-zc706.dts                  | 0
 {board/xilinx => arch/arm}/dts/zynq-zc770-xm010.dts            | 0
 {board/xilinx => arch/arm}/dts/zynq-zc770-xm012.dts            | 0
 {board/xilinx => arch/arm}/dts/zynq-zc770-xm013.dts            | 0
 {board/xilinx => arch/arm}/dts/zynq-zed.dts                    | 0
 {board/xilinx => arch/microblaze}/dts/microblaze-generic.dts   | 0
 {board/chromebook-x86 => arch/x86}/dts/alex.dts                | 0
 {board/chromebook-x86 => arch/x86}/dts/link.dts                | 0
 dts/Makefile                                                   | 4 ++--
 scripts/Makefile.lib                                           | 1 -
 32 files changed, 2 insertions(+), 3 deletions(-)
 rename {board/samsung => arch/arm}/dts/exynos5250-arndale.dts (100%)
 rename {board/samsung => arch/arm}/dts/exynos5250-smdk5250.dts (100%)
 rename {board/samsung => arch/arm}/dts/exynos5250-snow.dts (100%)
 rename {board/samsung => arch/arm}/dts/exynos5420-smdk5420.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra114-dalmore.dts (100%)
 rename {board/toradex => arch/arm}/dts/tegra20-colibri_t20_iris.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra20-harmony.dts (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra20-medcom-wide.dts (100%)
 rename {board/compal => arch/arm}/dts/tegra20-paz00.dts (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra20-plutux.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra20-seaboard.dts (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra20-tamonten.dtsi (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra20-tec.dts (100%)
 rename {board/compulab => arch/arm}/dts/tegra20-trimslice.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra20-ventana.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra20-whistler.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra30-beaver.dts (100%)
 rename {board/nvidia => arch/arm}/dts/tegra30-cardhu.dts (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra30-tamonten.dtsi (100%)
 rename {board/avionic-design => arch/arm}/dts/tegra30-tec-ng.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-microzed.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc702.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc706.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm010.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm012.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm013.dts (100%)
 rename {board/xilinx => arch/arm}/dts/zynq-zed.dts (100%)
 rename {board/xilinx => arch/microblaze}/dts/microblaze-generic.dts (100%)
 rename {board/chromebook-x86 => arch/x86}/dts/alex.dts (100%)
 rename {board/chromebook-x86 => arch/x86}/dts/link.dts (100%)

diff --git a/board/samsung/dts/exynos5250-arndale.dts b/arch/arm/dts/exynos5250-arndale.dts
similarity index 100%
rename from board/samsung/dts/exynos5250-arndale.dts
rename to arch/arm/dts/exynos5250-arndale.dts
diff --git a/board/samsung/dts/exynos5250-smdk5250.dts b/arch/arm/dts/exynos5250-smdk5250.dts
similarity index 100%
rename from board/samsung/dts/exynos5250-smdk5250.dts
rename to arch/arm/dts/exynos5250-smdk5250.dts
diff --git a/board/samsung/dts/exynos5250-snow.dts b/arch/arm/dts/exynos5250-snow.dts
similarity index 100%
rename from board/samsung/dts/exynos5250-snow.dts
rename to arch/arm/dts/exynos5250-snow.dts
diff --git a/board/samsung/dts/exynos5420-smdk5420.dts b/arch/arm/dts/exynos5420-smdk5420.dts
similarity index 100%
rename from board/samsung/dts/exynos5420-smdk5420.dts
rename to arch/arm/dts/exynos5420-smdk5420.dts
diff --git a/board/nvidia/dts/tegra114-dalmore.dts b/arch/arm/dts/tegra114-dalmore.dts
similarity index 100%
rename from board/nvidia/dts/tegra114-dalmore.dts
rename to arch/arm/dts/tegra114-dalmore.dts
diff --git a/board/toradex/dts/tegra20-colibri_t20_iris.dts b/arch/arm/dts/tegra20-colibri_t20_iris.dts
similarity index 100%
rename from board/toradex/dts/tegra20-colibri_t20_iris.dts
rename to arch/arm/dts/tegra20-colibri_t20_iris.dts
diff --git a/board/nvidia/dts/tegra20-harmony.dts b/arch/arm/dts/tegra20-harmony.dts
similarity index 100%
rename from board/nvidia/dts/tegra20-harmony.dts
rename to arch/arm/dts/tegra20-harmony.dts
diff --git a/board/avionic-design/dts/tegra20-medcom-wide.dts b/arch/arm/dts/tegra20-medcom-wide.dts
similarity index 100%
rename from board/avionic-design/dts/tegra20-medcom-wide.dts
rename to arch/arm/dts/tegra20-medcom-wide.dts
diff --git a/board/compal/dts/tegra20-paz00.dts b/arch/arm/dts/tegra20-paz00.dts
similarity index 100%
rename from board/compal/dts/tegra20-paz00.dts
rename to arch/arm/dts/tegra20-paz00.dts
diff --git a/board/avionic-design/dts/tegra20-plutux.dts b/arch/arm/dts/tegra20-plutux.dts
similarity index 100%
rename from board/avionic-design/dts/tegra20-plutux.dts
rename to arch/arm/dts/tegra20-plutux.dts
diff --git a/board/nvidia/dts/tegra20-seaboard.dts b/arch/arm/dts/tegra20-seaboard.dts
similarity index 100%
rename from board/nvidia/dts/tegra20-seaboard.dts
rename to arch/arm/dts/tegra20-seaboard.dts
diff --git a/board/avionic-design/dts/tegra20-tamonten.dtsi b/arch/arm/dts/tegra20-tamonten.dtsi
similarity index 100%
rename from board/avionic-design/dts/tegra20-tamonten.dtsi
rename to arch/arm/dts/tegra20-tamonten.dtsi
diff --git a/board/avionic-design/dts/tegra20-tec.dts b/arch/arm/dts/tegra20-tec.dts
similarity index 100%
rename from board/avionic-design/dts/tegra20-tec.dts
rename to arch/arm/dts/tegra20-tec.dts
diff --git a/board/compulab/dts/tegra20-trimslice.dts b/arch/arm/dts/tegra20-trimslice.dts
similarity index 100%
rename from board/compulab/dts/tegra20-trimslice.dts
rename to arch/arm/dts/tegra20-trimslice.dts
diff --git a/board/nvidia/dts/tegra20-ventana.dts b/arch/arm/dts/tegra20-ventana.dts
similarity index 100%
rename from board/nvidia/dts/tegra20-ventana.dts
rename to arch/arm/dts/tegra20-ventana.dts
diff --git a/board/nvidia/dts/tegra20-whistler.dts b/arch/arm/dts/tegra20-whistler.dts
similarity index 100%
rename from board/nvidia/dts/tegra20-whistler.dts
rename to arch/arm/dts/tegra20-whistler.dts
diff --git a/board/nvidia/dts/tegra30-beaver.dts b/arch/arm/dts/tegra30-beaver.dts
similarity index 100%
rename from board/nvidia/dts/tegra30-beaver.dts
rename to arch/arm/dts/tegra30-beaver.dts
diff --git a/board/nvidia/dts/tegra30-cardhu.dts b/arch/arm/dts/tegra30-cardhu.dts
similarity index 100%
rename from board/nvidia/dts/tegra30-cardhu.dts
rename to arch/arm/dts/tegra30-cardhu.dts
diff --git a/board/avionic-design/dts/tegra30-tamonten.dtsi b/arch/arm/dts/tegra30-tamonten.dtsi
similarity index 100%
rename from board/avionic-design/dts/tegra30-tamonten.dtsi
rename to arch/arm/dts/tegra30-tamonten.dtsi
diff --git a/board/avionic-design/dts/tegra30-tec-ng.dts b/arch/arm/dts/tegra30-tec-ng.dts
similarity index 100%
rename from board/avionic-design/dts/tegra30-tec-ng.dts
rename to arch/arm/dts/tegra30-tec-ng.dts
diff --git a/board/xilinx/dts/zynq-microzed.dts b/arch/arm/dts/zynq-microzed.dts
similarity index 100%
rename from board/xilinx/dts/zynq-microzed.dts
rename to arch/arm/dts/zynq-microzed.dts
diff --git a/board/xilinx/dts/zynq-zc702.dts b/arch/arm/dts/zynq-zc702.dts
similarity index 100%
rename from board/xilinx/dts/zynq-zc702.dts
rename to arch/arm/dts/zynq-zc702.dts
diff --git a/board/xilinx/dts/zynq-zc706.dts b/arch/arm/dts/zynq-zc706.dts
similarity index 100%
rename from board/xilinx/dts/zynq-zc706.dts
rename to arch/arm/dts/zynq-zc706.dts
diff --git a/board/xilinx/dts/zynq-zc770-xm010.dts b/arch/arm/dts/zynq-zc770-xm010.dts
similarity index 100%
rename from board/xilinx/dts/zynq-zc770-xm010.dts
rename to arch/arm/dts/zynq-zc770-xm010.dts
diff --git a/board/xilinx/dts/zynq-zc770-xm012.dts b/arch/arm/dts/zynq-zc770-xm012.dts
similarity index 100%
rename from board/xilinx/dts/zynq-zc770-xm012.dts
rename to arch/arm/dts/zynq-zc770-xm012.dts
diff --git a/board/xilinx/dts/zynq-zc770-xm013.dts b/arch/arm/dts/zynq-zc770-xm013.dts
similarity index 100%
rename from board/xilinx/dts/zynq-zc770-xm013.dts
rename to arch/arm/dts/zynq-zc770-xm013.dts
diff --git a/board/xilinx/dts/zynq-zed.dts b/arch/arm/dts/zynq-zed.dts
similarity index 100%
rename from board/xilinx/dts/zynq-zed.dts
rename to arch/arm/dts/zynq-zed.dts
diff --git a/board/xilinx/dts/microblaze-generic.dts b/arch/microblaze/dts/microblaze-generic.dts
similarity index 100%
rename from board/xilinx/dts/microblaze-generic.dts
rename to arch/microblaze/dts/microblaze-generic.dts
diff --git a/board/chromebook-x86/dts/alex.dts b/arch/x86/dts/alex.dts
similarity index 100%
rename from board/chromebook-x86/dts/alex.dts
rename to arch/x86/dts/alex.dts
diff --git a/board/chromebook-x86/dts/link.dts b/arch/x86/dts/link.dts
similarity index 100%
rename from board/chromebook-x86/dts/link.dts
rename to arch/x86/dts/link.dts
diff --git a/dts/Makefile b/dts/Makefile
index c47fba7..5d2abd9 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -12,9 +12,9 @@ ifeq ($(DEVICE_TREE),)
 DEVICE_TREE := notfound
 endif
 
-DTS := $(srctree)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
+DTS := $(srctree)/arch/$(ARCH)/dts/$(DEVICE_TREE).dts
 
-DTC_FLAGS += -i $(srctree)/arch/$(ARCH)/dts -R 4 -p 0x1000
+DTC_FLAGS += -R 4 -p 0x1000
 
 $(obj)/dt.dtb: $(DTS) FORCE
 	$(call if_changed_dep,dtc)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ee3ceac..02b17b1 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -153,7 +153,6 @@ ld_flags       = $(LDFLAGS) $(ldflags-y)
 
 # Modified for U-Boot
 dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc                    \
-		 -I$(srctree)/board/$(VENDOR)/dts/                       \
 		 -I$(srctree)/arch/$(ARCH)/dts                           \
 		 -undef -D__DTS__
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 3/3] dts: generate multiple device tree blobs
  2014-02-04  9:38 [U-Boot] [PATCH v2 0/3] Simplify dts/Makefile and support multiple DTBs generation Masahiro Yamada
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild Masahiro Yamada
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/ Masahiro Yamada
@ 2014-02-04  9:38 ` Masahiro Yamada
  2014-02-15 23:39   ` Simon Glass
  2 siblings, 1 reply; 18+ messages in thread
From: Masahiro Yamada @ 2014-02-04  9:38 UTC (permalink / raw)
  To: u-boot

It is convenient to have all device trees on the same SoC compiled.
It allows for later easy repackaging without the need to re-run
the make file.

  - Build device trees with the same SoC under arch/$(ARCH)/dts
  - Copy the one specified by CONFIG_DEFAULT_DEVICE_TREE or
    DEVICE_TREE=... to dts/dt.dtb

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

Changes in v2:
  - Newly added

 arch/arm/dts/.gitignore        |  1 +
 arch/arm/dts/Makefile          | 37 +++++++++++++++++++++++++++++++++++++
 arch/microblaze/dts/.gitignore |  1 +
 arch/microblaze/dts/Makefile   | 11 +++++++++++
 arch/x86/dts/.gitignore        |  1 +
 arch/x86/dts/Makefile          | 12 ++++++++++++
 dts/Makefile                   | 31 ++++++++++++++++++++-----------
 7 files changed, 83 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/dts/.gitignore
 create mode 100644 arch/arm/dts/Makefile
 create mode 100644 arch/microblaze/dts/.gitignore
 create mode 100644 arch/microblaze/dts/Makefile
 create mode 100644 arch/x86/dts/.gitignore
 create mode 100644 arch/x86/dts/Makefile

diff --git a/arch/arm/dts/.gitignore b/arch/arm/dts/.gitignore
new file mode 100644
index 0000000..b60ed20
--- /dev/null
+++ b/arch/arm/dts/.gitignore
@@ -0,0 +1 @@
+*.dtb
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
new file mode 100644
index 0000000..2658911
--- /dev/null
+++ b/arch/arm/dts/Makefile
@@ -0,0 +1,37 @@
+dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
+	exynos5250-snow.dtb \
+	exynos5250-smdk5250.dtb \
+	exynos5420-smdk5420.dtb
+
+dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
+	tegra20-medcom-wide.dtb \
+	tegra20-paz00.dtb \
+	tegra20-plutux.dtb \
+	tegra20-seaboard.dtb \
+	tegra20-tec.dtb \
+	tegra20-trimslice.dtb \
+	tegra20-ventana.dtb \
+	tegra20-whistler.dtb \
+	tegra20-colibri_t20_iris.dtb \
+	tegra30-beaver.dtb \
+	tegra30-cardhu.dtb \
+	tegra30-tec-ng.dtb \
+	tegra114-dalmore.dtb
+
+dtb-$(CONFIG_ZYNQ) += zynq-zc702.dtb \
+	zynq-zc706.dtb \
+	zynq-zed.dtb \
+	zynq-microzed.dtb \
+	zynq-zc770-xm010.dtb \
+	zynq-zc770-xm012.dtb \
+	zynq-zc770-xm013.dtb
+
+targets += $(dtb-y)
+
+DTC_FLAGS += -R 4 -p 0x1000
+
+PHONY += dtbs
+dtbs: $(addprefix $(obj)/, $(dtb-y))
+	@:
+
+clean-files := *.dtb
diff --git a/arch/microblaze/dts/.gitignore b/arch/microblaze/dts/.gitignore
new file mode 100644
index 0000000..b60ed20
--- /dev/null
+++ b/arch/microblaze/dts/.gitignore
@@ -0,0 +1 @@
+*.dtb
diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
new file mode 100644
index 0000000..6d4a11f
--- /dev/null
+++ b/arch/microblaze/dts/Makefile
@@ -0,0 +1,11 @@
+dtb-y += microblaze-generic.dtb
+
+targets += $(dtb-y)
+
+DTC_FLAGS += -R 4 -p 0x1000
+
+PHONY += dtbs
+dtbs: $(addprefix $(obj)/, $(dtb-y))
+	@:
+
+clean-files := *.dtb
diff --git a/arch/x86/dts/.gitignore b/arch/x86/dts/.gitignore
new file mode 100644
index 0000000..b60ed20
--- /dev/null
+++ b/arch/x86/dts/.gitignore
@@ -0,0 +1 @@
+*.dtb
diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile
new file mode 100644
index 0000000..27374a4
--- /dev/null
+++ b/arch/x86/dts/Makefile
@@ -0,0 +1,12 @@
+dtb-y += link.dts \
+	alex.dts
+
+targets += $(dtb-y)
+
+DTC_FLAGS += -R 4 -p 0x1000
+
+PHONY += dtbs
+dtbs: $(addprefix $(obj)/, $(dtb-y))
+	@:
+
+clean-files := *.dtb
diff --git a/dts/Makefile b/dts/Makefile
index 5d2abd9..5a432c7 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -9,24 +9,30 @@
 
 DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
 ifeq ($(DEVICE_TREE),)
-DEVICE_TREE := notfound
+DEVICE_TREE := unset
 endif
 
-DTS := $(srctree)/arch/$(ARCH)/dts/$(DEVICE_TREE).dts
+DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
 
-DTC_FLAGS += -R 4 -p 0x1000
+quiet_cmd_cp = CP      $@
+cmd_cp = cp $< $@
 
-$(obj)/dt.dtb: $(DTS) FORCE
-	$(call if_changed_dep,dtc)
+$(obj)/dt.dtb: $(DTB) FORCE
+	$(call if_changed,cp)
 
 targets += dt.dtb
 
-$(DTS):
-	@echo >&2
-	@echo >&2 "Device Tree Source is not specified."
-	@echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"
-	@echo >&2 "or build with 'DEVICE_TREE=<dts-file-name>' argument"
-	@/bin/false
+$(DTB): arch-dtbs
+	$(Q)test -e $@ || (						\
+	echo >&2;							\
+	echo >&2 "Device Tree Source is not correctly specified.";	\
+	echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'";		\
+	echo >&2 "or build with 'DEVICE_TREE=<dts-file>' argument";	\
+	echo >&2;							\
+	/bin/false)
+
+arch-dtbs:
+	$(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
 
 .SECONDARY: $(obj)/dt.dtb.S
 
@@ -36,3 +42,6 @@ dtbs: $(obj)/dt.dtb
 	@:
 
 clean-files := dt.dtb.S
+
+# Let clean descend into dts directories
+subdir- += ../arch/*/dts
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/ Masahiro Yamada
@ 2014-02-05 21:47   ` Simon Glass
  2014-02-06  5:50     ` Masahiro Yamada
  2014-02-07 18:26     ` Scott Wood
  0 siblings, 2 replies; 18+ messages in thread
From: Simon Glass @ 2014-02-05 21:47 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Unlike Linux Kernel, U-Boot historically had *.dts files under
> board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
>
> I think arch/$(ARCH)/dts dicretory is a better location
> to store both *.dts and *.dtsi files.
>
> For example, before this commit, board/xilinx/dts directory
> had both MicroBlaze dts (microblaze-generic.dts) and
> ARM dts (zynq-*.dts), which are totally unrelated.
>
> This commit moves *.dts to arch/$(ARCH)/dts/ directories,
> allowing us to describe nicely mutiple DTBs generation in the next commit.

What is the motivation for this? I worry that we might end up with a
lot of files in one directory. One benefit of the current approach is
that .dts files are split up by vendor. Even if we put the SoC .dtsi
files in arch/arm, perhaps there is a benefit in leaving the board
.dts files in board/<vendor>?

I don't have strong feelings, just questing this...

Regards,
Simon

>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---
>
> Changes in v2:
>   - Newly added
>
>  {board/samsung => arch/arm}/dts/exynos5250-arndale.dts         | 0
>  {board/samsung => arch/arm}/dts/exynos5250-smdk5250.dts        | 0
>  {board/samsung => arch/arm}/dts/exynos5250-snow.dts            | 0
>  {board/samsung => arch/arm}/dts/exynos5420-smdk5420.dts        | 0
>  {board/nvidia => arch/arm}/dts/tegra114-dalmore.dts            | 0
>  {board/toradex => arch/arm}/dts/tegra20-colibri_t20_iris.dts   | 0
>  {board/nvidia => arch/arm}/dts/tegra20-harmony.dts             | 0
>  {board/avionic-design => arch/arm}/dts/tegra20-medcom-wide.dts | 0
>  {board/compal => arch/arm}/dts/tegra20-paz00.dts               | 0
>  {board/avionic-design => arch/arm}/dts/tegra20-plutux.dts      | 0
>  {board/nvidia => arch/arm}/dts/tegra20-seaboard.dts            | 0
>  {board/avionic-design => arch/arm}/dts/tegra20-tamonten.dtsi   | 0
>  {board/avionic-design => arch/arm}/dts/tegra20-tec.dts         | 0
>  {board/compulab => arch/arm}/dts/tegra20-trimslice.dts         | 0
>  {board/nvidia => arch/arm}/dts/tegra20-ventana.dts             | 0
>  {board/nvidia => arch/arm}/dts/tegra20-whistler.dts            | 0
>  {board/nvidia => arch/arm}/dts/tegra30-beaver.dts              | 0
>  {board/nvidia => arch/arm}/dts/tegra30-cardhu.dts              | 0
>  {board/avionic-design => arch/arm}/dts/tegra30-tamonten.dtsi   | 0
>  {board/avionic-design => arch/arm}/dts/tegra30-tec-ng.dts      | 0
>  {board/xilinx => arch/arm}/dts/zynq-microzed.dts               | 0
>  {board/xilinx => arch/arm}/dts/zynq-zc702.dts                  | 0
>  {board/xilinx => arch/arm}/dts/zynq-zc706.dts                  | 0
>  {board/xilinx => arch/arm}/dts/zynq-zc770-xm010.dts            | 0
>  {board/xilinx => arch/arm}/dts/zynq-zc770-xm012.dts            | 0
>  {board/xilinx => arch/arm}/dts/zynq-zc770-xm013.dts            | 0
>  {board/xilinx => arch/arm}/dts/zynq-zed.dts                    | 0
>  {board/xilinx => arch/microblaze}/dts/microblaze-generic.dts   | 0
>  {board/chromebook-x86 => arch/x86}/dts/alex.dts                | 0
>  {board/chromebook-x86 => arch/x86}/dts/link.dts                | 0
>  dts/Makefile                                                   | 4 ++--
>  scripts/Makefile.lib                                           | 1 -
>  32 files changed, 2 insertions(+), 3 deletions(-)
>  rename {board/samsung => arch/arm}/dts/exynos5250-arndale.dts (100%)
>  rename {board/samsung => arch/arm}/dts/exynos5250-smdk5250.dts (100%)
>  rename {board/samsung => arch/arm}/dts/exynos5250-snow.dts (100%)
>  rename {board/samsung => arch/arm}/dts/exynos5420-smdk5420.dts (100%)
>  rename {board/nvidia => arch/arm}/dts/tegra114-dalmore.dts (100%)
>  rename {board/toradex => arch/arm}/dts/tegra20-colibri_t20_iris.dts (100%)
>  rename {board/nvidia => arch/arm}/dts/tegra20-harmony.dts (100%)
>  rename {board/avionic-design => arch/arm}/dts/tegra20-medcom-wide.dts (100%)
>  rename {board/compal => arch/arm}/dts/tegra20-paz00.dts (100%)
>  rename {board/avionic-design => arch/arm}/dts/tegra20-plutux.dts (100%)
>  rename {board/nvidia => arch/arm}/dts/tegra20-seaboard.dts (100%)
>  rename {board/avionic-design => arch/arm}/dts/tegra20-tamonten.dtsi (100%)
>  rename {board/avionic-design => arch/arm}/dts/tegra20-tec.dts (100%)
>  rename {board/compulab => arch/arm}/dts/tegra20-trimslice.dts (100%)
>  rename {board/nvidia => arch/arm}/dts/tegra20-ventana.dts (100%)
>  rename {board/nvidia => arch/arm}/dts/tegra20-whistler.dts (100%)
>  rename {board/nvidia => arch/arm}/dts/tegra30-beaver.dts (100%)
>  rename {board/nvidia => arch/arm}/dts/tegra30-cardhu.dts (100%)
>  rename {board/avionic-design => arch/arm}/dts/tegra30-tamonten.dtsi (100%)
>  rename {board/avionic-design => arch/arm}/dts/tegra30-tec-ng.dts (100%)
>  rename {board/xilinx => arch/arm}/dts/zynq-microzed.dts (100%)
>  rename {board/xilinx => arch/arm}/dts/zynq-zc702.dts (100%)
>  rename {board/xilinx => arch/arm}/dts/zynq-zc706.dts (100%)
>  rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm010.dts (100%)
>  rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm012.dts (100%)
>  rename {board/xilinx => arch/arm}/dts/zynq-zc770-xm013.dts (100%)
>  rename {board/xilinx => arch/arm}/dts/zynq-zed.dts (100%)
>  rename {board/xilinx => arch/microblaze}/dts/microblaze-generic.dts (100%)
>  rename {board/chromebook-x86 => arch/x86}/dts/alex.dts (100%)
>  rename {board/chromebook-x86 => arch/x86}/dts/link.dts (100%)
>
> diff --git a/board/samsung/dts/exynos5250-arndale.dts b/arch/arm/dts/exynos5250-arndale.dts
> similarity index 100%
> rename from board/samsung/dts/exynos5250-arndale.dts
> rename to arch/arm/dts/exynos5250-arndale.dts
> diff --git a/board/samsung/dts/exynos5250-smdk5250.dts b/arch/arm/dts/exynos5250-smdk5250.dts
> similarity index 100%
> rename from board/samsung/dts/exynos5250-smdk5250.dts
> rename to arch/arm/dts/exynos5250-smdk5250.dts
> diff --git a/board/samsung/dts/exynos5250-snow.dts b/arch/arm/dts/exynos5250-snow.dts
> similarity index 100%
> rename from board/samsung/dts/exynos5250-snow.dts
> rename to arch/arm/dts/exynos5250-snow.dts
> diff --git a/board/samsung/dts/exynos5420-smdk5420.dts b/arch/arm/dts/exynos5420-smdk5420.dts
> similarity index 100%
> rename from board/samsung/dts/exynos5420-smdk5420.dts
> rename to arch/arm/dts/exynos5420-smdk5420.dts
> diff --git a/board/nvidia/dts/tegra114-dalmore.dts b/arch/arm/dts/tegra114-dalmore.dts
> similarity index 100%
> rename from board/nvidia/dts/tegra114-dalmore.dts
> rename to arch/arm/dts/tegra114-dalmore.dts
> diff --git a/board/toradex/dts/tegra20-colibri_t20_iris.dts b/arch/arm/dts/tegra20-colibri_t20_iris.dts
> similarity index 100%
> rename from board/toradex/dts/tegra20-colibri_t20_iris.dts
> rename to arch/arm/dts/tegra20-colibri_t20_iris.dts
> diff --git a/board/nvidia/dts/tegra20-harmony.dts b/arch/arm/dts/tegra20-harmony.dts
> similarity index 100%
> rename from board/nvidia/dts/tegra20-harmony.dts
> rename to arch/arm/dts/tegra20-harmony.dts
> diff --git a/board/avionic-design/dts/tegra20-medcom-wide.dts b/arch/arm/dts/tegra20-medcom-wide.dts
> similarity index 100%
> rename from board/avionic-design/dts/tegra20-medcom-wide.dts
> rename to arch/arm/dts/tegra20-medcom-wide.dts
> diff --git a/board/compal/dts/tegra20-paz00.dts b/arch/arm/dts/tegra20-paz00.dts
> similarity index 100%
> rename from board/compal/dts/tegra20-paz00.dts
> rename to arch/arm/dts/tegra20-paz00.dts
> diff --git a/board/avionic-design/dts/tegra20-plutux.dts b/arch/arm/dts/tegra20-plutux.dts
> similarity index 100%
> rename from board/avionic-design/dts/tegra20-plutux.dts
> rename to arch/arm/dts/tegra20-plutux.dts
> diff --git a/board/nvidia/dts/tegra20-seaboard.dts b/arch/arm/dts/tegra20-seaboard.dts
> similarity index 100%
> rename from board/nvidia/dts/tegra20-seaboard.dts
> rename to arch/arm/dts/tegra20-seaboard.dts
> diff --git a/board/avionic-design/dts/tegra20-tamonten.dtsi b/arch/arm/dts/tegra20-tamonten.dtsi
> similarity index 100%
> rename from board/avionic-design/dts/tegra20-tamonten.dtsi
> rename to arch/arm/dts/tegra20-tamonten.dtsi
> diff --git a/board/avionic-design/dts/tegra20-tec.dts b/arch/arm/dts/tegra20-tec.dts
> similarity index 100%
> rename from board/avionic-design/dts/tegra20-tec.dts
> rename to arch/arm/dts/tegra20-tec.dts
> diff --git a/board/compulab/dts/tegra20-trimslice.dts b/arch/arm/dts/tegra20-trimslice.dts
> similarity index 100%
> rename from board/compulab/dts/tegra20-trimslice.dts
> rename to arch/arm/dts/tegra20-trimslice.dts
> diff --git a/board/nvidia/dts/tegra20-ventana.dts b/arch/arm/dts/tegra20-ventana.dts
> similarity index 100%
> rename from board/nvidia/dts/tegra20-ventana.dts
> rename to arch/arm/dts/tegra20-ventana.dts
> diff --git a/board/nvidia/dts/tegra20-whistler.dts b/arch/arm/dts/tegra20-whistler.dts
> similarity index 100%
> rename from board/nvidia/dts/tegra20-whistler.dts
> rename to arch/arm/dts/tegra20-whistler.dts
> diff --git a/board/nvidia/dts/tegra30-beaver.dts b/arch/arm/dts/tegra30-beaver.dts
> similarity index 100%
> rename from board/nvidia/dts/tegra30-beaver.dts
> rename to arch/arm/dts/tegra30-beaver.dts
> diff --git a/board/nvidia/dts/tegra30-cardhu.dts b/arch/arm/dts/tegra30-cardhu.dts
> similarity index 100%
> rename from board/nvidia/dts/tegra30-cardhu.dts
> rename to arch/arm/dts/tegra30-cardhu.dts
> diff --git a/board/avionic-design/dts/tegra30-tamonten.dtsi b/arch/arm/dts/tegra30-tamonten.dtsi
> similarity index 100%
> rename from board/avionic-design/dts/tegra30-tamonten.dtsi
> rename to arch/arm/dts/tegra30-tamonten.dtsi
> diff --git a/board/avionic-design/dts/tegra30-tec-ng.dts b/arch/arm/dts/tegra30-tec-ng.dts
> similarity index 100%
> rename from board/avionic-design/dts/tegra30-tec-ng.dts
> rename to arch/arm/dts/tegra30-tec-ng.dts
> diff --git a/board/xilinx/dts/zynq-microzed.dts b/arch/arm/dts/zynq-microzed.dts
> similarity index 100%
> rename from board/xilinx/dts/zynq-microzed.dts
> rename to arch/arm/dts/zynq-microzed.dts
> diff --git a/board/xilinx/dts/zynq-zc702.dts b/arch/arm/dts/zynq-zc702.dts
> similarity index 100%
> rename from board/xilinx/dts/zynq-zc702.dts
> rename to arch/arm/dts/zynq-zc702.dts
> diff --git a/board/xilinx/dts/zynq-zc706.dts b/arch/arm/dts/zynq-zc706.dts
> similarity index 100%
> rename from board/xilinx/dts/zynq-zc706.dts
> rename to arch/arm/dts/zynq-zc706.dts
> diff --git a/board/xilinx/dts/zynq-zc770-xm010.dts b/arch/arm/dts/zynq-zc770-xm010.dts
> similarity index 100%
> rename from board/xilinx/dts/zynq-zc770-xm010.dts
> rename to arch/arm/dts/zynq-zc770-xm010.dts
> diff --git a/board/xilinx/dts/zynq-zc770-xm012.dts b/arch/arm/dts/zynq-zc770-xm012.dts
> similarity index 100%
> rename from board/xilinx/dts/zynq-zc770-xm012.dts
> rename to arch/arm/dts/zynq-zc770-xm012.dts
> diff --git a/board/xilinx/dts/zynq-zc770-xm013.dts b/arch/arm/dts/zynq-zc770-xm013.dts
> similarity index 100%
> rename from board/xilinx/dts/zynq-zc770-xm013.dts
> rename to arch/arm/dts/zynq-zc770-xm013.dts
> diff --git a/board/xilinx/dts/zynq-zed.dts b/arch/arm/dts/zynq-zed.dts
> similarity index 100%
> rename from board/xilinx/dts/zynq-zed.dts
> rename to arch/arm/dts/zynq-zed.dts
> diff --git a/board/xilinx/dts/microblaze-generic.dts b/arch/microblaze/dts/microblaze-generic.dts
> similarity index 100%
> rename from board/xilinx/dts/microblaze-generic.dts
> rename to arch/microblaze/dts/microblaze-generic.dts
> diff --git a/board/chromebook-x86/dts/alex.dts b/arch/x86/dts/alex.dts
> similarity index 100%
> rename from board/chromebook-x86/dts/alex.dts
> rename to arch/x86/dts/alex.dts
> diff --git a/board/chromebook-x86/dts/link.dts b/arch/x86/dts/link.dts
> similarity index 100%
> rename from board/chromebook-x86/dts/link.dts
> rename to arch/x86/dts/link.dts
> diff --git a/dts/Makefile b/dts/Makefile
> index c47fba7..5d2abd9 100644
> --- a/dts/Makefile
> +++ b/dts/Makefile
> @@ -12,9 +12,9 @@ ifeq ($(DEVICE_TREE),)
>  DEVICE_TREE := notfound
>  endif
>
> -DTS := $(srctree)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
> +DTS := $(srctree)/arch/$(ARCH)/dts/$(DEVICE_TREE).dts
>
> -DTC_FLAGS += -i $(srctree)/arch/$(ARCH)/dts -R 4 -p 0x1000
> +DTC_FLAGS += -R 4 -p 0x1000
>
>  $(obj)/dt.dtb: $(DTS) FORCE
>         $(call if_changed_dep,dtc)
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index ee3ceac..02b17b1 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -153,7 +153,6 @@ ld_flags       = $(LDFLAGS) $(ldflags-y)
>
>  # Modified for U-Boot
>  dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc                    \
> -                -I$(srctree)/board/$(VENDOR)/dts/                       \
>                  -I$(srctree)/arch/$(ARCH)/dts                           \
>                  -undef -D__DTS__
>
> --
> 1.8.3.2
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-05 21:47   ` Simon Glass
@ 2014-02-06  5:50     ` Masahiro Yamada
  2014-02-15 23:46       ` Simon Glass
  2014-02-18 14:32       ` Tom Rini
  2014-02-07 18:26     ` Scott Wood
  1 sibling, 2 replies; 18+ messages in thread
From: Masahiro Yamada @ 2014-02-06  5:50 UTC (permalink / raw)
  To: u-boot

Hello Simon,


> Hi Masahiro,
> 
> On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> > Unlike Linux Kernel, U-Boot historically had *.dts files under
> > board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
> >
> > I think arch/$(ARCH)/dts dicretory is a better location
> > to store both *.dts and *.dtsi files.
> >
> > For example, before this commit, board/xilinx/dts directory
> > had both MicroBlaze dts (microblaze-generic.dts) and
> > ARM dts (zynq-*.dts), which are totally unrelated.
> >
> > This commit moves *.dts to arch/$(ARCH)/dts/ directories,
> > allowing us to describe nicely mutiple DTBs generation in the next commit.
> 
> What is the motivation for this? I worry that we might end up with a
> lot of files in one directory.

We have only 35 .dtsi and .dts for ARM.
I think it will be OK at least until we have 500.

Linux v3.13 has 500 .dtsi and .dts files in arch/arm/boot/dts/
and they are still adding device trees to that directory.

I have no idea if they will keep going, or someone will scream and turn
around.

Anyway, when Linux guys someday invents a nice idea to work arond
increasing device trees, we can import it to U-Boot.
It should be easy for us because we already have a similar build system.

> One benefit of the current approach is
> that .dts files are split up by vendor. Even if we put the SoC .dtsi
> files in arch/arm, perhaps there is a benefit in leaving the board
> .dts files in board/<vendor>?

I don't like the idea to split up by vendor.

Now Xilinx has device trees both for ARM and Microblaze,
resulting in totally unrelated device trees in one directory.

What if Freescale decided to adopt device tree?
They support various boards on ARM, PowerPC, M68K.

Renesus is the same. They have ARM and SuperH boards.


On the other hand, different vendors can produce similar boards.
For example avionic design, which develops Tegra boards,
are using nVidia's sources.

When I saw  board/nvidia/common/common.mk
and board/avionic-design/*/Makefile, etc., I think we're screwed up
with <vendor> directory.

Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-05 21:47   ` Simon Glass
  2014-02-06  5:50     ` Masahiro Yamada
@ 2014-02-07 18:26     ` Scott Wood
  1 sibling, 0 replies; 18+ messages in thread
From: Scott Wood @ 2014-02-07 18:26 UTC (permalink / raw)
  To: u-boot

On Wed, 2014-02-05 at 14:47 -0700, Simon Glass wrote:
> Hi Masahiro,
> 
> On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> > Unlike Linux Kernel, U-Boot historically had *.dts files under
> > board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
> >
> > I think arch/$(ARCH)/dts dicretory is a better location
> > to store both *.dts and *.dtsi files.
> >
> > For example, before this commit, board/xilinx/dts directory
> > had both MicroBlaze dts (microblaze-generic.dts) and
> > ARM dts (zynq-*.dts), which are totally unrelated.
> >
> > This commit moves *.dts to arch/$(ARCH)/dts/ directories,
> > allowing us to describe nicely mutiple DTBs generation in the next commit.
> 
> What is the motivation for this? I worry that we might end up with a
> lot of files in one directory. One benefit of the current approach is
> that .dts files are split up by vendor. Even if we put the SoC .dtsi
> files in arch/arm, perhaps there is a benefit in leaving the board
> .dts files in board/<vendor>?
> 
> I don't have strong feelings, just questing this...

Having all the device trees in one place (I don't even see why it should
be split by arch; some common dtsi files may be shared by multiple
arches) is nice for grepping and maintenance.  If it gets too large it
can grow an internal hierarchy.

Just like net drivers go under drivers/net regardless of arch, etc.

-Scott

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild Masahiro Yamada
@ 2014-02-15 23:38   ` Simon Glass
  2014-02-18  9:27     ` Masahiro Yamada
  0 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2014-02-15 23:38 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Useful rules in scripts/Makefile.lib allows us to easily
> generate a device tree blob and wrap it in assembly code.
>
> We do not need to parse a linker script to get output format and arch.
>
> This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb

I'd rather have the former and delete the latter temporary file as
part of the build. u-boot.dtb is currently a build output.

Regards,
Simon

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 3/3] dts: generate multiple device tree blobs
  2014-02-04  9:38 ` [U-Boot] [PATCH v2 3/3] dts: generate multiple device tree blobs Masahiro Yamada
@ 2014-02-15 23:39   ` Simon Glass
  0 siblings, 0 replies; 18+ messages in thread
From: Simon Glass @ 2014-02-15 23:39 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> It is convenient to have all device trees on the same SoC compiled.
> It allows for later easy repackaging without the need to re-run
> the make file.
>
>   - Build device trees with the same SoC under arch/$(ARCH)/dts
>   - Copy the one specified by CONFIG_DEFAULT_DEVICE_TREE or
>     DEVICE_TREE=... to dts/dt.dtb
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---
>
> Changes in v2:
>   - Newly added
>
>  arch/arm/dts/.gitignore        |  1 +
>  arch/arm/dts/Makefile          | 37 +++++++++++++++++++++++++++++++++++++
>  arch/microblaze/dts/.gitignore |  1 +
>  arch/microblaze/dts/Makefile   | 11 +++++++++++
>  arch/x86/dts/.gitignore        |  1 +
>  arch/x86/dts/Makefile          | 12 ++++++++++++
>  dts/Makefile                   | 31 ++++++++++++++++++++-----------
>  7 files changed, 83 insertions(+), 11 deletions(-)
>  create mode 100644 arch/arm/dts/.gitignore
>  create mode 100644 arch/arm/dts/Makefile
>  create mode 100644 arch/microblaze/dts/.gitignore
>  create mode 100644 arch/microblaze/dts/Makefile
>  create mode 100644 arch/x86/dts/.gitignore
>  create mode 100644 arch/x86/dts/Makefile
>
> diff --git a/arch/arm/dts/.gitignore b/arch/arm/dts/.gitignore
> new file mode 100644
> index 0000000..b60ed20
> --- /dev/null
> +++ b/arch/arm/dts/.gitignore
> @@ -0,0 +1 @@
> +*.dtb
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> new file mode 100644
> index 0000000..2658911
> --- /dev/null
> +++ b/arch/arm/dts/Makefile
> @@ -0,0 +1,37 @@
> +dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
> +       exynos5250-snow.dtb \
> +       exynos5250-smdk5250.dtb \
> +       exynos5420-smdk5420.dtb
> +
> +dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
> +       tegra20-medcom-wide.dtb \
> +       tegra20-paz00.dtb \
> +       tegra20-plutux.dtb \
> +       tegra20-seaboard.dtb \
> +       tegra20-tec.dtb \
> +       tegra20-trimslice.dtb \
> +       tegra20-ventana.dtb \
> +       tegra20-whistler.dtb \
> +       tegra20-colibri_t20_iris.dtb \
> +       tegra30-beaver.dtb \
> +       tegra30-cardhu.dtb \
> +       tegra30-tec-ng.dtb \
> +       tegra114-dalmore.dtb
> +
> +dtb-$(CONFIG_ZYNQ) += zynq-zc702.dtb \
> +       zynq-zc706.dtb \
> +       zynq-zed.dtb \
> +       zynq-microzed.dtb \
> +       zynq-zc770-xm010.dtb \
> +       zynq-zc770-xm012.dtb \
> +       zynq-zc770-xm013.dtb


This better matches what the kernel does, but I'm not 100% comfortable
about putting all these files in arch/arm. Granted the vendor
directory may not correspond to a particular SoC, but we can put
tegra20.dtsi in arch/arm/dts so that all tegra boards can use it, for
example.

Regards,
Simon

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-06  5:50     ` Masahiro Yamada
@ 2014-02-15 23:46       ` Simon Glass
  2014-02-18  9:43         ` Masahiro Yamada
  2014-02-18 14:32       ` Tom Rini
  1 sibling, 1 reply; 18+ messages in thread
From: Simon Glass @ 2014-02-15 23:46 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 5 February 2014 22:50, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Hello Simon,
>
>
>> Hi Masahiro,
>>
>> On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
>> > Unlike Linux Kernel, U-Boot historically had *.dts files under
>> > board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
>> >
>> > I think arch/$(ARCH)/dts dicretory is a better location
>> > to store both *.dts and *.dtsi files.
>> >
>> > For example, before this commit, board/xilinx/dts directory
>> > had both MicroBlaze dts (microblaze-generic.dts) and
>> > ARM dts (zynq-*.dts), which are totally unrelated.
>> >
>> > This commit moves *.dts to arch/$(ARCH)/dts/ directories,
>> > allowing us to describe nicely mutiple DTBs generation in the next commit.
>>
>> What is the motivation for this? I worry that we might end up with a
>> lot of files in one directory.
>
> We have only 35 .dtsi and .dts for ARM.
> I think it will be OK at least until we have 500.
>
> Linux v3.13 has 500 .dtsi and .dts files in arch/arm/boot/dts/
> and they are still adding device trees to that directory.
>
> I have no idea if they will keep going, or someone will scream and turn
> around.
>
> Anyway, when Linux guys someday invents a nice idea to work arond
> increasing device trees, we can import it to U-Boot.
> It should be easy for us because we already have a similar build system.

Hmm, but would it be such a big problem to keep the general ARM and
SOC stuff in arch/arm/dts and the board-specific stuff in board/ ?

One of the problems with Linux is that their board-specific code is
spread all over the place, and I'm not sure we want to emulate it?

>
>> One benefit of the current approach is
>> that .dts files are split up by vendor. Even if we put the SoC .dtsi
>> files in arch/arm, perhaps there is a benefit in leaving the board
>> .dts files in board/<vendor>?
>
> I don't like the idea to split up by vendor.
>
> Now Xilinx has device trees both for ARM and Microblaze,
> resulting in totally unrelated device trees in one directory.

Shouldn't the SoC part go in arch/arm and arch/microblaze? Then just
the board-specific stuff can go in board/

>
> What if Freescale decided to adopt device tree?
> They support various boards on ARM, PowerPC, M68K.
>
> Renesus is the same. They have ARM and SuperH boards.

I'm not convinced yet. I think maybe you have forgotten about the
.dtsi files for SoCs. They are common, but no one is going to include
a board .dts file (nor can they), so putting them in a common area
does not seem like a win to me.

>
>
> On the other hand, different vendors can produce similar boards.
> For example avionic design, which develops Tegra boards,
> are using nVidia's sources.
>
> When I saw  board/nvidia/common/common.mk
> and board/avionic-design/*/Makefile, etc., I think we're screwed up
> with <vendor> directory.

Well the probably as I see it is that board/nvidia has some SoC code
that other boards want to use. The solution to that might be to move
the code to arch/arm/cpu/armv7/tegra... instead?

>
> Best Regards
> Masahiro Yamada
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild
  2014-02-15 23:38   ` Simon Glass
@ 2014-02-18  9:27     ` Masahiro Yamada
  2014-02-19  5:45       ` Simon Glass
  0 siblings, 1 reply; 18+ messages in thread
From: Masahiro Yamada @ 2014-02-18  9:27 UTC (permalink / raw)
  To: u-boot

Hello Simon,



> > Useful rules in scripts/Makefile.lib allows us to easily
> > generate a device tree blob and wrap it in assembly code.
> >
> > We do not need to parse a linker script to get output format and arch.
> >
> > This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb
> 
> I'd rather have the former and delete the latter temporary file as
> part of the build. u-boot.dtb is currently a build output.


This is what I have said in the thread
Re: [PATCH] dts: re-write dts/Makefile more simply with Kbuild

We must keep dts/dt.dtb to suppress the re-generation of dts/dt.dtb.

Besides,  dts/dt.dtb is a prerequisite of dts/dt.dtb.S 
when CONFIG_OF_EMBED is enabled.

I believe keeping dts/dt.dtb is reasonable enough.

Better to keep both?


Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-15 23:46       ` Simon Glass
@ 2014-02-18  9:43         ` Masahiro Yamada
  2014-02-19  6:06           ` Simon Glass
  0 siblings, 1 reply; 18+ messages in thread
From: Masahiro Yamada @ 2014-02-18  9:43 UTC (permalink / raw)
  To: u-boot

Hello Simon,


> >>
> >> On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> >> > Unlike Linux Kernel, U-Boot historically had *.dts files under
> >> > board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
> >> >
> >> > I think arch/$(ARCH)/dts dicretory is a better location
> >> > to store both *.dts and *.dtsi files.
> >> >
> >> > For example, before this commit, board/xilinx/dts directory
> >> > had both MicroBlaze dts (microblaze-generic.dts) and
> >> > ARM dts (zynq-*.dts), which are totally unrelated.
> >> >
> >> > This commit moves *.dts to arch/$(ARCH)/dts/ directories,
> >> > allowing us to describe nicely mutiple DTBs generation in the next commit.
> >>
> >> What is the motivation for this? I worry that we might end up with a
> >> lot of files in one directory.
> >
> > We have only 35 .dtsi and .dts for ARM.
> > I think it will be OK at least until we have 500.
> >
> > Linux v3.13 has 500 .dtsi and .dts files in arch/arm/boot/dts/
> > and they are still adding device trees to that directory.
> >
> > I have no idea if they will keep going, or someone will scream and turn
> > around.
> >
> > Anyway, when Linux guys someday invents a nice idea to work arond
> > increasing device trees, we can import it to U-Boot.
> > It should be easy for us because we already have a similar build system.
> 
> Hmm, but would it be such a big problem to keep the general ARM and
> SOC stuff in arch/arm/dts and the board-specific stuff in board/ ?
> One of the problems with Linux is that their board-specific code is
> spread all over the place, and I'm not sure we want to emulate it?

Opposite.
Board-specific code mostly resides under
arch/arm/mach-* or arch/arm/plat-*.
And what else is arch/arm/configs and arch/arm/boot/dts. That's it.


We have board-specific part
 - entries in boards.cfg
 - include/configs/<board_config>.h
 - board/<vendor>/<board> or board/<board>
 - arch/<ARCH>/include/am/arch-<soc> includes sometimes
   board-specific headers  as well as SoC specific headers.
   (Because there is no other place to store board-specific header files)

Various stuff under include/, for exmple
  - include/xilinx.h:  vendor specific?
  - include/sandboxblockdev.h:  arch specific?

And we often missed to remove remainders of dead boards.

U-Boot has more troublesome directory structure.


> >> One benefit of the current approach is
> >> that .dts files are split up by vendor. Even if we put the SoC .dtsi
> >> files in arch/arm, perhaps there is a benefit in leaving the board
> >> .dts files in board/<vendor>?
> >
> > I don't like the idea to split up by vendor.
> >
> > Now Xilinx has device trees both for ARM and Microblaze,
> > resulting in totally unrelated device trees in one directory.
> 
> Shouldn't the SoC part go in arch/arm and arch/microblaze? Then just
> the board-specific stuff can go in board/

What is SoC part? What is Board part?

> >
> > What if Freescale decided to adopt device tree?
> > They support various boards on ARM, PowerPC, M68K.
> >
> > Renesus is the same. They have ARM and SuperH boards.
> 
> I'm not convinced yet. I think maybe you have forgotten about the
> .dtsi files for SoCs. They are common, but no one is going to include
> a board .dts file (nor can they), so putting them in a common area
> does not seem like a win to me.

I do know that *.dtsi files are included from others, while
*.dts files are not included from anywhere.
And I understand your policy, *.dtsi to arch dir and *.dts to vendor dir.
(No that I care, we have two exceptions:
./board/avionic-design/dts/tegra20-tamonten.dtsi
./board/avionic-design/dts/tegra30-tamonten.dtsi)

If I have to mention a win,
we can save makefiles by not putting almost same ones in
vendor directories.


Anyway, we have 3 structures proposed so far.

[1] board/$(VENDOR)/dts/  (current structure)
[2] arch/$(ARCH)/dts/  (suggested by me)
[3] dts/  for all architectures (suggested by Scott)

In my option, [2] and [3] seem to be reasonable enough.

If we cannot reach an agreement,
shall we postpone 2/3 and 3/3 and apply only 1/3?


> > On the other hand, different vendors can produce similar boards.
> > For example avionic design, which develops Tegra boards,
> > are using nVidia's sources.
> >
> > When I saw  board/nvidia/common/common.mk
> > and board/avionic-design/*/Makefile, etc., I think we're screwed up
> > with <vendor> directory.
> 
> Well the probably as I see it is that board/nvidia has some SoC code
> that other boards want to use. The solution to that might be to move
> the code to arch/arm/cpu/armv7/tegra... instead?

Concerning the result, board/nvidia/common turned out to be
SoC-specific code, not Vendor-specific (board-specific) code.

But I guess the difference between SoC-specific code and board-specific
code was not clear when nVidia develpers posted that code first.

Maybe I am digressing, but it also happens to me quite often.
It is difficult for me to decide whether each code should
go to board/panasonic or arch/arm/cpu/armv7/uniphier.

I'd say, vendor (and board) directories are harmful.


Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-06  5:50     ` Masahiro Yamada
  2014-02-15 23:46       ` Simon Glass
@ 2014-02-18 14:32       ` Tom Rini
  2014-02-18 14:59         ` Michal Simek
  1 sibling, 1 reply; 18+ messages in thread
From: Tom Rini @ 2014-02-18 14:32 UTC (permalink / raw)
  To: u-boot

On Thu, Feb 06, 2014 at 02:50:50PM +0900, Masahiro Yamada wrote:
> Hello Simon,
> 
> 
> > Hi Masahiro,
> > 
> > On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> > > Unlike Linux Kernel, U-Boot historically had *.dts files under
> > > board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
> > >
> > > I think arch/$(ARCH)/dts dicretory is a better location
> > > to store both *.dts and *.dtsi files.
> > >
> > > For example, before this commit, board/xilinx/dts directory
> > > had both MicroBlaze dts (microblaze-generic.dts) and
> > > ARM dts (zynq-*.dts), which are totally unrelated.
> > >
> > > This commit moves *.dts to arch/$(ARCH)/dts/ directories,
> > > allowing us to describe nicely mutiple DTBs generation in the next commit.
> > 
> > What is the motivation for this? I worry that we might end up with a
> > lot of files in one directory.
> 
> We have only 35 .dtsi and .dts for ARM.
> I think it will be OK at least until we have 500.
> 
> Linux v3.13 has 500 .dtsi and .dts files in arch/arm/boot/dts/
> and they are still adding device trees to that directory.

Last I saw the plan, still, is to remove them from the kernel "someday".
Hopefully when that happens we can also leverage what comes next.

> I have no idea if they will keep going, or someone will scream and turn
> around.
> 
> Anyway, when Linux guys someday invents a nice idea to work arond
> increasing device trees, we can import it to U-Boot.
> It should be easy for us because we already have a similar build system.

True.

> > One benefit of the current approach is
> > that .dts files are split up by vendor. Even if we put the SoC .dtsi
> > files in arch/arm, perhaps there is a benefit in leaving the board
> > .dts files in board/<vendor>?
> 
> I don't like the idea to split up by vendor.
> 
> Now Xilinx has device trees both for ARM and Microblaze,
> resulting in totally unrelated device trees in one directory.

This, I think is backwards.  Xilinx has (and Freescale and others are or
will be joining them) a lot of things shared between them as IP blocks
get reused from non-ARM to ARM CPUs.  So there's a level of DT sharing
for these blocks between the CPUs.  The kernel is going to start having
this problem as vendors start dropping their arm IP blocks into ARMv8
SoCs, and those would be in arch/arm64/.  The question is, will people
care enough about the duplication, or just live with it.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140218/e0470c45/attachment.pgp>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-18 14:32       ` Tom Rini
@ 2014-02-18 14:59         ` Michal Simek
  0 siblings, 0 replies; 18+ messages in thread
From: Michal Simek @ 2014-02-18 14:59 UTC (permalink / raw)
  To: u-boot

On 02/18/2014 03:32 PM, Tom Rini wrote:
> On Thu, Feb 06, 2014 at 02:50:50PM +0900, Masahiro Yamada wrote:
>> Hello Simon,
>>
>>
>>> Hi Masahiro,
>>>
>>> On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
>>>> Unlike Linux Kernel, U-Boot historically had *.dts files under
>>>> board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
>>>>
>>>> I think arch/$(ARCH)/dts dicretory is a better location
>>>> to store both *.dts and *.dtsi files.
>>>>
>>>> For example, before this commit, board/xilinx/dts directory
>>>> had both MicroBlaze dts (microblaze-generic.dts) and
>>>> ARM dts (zynq-*.dts), which are totally unrelated.
>>>>
>>>> This commit moves *.dts to arch/$(ARCH)/dts/ directories,
>>>> allowing us to describe nicely mutiple DTBs generation in the next commit.
>>>
>>> What is the motivation for this? I worry that we might end up with a
>>> lot of files in one directory.
>>
>> We have only 35 .dtsi and .dts for ARM.
>> I think it will be OK at least until we have 500.
>>
>> Linux v3.13 has 500 .dtsi and .dts files in arch/arm/boot/dts/
>> and they are still adding device trees to that directory.
> 
> Last I saw the plan, still, is to remove them from the kernel "someday".
> Hopefully when that happens we can also leverage what comes next.
> 
>> I have no idea if they will keep going, or someone will scream and turn
>> around.
>>
>> Anyway, when Linux guys someday invents a nice idea to work arond
>> increasing device trees, we can import it to U-Boot.
>> It should be easy for us because we already have a similar build system.
> 
> True.
> 
>>> One benefit of the current approach is
>>> that .dts files are split up by vendor. Even if we put the SoC .dtsi
>>> files in arch/arm, perhaps there is a benefit in leaving the board
>>> .dts files in board/<vendor>?
>>
>> I don't like the idea to split up by vendor.
>>
>> Now Xilinx has device trees both for ARM and Microblaze,
>> resulting in totally unrelated device trees in one directory.
>
> This, I think is backwards.  Xilinx has (and Freescale and others are or
> will be joining them) a lot of things shared between them as IP blocks
> get reused from non-ARM to ARM CPUs.  So there's a level of DT sharing
> for these blocks between the CPUs.  The kernel is going to start having
> this problem as vendors start dropping their arm IP blocks into ARMv8
> SoCs, and those would be in arch/arm64/.  The question is, will people
> care enough about the duplication, or just live with it.

We share all soft IP drivers between ARM and Microblaze and we will continue
in this style. The point is to have the same binding which we have.
We are using device-tree generator to get the latest binding which is
in sync with kernel. When we adopt u-boot configured by device-tree
(when variable handling in u-boot is fixed) we will use the same binding
in uboot too.

I personally don't care where DTS files will be placed because we will
generate them as we are doing now.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140218/b0dc8f72/attachment.pgp>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild
  2014-02-18  9:27     ` Masahiro Yamada
@ 2014-02-19  5:45       ` Simon Glass
  2014-02-19  6:06         ` Masahiro Yamada
  0 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2014-02-19  5:45 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 18 February 2014 01:27, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Hello Simon,
>
>
>
>> > Useful rules in scripts/Makefile.lib allows us to easily
>> > generate a device tree blob and wrap it in assembly code.
>> >
>> > We do not need to parse a linker script to get output format and arch.
>> >
>> > This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb
>>
>> I'd rather have the former and delete the latter temporary file as
>> part of the build. u-boot.dtb is currently a build output.
>
>
> This is what I have said in the thread
> Re: [PATCH] dts: re-write dts/Makefile more simply with Kbuild
>
> We must keep dts/dt.dtb to suppress the re-generation of dts/dt.dtb.

OK. From memory when I did this, it was just a temporary file which
was used to create dts/dt.o. Make deleted it at the end of the build,
I think. But I may remember wrong, and it doesn't matter anyway.

>
> Besides,  dts/dt.dtb is a prerequisite of dts/dt.dtb.S
> when CONFIG_OF_EMBED is enabled.
>
> I believe keeping dts/dt.dtb is reasonable enough.
>
> Better to keep both?

Yes I think so.

Regards,
Simon

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild
  2014-02-19  5:45       ` Simon Glass
@ 2014-02-19  6:06         ` Masahiro Yamada
  2014-02-19  6:12           ` Simon Glass
  0 siblings, 1 reply; 18+ messages in thread
From: Masahiro Yamada @ 2014-02-19  6:06 UTC (permalink / raw)
  To: u-boot

Hello Simon,


On Tue, 18 Feb 2014 21:45:12 -0800
Simon Glass <sjg@chromium.org> wrote:

> Hi Masahiro,
> 
> On 18 February 2014 01:27, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> > Hello Simon,
> >
> >
> >
> >> > Useful rules in scripts/Makefile.lib allows us to easily
> >> > generate a device tree blob and wrap it in assembly code.
> >> >
> >> > We do not need to parse a linker script to get output format and arch.
> >> >
> >> > This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb
> >>
> >> I'd rather have the former and delete the latter temporary file as
> >> part of the build. u-boot.dtb is currently a build output.
> >
> >
> > This is what I have said in the thread
> > Re: [PATCH] dts: re-write dts/Makefile more simply with Kbuild
> >
> > We must keep dts/dt.dtb to suppress the re-generation of dts/dt.dtb.
> 
> OK. From memory when I did this, it was just a temporary file which
> was used to create dts/dt.o. Make deleted it at the end of the build,
> I think. But I may remember wrong, and it doesn't matter anyway.

I think dts/dt.o was deleted at the end
only when CONFIG_OF_SEPARATE=y
by the following rule.

  $(obj)u-boot.dtb:       checkdtc $(obj)u-boot
                  $(MAKE) $(build) dts binary
                  mv $(obj)dts/dt.dtb $@

It moves, not copies dts/dt.dtb.


> >
> > Besides,  dts/dt.dtb is a prerequisite of dts/dt.dtb.S
> > when CONFIG_OF_EMBED is enabled.
> >
> > I believe keeping dts/dt.dtb is reasonable enough.
> >
> > Better to keep both?
> 
> Yes I think so.


OK.
I will revive ./u-boot.dtb and post a new version.

And I will send it as a single patch
dropping 2/3 and 3/3.
Do you think it's better?

Many kbuild-related patches are being stuck on patchwork
and my local branch is getting messed up.
I don't want to delay this patch any more.


Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/
  2014-02-18  9:43         ` Masahiro Yamada
@ 2014-02-19  6:06           ` Simon Glass
  0 siblings, 0 replies; 18+ messages in thread
From: Simon Glass @ 2014-02-19  6:06 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 18 February 2014 01:43, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Hello Simon,
>
>
>> >>
>> >> On 4 February 2014 02:38, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
>> >> > Unlike Linux Kernel, U-Boot historically had *.dts files under
>> >> > board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
>> >> >
>> >> > I think arch/$(ARCH)/dts dicretory is a better location
>> >> > to store both *.dts and *.dtsi files.
>> >> >
>> >> > For example, before this commit, board/xilinx/dts directory
>> >> > had both MicroBlaze dts (microblaze-generic.dts) and
>> >> > ARM dts (zynq-*.dts), which are totally unrelated.
>> >> >
>> >> > This commit moves *.dts to arch/$(ARCH)/dts/ directories,
>> >> > allowing us to describe nicely mutiple DTBs generation in the next commit.
>> >>
>> >> What is the motivation for this? I worry that we might end up with a
>> >> lot of files in one directory.
>> >
>> > We have only 35 .dtsi and .dts for ARM.
>> > I think it will be OK at least until we have 500.
>> >
>> > Linux v3.13 has 500 .dtsi and .dts files in arch/arm/boot/dts/
>> > and they are still adding device trees to that directory.
>> >
>> > I have no idea if they will keep going, or someone will scream and turn
>> > around.
>> >
>> > Anyway, when Linux guys someday invents a nice idea to work arond
>> > increasing device trees, we can import it to U-Boot.
>> > It should be easy for us because we already have a similar build system.
>>
>> Hmm, but would it be such a big problem to keep the general ARM and
>> SOC stuff in arch/arm/dts and the board-specific stuff in board/ ?
>> One of the problems with Linux is that their board-specific code is
>> spread all over the place, and I'm not sure we want to emulate it?
>
> Opposite.
> Board-specific code mostly resides under
> arch/arm/mach-* or arch/arm/plat-*.
> And what else is arch/arm/configs and arch/arm/boot/dts. That's it.
>
>
> We have board-specific part
>  - entries in boards.cfg
>  - include/configs/<board_config>.h
>  - board/<vendor>/<board> or board/<board>
>  - arch/<ARCH>/include/am/arch-<soc> includes sometimes
>    board-specific headers  as well as SoC specific headers.
>    (Because there is no other place to store board-specific header files)
>
> Various stuff under include/, for exmple
>   - include/xilinx.h:  vendor specific?
>   - include/sandboxblockdev.h:  arch specific?
>
> And we often missed to remove remainders of dead boards.
>
> U-Boot has more troublesome directory structure.

Well Linux got board-specific directories and systems only relatively
recently I suppose. U-Boot has the benefit of many years of legacy :-)

>
>
>> >> One benefit of the current approach is
>> >> that .dts files are split up by vendor. Even if we put the SoC .dtsi
>> >> files in arch/arm, perhaps there is a benefit in leaving the board
>> >> .dts files in board/<vendor>?
>> >
>> > I don't like the idea to split up by vendor.
>> >
>> > Now Xilinx has device trees both for ARM and Microblaze,
>> > resulting in totally unrelated device trees in one directory.
>>
>> Shouldn't the SoC part go in arch/arm and arch/microblaze? Then just
>> the board-specific stuff can go in board/
>
> What is SoC part? What is Board part?

Well SoC is the chip from a vendor like Nvidia. Normally they would
provide a set of .dtsi files, say for example tegra20.dtsi,
tegra30.dtsi, etc. It makes sense to have a common SoC directory that
all boards can use.

Then a board that uses say a Tegra SoC on it can just include those
files and connect things up as required.

>
>> >
>> > What if Freescale decided to adopt device tree?
>> > They support various boards on ARM, PowerPC, M68K.
>> >
>> > Renesus is the same. They have ARM and SuperH boards.
>>
>> I'm not convinced yet. I think maybe you have forgotten about the
>> .dtsi files for SoCs. They are common, but no one is going to include
>> a board .dts file (nor can they), so putting them in a common area
>> does not seem like a win to me.
>
> I do know that *.dtsi files are included from others, while
> *.dts files are not included from anywhere.
> And I understand your policy, *.dtsi to arch dir and *.dts to vendor dir.
> (No that I care, we have two exceptions:
> ./board/avionic-design/dts/tegra20-tamonten.dtsi
> ./board/avionic-design/dts/tegra30-tamonten.dtsi)
>
> If I have to mention a win,
> we can save makefiles by not putting almost same ones in
> vendor directories.
>
>
> Anyway, we have 3 structures proposed so far.
>
> [1] board/$(VENDOR)/dts/  (current structure)
> [2] arch/$(ARCH)/dts/  (suggested by me)
> [3] dts/  for all architectures (suggested by Scott)
>
> In my option, [2] and [3] seem to be reasonable enough.
>
> If we cannot reach an agreement,
> shall we postpone 2/3 and 3/3 and apply only 1/3?
>

I don't want to hold up progress, but I am not sure that the Linux
approach is a great idea. I prefer this:

arch/$(ARCH)/dts   - SoC .dtsi files
board/$(VENDOR)/dts   - Board-specific .dts files (which include the above)

but as you say we don't have a lot of files so it is not a huge deal.

>
>> > On the other hand, different vendors can produce similar boards.
>> > For example avionic design, which develops Tegra boards,
>> > are using nVidia's sources.
>> >
>> > When I saw  board/nvidia/common/common.mk
>> > and board/avionic-design/*/Makefile, etc., I think we're screwed up
>> > with <vendor> directory.
>>
>> Well the probably as I see it is that board/nvidia has some SoC code
>> that other boards want to use. The solution to that might be to move
>> the code to arch/arm/cpu/armv7/tegra... instead?
>
> Concerning the result, board/nvidia/common turned out to be
> SoC-specific code, not Vendor-specific (board-specific) code.
>

Agreed, but we don't put .dtsi files in there, so that is a different problem.

> But I guess the difference between SoC-specific code and board-specific
> code was not clear when nVidia develpers posted that code first.
>
> Maybe I am digressing, but it also happens to me quite often.
> It is difficult for me to decide whether each code should
> go to board/panasonic or arch/arm/cpu/armv7/uniphier.
>
> I'd say, vendor (and board) directories are harmful.

Interesting...the idea with board files I think is that it is for code
specific to a board. My hope is that there would be less of that with
device tree, but it is early days.

You are right about the common directory in board/<vendor>. But this
is probably worth a wider discussion than just device tree files.

Regards,
Simon

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild
  2014-02-19  6:06         ` Masahiro Yamada
@ 2014-02-19  6:12           ` Simon Glass
  0 siblings, 0 replies; 18+ messages in thread
From: Simon Glass @ 2014-02-19  6:12 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 18 February 2014 22:06, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Hello Simon,
>
>
> On Tue, 18 Feb 2014 21:45:12 -0800
> Simon Glass <sjg@chromium.org> wrote:
>
>> Hi Masahiro,
>>
>> On 18 February 2014 01:27, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
>> > Hello Simon,
>> >
>> >
>> >
>> >> > Useful rules in scripts/Makefile.lib allows us to easily
>> >> > generate a device tree blob and wrap it in assembly code.
>> >> >
>> >> > We do not need to parse a linker script to get output format and arch.
>> >> >
>> >> > This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb
>> >>
>> >> I'd rather have the former and delete the latter temporary file as
>> >> part of the build. u-boot.dtb is currently a build output.
>> >
>> >
>> > This is what I have said in the thread
>> > Re: [PATCH] dts: re-write dts/Makefile more simply with Kbuild
>> >
>> > We must keep dts/dt.dtb to suppress the re-generation of dts/dt.dtb.
>>
>> OK. From memory when I did this, it was just a temporary file which
>> was used to create dts/dt.o. Make deleted it at the end of the build,
>> I think. But I may remember wrong, and it doesn't matter anyway.
>
> I think dts/dt.o was deleted at the end
> only when CONFIG_OF_SEPARATE=y
> by the following rule.
>
>   $(obj)u-boot.dtb:       checkdtc $(obj)u-boot
>                   $(MAKE) $(build) dts binary
>                   mv $(obj)dts/dt.dtb $@
>
> It moves, not copies dts/dt.dtb.
>
>
>> >
>> > Besides,  dts/dt.dtb is a prerequisite of dts/dt.dtb.S
>> > when CONFIG_OF_EMBED is enabled.
>> >
>> > I believe keeping dts/dt.dtb is reasonable enough.
>> >
>> > Better to keep both?
>>
>> Yes I think so.
>
>
> OK.
> I will revive ./u-boot.dtb and post a new version.
>
> And I will send it as a single patch
> dropping 2/3 and 3/3.
> Do you think it's better?
>
> Many kbuild-related patches are being stuck on patchwork
> and my local branch is getting messed up.
> I don't want to delay this patch any more.

Agreed, I look forward to all your series being merged, a bit step
forward for U-Boot.

Regards,
Simon

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-02-19  6:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-04  9:38 [U-Boot] [PATCH v2 0/3] Simplify dts/Makefile and support multiple DTBs generation Masahiro Yamada
2014-02-04  9:38 ` [U-Boot] [PATCH v2 1/3] dts: re-write dts/Makefile more simply with Kbuild Masahiro Yamada
2014-02-15 23:38   ` Simon Glass
2014-02-18  9:27     ` Masahiro Yamada
2014-02-19  5:45       ` Simon Glass
2014-02-19  6:06         ` Masahiro Yamada
2014-02-19  6:12           ` Simon Glass
2014-02-04  9:38 ` [U-Boot] [PATCH v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/ Masahiro Yamada
2014-02-05 21:47   ` Simon Glass
2014-02-06  5:50     ` Masahiro Yamada
2014-02-15 23:46       ` Simon Glass
2014-02-18  9:43         ` Masahiro Yamada
2014-02-19  6:06           ` Simon Glass
2014-02-18 14:32       ` Tom Rini
2014-02-18 14:59         ` Michal Simek
2014-02-07 18:26     ` Scott Wood
2014-02-04  9:38 ` [U-Boot] [PATCH v2 3/3] dts: generate multiple device tree blobs Masahiro Yamada
2014-02-15 23:39   ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.