Skip to contentSkip to conversation

Simplify dts/Makefile and support multiple DTBs generation

PATCH New Masahiro Yamada 5 participants 17 messages Feb 5, 2014 – Jun 2, 2014

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v3 cover Simplify dts/Makefile and support multiple DTBs generation

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
(Multiple DTBs generation was suggested by Simon.)

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

Changes in v3:
- Fix build error for x86 architecture
- Change shorten log CP to COPY

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
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

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.

---

Changes in v3: None
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
.gitignore +0 -1
index 24019b3..5882ff5 100644
@@ -48,7 +48,6 @@
 /u-boot.lds
 /u-boot.ubl
 /u-boot.ais
-/u-boot.dtb
 /u-boot.sb
 
 #
Makefile +8 -8
index cb9c243..b425bfb 100644
@@ -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
 
arch/arm/lib/board.c +1 -1
index b770e25..38b9c7d 100644
@@ -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);
arch/microblaze/lib/board.c +1 -1
index 59956a8..fafeeae 100644
@@ -87,7 +87,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;
arch/x86/lib/init_helpers.c +1 -1
index 582c0ff..b5d937f 100644
@@ -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;
common/board_f.c +1 -1
index aa70c3e..d0ee6f7 100644
@@ -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
dts/.gitignore new file +2 -0
new file mode 100644
index 0000000..1b37180
@@ -0,0 +1,2 @@
+*.dtb
+*.dtb.S
dts/Makefile +20 -52

84 lines not on this page · raw message

include/common.h +1 -1
index c15e5a4..b590f3a 100644
@@ -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);
scripts/Makefile.lib +6 -6
index d4b5cb5..ee3ceac 100644
@@ -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)
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

Hi,

Quoted 8 lines · Masahiro Yamada

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.

Sorry I left comments on v2.

Regards,
Simon

#3 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

In reply to Masahiro Yamada
Quoted 8 lines · Masahiro Yamada

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
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/20140219/76e0d26e/attachment.pgp>
#4 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

Hello Tom, Simon,

Quoted 5 lines · On Wed, 19 Feb 2014 16:11:11 -0500 Tom Rini <[email protected]> wrote:
Quoted 3 lines · Masahiro Yamada

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

Quoted 10 lines
Quoted 5 lines

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.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom

Ditto.
Possibly it was missed because Simon and I were discussing in version 2 thread.

Quoted 14 lines
Quoted 9 lines
Quoted 7 lines

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.

Quoted 7 lines

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.

I was planning to post a new version.
But before that, version 3 was applied.

So, what should I do?
Shall I post a follow-up patch to revive a
device tree at the top directory (./u-boot.dtb) ?

Best Regards
Masahiro Yamada

#5 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

Quoted 50 lines · Masahiro Yamada

Hello Tom, Simon,

Quoted 5 lines · On Wed, 19 Feb 2014 16:11:11 -0500 Tom Rini <[email protected]> wrote:
Quoted 3 lines · Masahiro Yamada

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

Quoted 10 lines
Quoted 5 lines

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.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom

Ditto.
Possibly it was missed because Simon and I were discussing in version 2 thread.

Quoted 14 lines
Quoted 9 lines
Quoted 7 lines

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.

Quoted 7 lines

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.

Quoted 6 lines

I was planning to post a new version.
But before that, version 3 was applied.

So, what should I do?
Shall I post a follow-up patch to revive a
device tree at the top directory (./u-boot.dtb) ?

heh, so this is what happens when I try and get ahead of the curve :) Just do a follow up to bring things into line with what you and Simon had agreed on.

Signature · 8 lines
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/20140220/5f5100f0/attachment.pgp>
#6 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

In reply to Masahiro Yamada
Quoted 15 lines · Masahiro Yamada

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.

---

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

<snip>

arch/arm/lib/board.c void board_init_f(ulong bootflag) · line 283

Quoted 11 lines
arch/arm/lib/board.c +1 -1
index b770e25..38b9c7d 100644
@@ -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;

Is this a typo? I believe it should be __dtb_dt_begin. Did anyone see the compiling error?

York

#7 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

Hi York,

Quoted 5 lines
Quoted 5 lines
arch/arm/lib/board.c +0 -0
index b770e25..38b9c7d 100644
@@ -280,7 +280,7 @@ void board_init_f(ulong bootflag)
Quoted 8 lines

arch/arm/lib/board.c void board_init_f(ulong bootflag) · line 283

Quoted 5 lines
arch/arm/lib/board.c +1 -1
 	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;

Is this a typo? I believe it should be __dtb_dt_begin. Did anyone see the compiling error?

Yes, it's a typo.
I had already posted a patch.
http://patchwork.ozlabs.org/patch/342815/

Even such a simple one has been waiting for more than one month in Patchwork queue.
:-(

For now, CONFIG_OF_EMBED is defined for MicroBlaze. I guess nobody saw the compile error.

Best Regards
Masahiro Yamada]

#8 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

Hi,

Quoted 21 lines · Masahiro Yamada

Hi York,

Quoted 5 lines
Quoted 5 lines
arch/arm/lib/board.c +0 -0
index b770e25..38b9c7d 100644
@@ -280,7 +280,7 @@ void board_init_f(ulong bootflag)
Quoted 8 lines

arch/arm/lib/board.c void board_init_f(ulong bootflag) · line 283

Quoted 5 lines
arch/arm/lib/board.c +1 -1
    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;

Is this a typo? I believe it should be __dtb_dt_begin. Did anyone see the compiling error?

Yes, it's a typo.
I had already posted a patch.
http://patchwork.ozlabs.org/patch/342815/

Quoted 6 lines

Even such a simple one has been waiting for more than one month in Patchwork queue.
:-(

For now, CONFIG_OF_EMBED is defined for MicroBlaze. I guess nobody saw the compile error.

I suspect all boards that use CONFIG_OF_CONTROL also use generic board now. I expect that this file will be deleted at the end of the year.

Regards,
Simon

maintainer
#9 lore raw

PATCH v3 1/3 dts: re-write dts/Makefile more simply with Kbuild

Quoted 28 lines · Simon Glass

Hi,

Quoted 25 lines · Masahiro Yamada

Hi York,

Quoted 5 lines
Quoted 5 lines
arch/arm/lib/board.c +0 -0
index b770e25..38b9c7d 100644
@@ -280,7 +280,7 @@ void board_init_f(ulong bootflag)
Quoted 8 lines

arch/arm/lib/board.c void board_init_f(ulong bootflag) · line 283

Quoted 5 lines
arch/arm/lib/board.c +1 -1
    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;

Is this a typo? I believe it should be __dtb_dt_begin. Did anyone see the compiling error?

Yes, it's a typo.
I had already posted a patch.
http://patchwork.ozlabs.org/patch/342815/

Even such a simple one has been waiting for more than one month in Patchwork queue.
:-(

Quoted 5 lines
Quoted 2 lines

For now, CONFIG_OF_EMBED is defined for MicroBlaze. I guess nobody saw the compile error.

I suspect all boards that use CONFIG_OF_CONTROL also use generic board now. I expect that this file will be deleted at the end of the year.

No. Microblaze has no generic board support yet.
For zynq I have sent patches out but they will be merged in the next merge window.

Thanks,
Michal

Signature · 14 lines
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/20140602/b25c01bd/attachment.pgp>
#10 lore raw

PATCH v3 2/3 dts: move device tree sources to arch/$(ARCH)/dts/

In reply to Masahiro Yamada

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.

---

Changes in v3: None
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%)
arch/arm/dts/exynos5250-arndale.dts renamed from board/samsung/dts/exynos5250-arndale.dts +0 -0
similarity index 100%
rename from board/samsung/dts/exynos5250-arndale.dts
rename to arch/arm/dts/exynos5250-arndale.dts
arch/arm/dts/exynos5250-smdk5250.dts renamed from board/samsung/dts/exynos5250-smdk5250.dts +0 -0
similarity index 100%
rename from board/samsung/dts/exynos5250-smdk5250.dts
rename to arch/arm/dts/exynos5250-smdk5250.dts
arch/arm/dts/exynos5250-snow.dts renamed from board/samsung/dts/exynos5250-snow.dts +0 -0
similarity index 100%
rename from board/samsung/dts/exynos5250-snow.dts
rename to arch/arm/dts/exynos5250-snow.dts
arch/arm/dts/exynos5420-smdk5420.dts renamed from board/samsung/dts/exynos5420-smdk5420.dts +0 -0
similarity index 100%
rename from board/samsung/dts/exynos5420-smdk5420.dts
rename to arch/arm/dts/exynos5420-smdk5420.dts
arch/arm/dts/tegra114-dalmore.dts renamed from board/nvidia/dts/tegra114-dalmore.dts +0 -0
similarity index 100%
rename from board/nvidia/dts/tegra114-dalmore.dts
rename to arch/arm/dts/tegra114-dalmore.dts
arch/arm/dts/tegra20-colibri_t20_iris.dts renamed from board/toradex/dts/tegra20-colibri_t20_iris.dts +0 -0
similarity index 100%
rename from board/toradex/dts/tegra20-colibri_t20_iris.dts
rename to arch/arm/dts/tegra20-colibri_t20_iris.dts
arch/arm/dts/tegra20-harmony.dts renamed from board/nvidia/dts/tegra20-harmony.dts +0 -0
similarity index 100%
rename from board/nvidia/dts/tegra20-harmony.dts
rename to arch/arm/dts/tegra20-harmony.dts
arch/arm/dts/tegra20-medcom-wide.dts renamed from board/avionic-design/dts/tegra20-medcom-wide.dts +0 -0
similarity index 100%
rename from board/avionic-design/dts/tegra20-medcom-wide.dts
rename to arch/arm/dts/tegra20-medcom-wide.dts
arch/arm/dts/tegra20-paz00.dts renamed from board/compal/dts/tegra20-paz00.dts +0 -0
similarity index 100%
rename from board/compal/dts/tegra20-paz00.dts
rename to arch/arm/dts/tegra20-paz00.dts
arch/arm/dts/tegra20-plutux.dts renamed from board/avionic-design/dts/tegra20-plutux.dts +0 -0
similarity index 100%
rename from board/avionic-design/dts/tegra20-plutux.dts
rename to arch/arm/dts/tegra20-plutux.dts
arch/arm/dts/tegra20-seaboard.dts renamed from board/nvidia/dts/tegra20-seaboard.dts +0 -0
similarity index 100%
rename from board/nvidia/dts/tegra20-seaboard.dts
rename to arch/arm/dts/tegra20-seaboard.dts
arch/arm/dts/tegra20-tamonten.dtsi renamed from board/avionic-design/dts/tegra20-tamonten.dtsi +0 -0
similarity index 100%
rename from board/avionic-design/dts/tegra20-tamonten.dtsi
rename to arch/arm/dts/tegra20-tamonten.dtsi
arch/arm/dts/tegra20-tec.dts renamed from board/avionic-design/dts/tegra20-tec.dts +0 -0
similarity index 100%
rename from board/avionic-design/dts/tegra20-tec.dts
rename to arch/arm/dts/tegra20-tec.dts
arch/arm/dts/tegra20-trimslice.dts renamed from board/compulab/dts/tegra20-trimslice.dts +0 -0
similarity index 100%
rename from board/compulab/dts/tegra20-trimslice.dts
rename to arch/arm/dts/tegra20-trimslice.dts
arch/arm/dts/tegra20-ventana.dts renamed from board/nvidia/dts/tegra20-ventana.dts +0 -0
similarity index 100%
rename from board/nvidia/dts/tegra20-ventana.dts
rename to arch/arm/dts/tegra20-ventana.dts
arch/arm/dts/tegra20-whistler.dts renamed from board/nvidia/dts/tegra20-whistler.dts +0 -0
similarity index 100%
rename from board/nvidia/dts/tegra20-whistler.dts
rename to arch/arm/dts/tegra20-whistler.dts
arch/arm/dts/tegra30-beaver.dts renamed from board/nvidia/dts/tegra30-beaver.dts +0 -0
similarity index 100%
rename from board/nvidia/dts/tegra30-beaver.dts
rename to arch/arm/dts/tegra30-beaver.dts
arch/arm/dts/tegra30-cardhu.dts renamed from board/nvidia/dts/tegra30-cardhu.dts +0 -0
similarity index 100%
rename from board/nvidia/dts/tegra30-cardhu.dts
rename to arch/arm/dts/tegra30-cardhu.dts
arch/arm/dts/tegra30-tamonten.dtsi renamed from board/avionic-design/dts/tegra30-tamonten.dtsi +0 -0
similarity index 100%
rename from board/avionic-design/dts/tegra30-tamonten.dtsi
rename to arch/arm/dts/tegra30-tamonten.dtsi
arch/arm/dts/tegra30-tec-ng.dts renamed from board/avionic-design/dts/tegra30-tec-ng.dts +0 -0
similarity index 100%
rename from board/avionic-design/dts/tegra30-tec-ng.dts
rename to arch/arm/dts/tegra30-tec-ng.dts
arch/arm/dts/zynq-microzed.dts renamed from board/xilinx/dts/zynq-microzed.dts +0 -0
similarity index 100%
rename from board/xilinx/dts/zynq-microzed.dts
rename to arch/arm/dts/zynq-microzed.dts
arch/arm/dts/zynq-zc702.dts renamed from board/xilinx/dts/zynq-zc702.dts +0 -0
similarity index 100%
rename from board/xilinx/dts/zynq-zc702.dts
rename to arch/arm/dts/zynq-zc702.dts
arch/arm/dts/zynq-zc706.dts renamed from board/xilinx/dts/zynq-zc706.dts +0 -0
similarity index 100%
rename from board/xilinx/dts/zynq-zc706.dts
rename to arch/arm/dts/zynq-zc706.dts
arch/arm/dts/zynq-zc770-xm010.dts renamed from board/xilinx/dts/zynq-zc770-xm010.dts +0 -0
similarity index 100%
rename from board/xilinx/dts/zynq-zc770-xm010.dts
rename to arch/arm/dts/zynq-zc770-xm010.dts
arch/arm/dts/zynq-zc770-xm012.dts renamed from board/xilinx/dts/zynq-zc770-xm012.dts +0 -0
similarity index 100%
rename from board/xilinx/dts/zynq-zc770-xm012.dts
rename to arch/arm/dts/zynq-zc770-xm012.dts
arch/arm/dts/zynq-zc770-xm013.dts renamed from board/xilinx/dts/zynq-zc770-xm013.dts +0 -0
similarity index 100%
rename from board/xilinx/dts/zynq-zc770-xm013.dts
rename to arch/arm/dts/zynq-zc770-xm013.dts
arch/arm/dts/zynq-zed.dts renamed from board/xilinx/dts/zynq-zed.dts +0 -0
similarity index 100%
rename from board/xilinx/dts/zynq-zed.dts
rename to arch/arm/dts/zynq-zed.dts
arch/microblaze/dts/microblaze-generic.dts renamed from board/xilinx/dts/microblaze-generic.dts +0 -0
similarity index 100%
rename from board/xilinx/dts/microblaze-generic.dts
rename to arch/microblaze/dts/microblaze-generic.dts
arch/x86/dts/alex.dts renamed from board/chromebook-x86/dts/alex.dts +0 -0
similarity index 100%
rename from board/chromebook-x86/dts/alex.dts
rename to arch/x86/dts/alex.dts
arch/x86/dts/link.dts renamed from board/chromebook-x86/dts/link.dts +0 -0
similarity index 100%
rename from board/chromebook-x86/dts/link.dts
rename to arch/x86/dts/link.dts
dts/Makefile +2 -2
index c47fba7..5d2abd9 100644
@@ -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)
scripts/Makefile.lib +0 -1
index ee3ceac..02b17b1 100644
@@ -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__
 
Signature · 1 line
1.8.3.2
#11 lore raw

PATCH v3 2/3 dts: move device tree sources to arch/$(ARCH)/dts/

Quoted 6 lines · Masahiro Yamada

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.

Quoted 8 lines

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
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/20140219/097637ba/attachment.pgp>
#12 lore raw

PATCH v3 2/3 dts: move device tree sources to arch/$(ARCH)/dts/

Hello Tom, Simon

Quoted 10 lines
Quoted 10 lines

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.

Quoted 9 lines
Quoted 4 lines

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

Applied to u-boot/master, thanks!

Signature · 1 line
Tom

This series was applied sooner than I had expected. Simon and I were still discussing this series.

So I am afraid Simon is really not happy about it
because he was opposed to moving *.dts files
from vendor directories to arch directories.

Tom also mentioned as follows:

Quoted 4 lines

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.

I'd like to know Tom's option about the device tree structure. Let me confirm if my patch is doing right thing.

Best Regards
Masahiro Yamada

#13 lore raw

PATCH v3 2/3 dts: move device tree sources to arch/$(ARCH)/dts/

Quoted 30 lines · Masahiro Yamada

Hello Tom, Simon

Quoted 10 lines
Quoted 10 lines

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.

Quoted 9 lines
Quoted 4 lines

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

Applied to u-boot/master, thanks!

Signature · 1 line
Tom

This series was applied sooner than I had expected. Simon and I were still discussing this series.

So I am afraid Simon is really not happy about it
because he was opposed to moving *.dts files
from vendor directories to arch directories.

Quoted 8 lines

Tom also mentioned as follows:

Quoted 4 lines

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.

I'd like to know Tom's option about the device tree structure. Let me confirm if my patch is doing right thing.

So, for clarity, yes, I this this is the right way to go and we should focus our "we can do better" efforts on the discussion that is / will be happening with the kernel folks about how things should be handled once all these blobs move out of the kernel as that'll be something we want to leverage too.

Signature · 8 lines
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/20140220/80b06850/attachment.pgp>
#14 lore raw

PATCH v3 3/3 dts: generate multiple device tree blobs

In reply to Masahiro Yamada

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

---

Changes in v3:
- Fix build error for x86 architecture
- Change shorten log CP to COPY

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
arch/arm/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/arm/dts/Makefile new file +37 -0
new file mode 100644
index 0000000..2658911
@@ -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
arch/microblaze/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/microblaze/dts/Makefile new file +11 -0
new file mode 100644
index 0000000..6d4a11f
@@ -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
arch/x86/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/x86/dts/Makefile new file +12 -0
new file mode 100644
index 0000000..48265ef
@@ -0,0 +1,12 @@
+dtb-y += link.dtb \
+	alex.dtb
+
+targets += $(dtb-y)
+
+DTC_FLAGS += -R 4 -p 0x1000
+
+PHONY += dtbs
+dtbs: $(addprefix $(obj)/, $(dtb-y))
+	@:
+
+clean-files := *.dtb
dts/Makefile +20 -11
index 5d2abd9..9907463 100644
@@ -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_copy = COPY    $@
+      cmd_copy = cp $< $@
 
-$(obj)/dt.dtb: $(DTS) FORCE
-	$(call if_changed_dep,dtc)
+$(obj)/dt.dtb: $(DTB) FORCE
+	$(call if_changed,copy)
 
 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=<device_tree>' 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
Signature · 1 line
1.8.3.2
#15 lore raw

PATCH v3 3/3 dts: generate multiple device tree blobs

Hi,

Quoted 10 lines · Masahiro Yamada

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

Please see my comments on v2.

Regards,
Simon

#16 lore raw

PATCH v3 3/3 dts: generate multiple device tree blobs

In reply to Masahiro Yamada
Quoted 10 lines · Masahiro Yamada

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

Applied to u-boot/master, thanks!

Signature · 8 lines
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/20140219/f0e11826/attachment.pgp>