Skip to contentSkip to conversation

arm/dt: Add a make rule to build dtb for enabled boards

PATCH New Shawn Guo 3 participants 4 messages Apr 4, 2011 – Apr 5, 2011

Subsystems (7)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH v2 1/1 arm/dt: Add a make rule to build dtb for enabled boards

With 'make ARCH=arm dtb', it builds Device Tree Blobs for those boards enabled by build CONFIG.

---
It's based on commit fe8e6d0b0e601ca0a63fe768d4b812d5a45a9da7 "arm/dt: Add dtb make rule" from Rob Herring. And it works against Linaro kernel tree. But it needs to go through mainline review before it gets applied.

Changes since v1:
* Take suggestion from Rob Herring to move .dts dection into machine sepcific Makefile.boot, so that arch/arm/boot/Makefile can be as clean as it is.

 arch/arm/Makefile                     |    3 +++
 arch/arm/boot/Makefile                |    2 ++
 arch/arm/mach-exynos4/Makefile.boot   |    2 ++
 arch/arm/mach-mx5/Makefile.boot       |    5 +++++
 arch/arm/mach-omap2/Makefile.boot     |    4 ++++
 arch/arm/mach-tegra/Makefile.boot     |    2 ++
 arch/arm/mach-versatile/Makefile.boot |    2 ++
 7 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/Makefile +3 -0
index d51ab6c..7fd2af9 100644
@@ -292,6 +292,9 @@ zinstall uinstall install: vmlinux
 %.dtb:
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
 
+dtb:
+	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
+
 # We use MRPROPER_FILES and CLEAN_FILES now
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
arch/arm/boot/Makefile +2 -0
index 08fc37f..ce39850 100644
@@ -63,6 +63,8 @@ endif
 $(obj)/%.dtb: $(src)/dts/%.dts
 	$(call cmd,dtc)
 
+$(obj)/dtb: $(addprefix $(obj)/, $(dtb-y))
+
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
 		   -C none -a $(LOADADDR) -e $(STARTADDR) \
arch/arm/mach-exynos4/Makefile.boot +2 -0
index d65956f..fcee6b5 100644
@@ -1,2 +1,4 @@
    zreladdr-y	:= 0x40008000
 params_phys-y	:= 0x40000100
+
+dtb-$(CONFIG_MACH_SMDKV310) += exynos4-smdkv310.dtb
arch/arm/mach-mx5/Makefile.boot +5 -0
index e928be1..4111462 100644
@@ -7,3 +7,8 @@ initrd_phys-$(CONFIG_ARCH_MX51)	:= 0x90800000
    zreladdr-$(CONFIG_ARCH_MX53)	:= 0x70008000
 params_phys-$(CONFIG_ARCH_MX53)	:= 0x70000100
 initrd_phys-$(CONFIG_ARCH_MX53)	:= 0x70800000
+
+dtb-$(CONFIG_MACH_MX51_BABBAGE) += mx51-babbage.dtb
+dtb-$(CONFIG_MACH_MX51_EFIKAMX) += genesi-efikamx.dtb
+dtb-$(CONFIG_MACH_MX51_EFIKASB) += genesi-efikasb.dtb
+dtb-$(CONFIG_MACH_MX53_LOCO) += mx53-loco.dtb
arch/arm/mach-omap2/Makefile.boot +4 -0
index 565aff7..0f54901 100644
@@ -1,3 +1,7 @@
   zreladdr-y		:= 0x80008000
 params_phys-y		:= 0x80000100
 initrd_phys-y		:= 0x80800000
+
+dtb-$(CONFIG_MACH_OMAP3_BEAGLE) += omap3-beagle.dtb
+dtb-$(CONFIG_MACH_OMAP4_PANDA) += omap4-panda.dtb
+dtb-$(CONFIG_MACH_OVERO) += omap3-overo.dtb
arch/arm/mach-tegra/Makefile.boot +2 -0
index db52d61..c98addf 100644
@@ -1,3 +1,5 @@
 zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00008000
 params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00000100
 initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00800000
+
+dtb-$(CONFIG_MACH_HARMONY) += tegra-harmony.dtb
arch/arm/mach-versatile/Makefile.boot +2 -0
index c7e75ac..e2227d3 100644
@@ -2,3 +2,5 @@
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
 
+dtb-$(CONFIG_ARCH_VERSATILE_PB) += versatile-pb.dtb
+dtb-$(CONFIG_MACH_VERSATILE_AB) += versatile-ab.dtb
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 1/1 arm/dt: Add a make rule to build dtb for enabled boards

Quoted 10 lines · Shawn Guo

With 'make ARCH=arm dtb', it builds Device Tree Blobs for those boards enabled by build CONFIG.

---
It's based on commit fe8e6d0b0e601ca0a63fe768d4b812d5a45a9da7 "arm/dt: Add dtb make rule" from Rob Herring. And it works against Linaro kernel tree. But it needs to go through mainline review before it gets applied.

Quoted 4 lines

Changes since v1:
* Take suggestion from Rob Herring to move .dts dection into machine sepcific Makefile.boot, so that arch/arm/boot/Makefile can be as clean as it is.

Looks good, some minor comments below, but I've picked it up and asked Nicolas to merge it.

Cheers,
g.

Quoted 15 lines
 arch/arm/Makefile                     |    3 +++
 arch/arm/boot/Makefile                |    2 ++
 arch/arm/mach-exynos4/Makefile.boot   |    2 ++
 arch/arm/mach-mx5/Makefile.boot       |    5 +++++
 arch/arm/mach-omap2/Makefile.boot     |    4 ++++
 arch/arm/mach-tegra/Makefile.boot     |    2 ++
 arch/arm/mach-versatile/Makefile.boot |    2 ++
 7 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/Makefile +0 -0
index d51ab6c..7fd2af9 100644

arch/arm/Makefile zinstall uinstall install: vmlinux · line 297

Quoted 6 lines
arch/arm/Makefile +3 -0
@@ -292,6 +292,9 @@ zinstall uinstall install: vmlinux
 %.dtb:
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
 
+dtb:
+	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
+

Since the target is the same, I've merged this rule with the %.dtb rule. I also renamed the target 'dtbs' because it will build more than one .dtb file.

Quoted 77 lines
arch/arm/Makefile +0 -0
 # We use MRPROPER_FILES and CLEAN_FILES now
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
arch/arm/boot/Makefile +2 -0
index 08fc37f..ce39850 100644
@@ -63,6 +63,8 @@ endif
 $(obj)/%.dtb: $(src)/dts/%.dts
 	$(call cmd,dtc)
 
+$(obj)/dtb: $(addprefix $(obj)/, $(dtb-y))
+
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
 		   -C none -a $(LOADADDR) -e $(STARTADDR) \
arch/arm/mach-exynos4/Makefile.boot +2 -0
index d65956f..fcee6b5 100644
@@ -1,2 +1,4 @@
    zreladdr-y	:= 0x40008000
 params_phys-y	:= 0x40000100
+
+dtb-$(CONFIG_MACH_SMDKV310) += exynos4-smdkv310.dtb
arch/arm/mach-mx5/Makefile.boot +5 -0
index e928be1..4111462 100644
@@ -7,3 +7,8 @@ initrd_phys-$(CONFIG_ARCH_MX51)	:= 0x90800000
    zreladdr-$(CONFIG_ARCH_MX53)	:= 0x70008000
 params_phys-$(CONFIG_ARCH_MX53)	:= 0x70000100
 initrd_phys-$(CONFIG_ARCH_MX53)	:= 0x70800000
+
+dtb-$(CONFIG_MACH_MX51_BABBAGE) += mx51-babbage.dtb
+dtb-$(CONFIG_MACH_MX51_EFIKAMX) += genesi-efikamx.dtb
+dtb-$(CONFIG_MACH_MX51_EFIKASB) += genesi-efikasb.dtb
+dtb-$(CONFIG_MACH_MX53_LOCO) += mx53-loco.dtb
arch/arm/mach-omap2/Makefile.boot +4 -0
index 565aff7..0f54901 100644
@@ -1,3 +1,7 @@
   zreladdr-y		:= 0x80008000
 params_phys-y		:= 0x80000100
 initrd_phys-y		:= 0x80800000
+
+dtb-$(CONFIG_MACH_OMAP3_BEAGLE) += omap3-beagle.dtb
+dtb-$(CONFIG_MACH_OMAP4_PANDA) += omap4-panda.dtb
+dtb-$(CONFIG_MACH_OVERO) += omap3-overo.dtb
arch/arm/mach-tegra/Makefile.boot +2 -0
index db52d61..c98addf 100644
@@ -1,3 +1,5 @@
 zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00008000
 params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00000100
 initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00800000
+
+dtb-$(CONFIG_MACH_HARMONY) += tegra-harmony.dtb
arch/arm/mach-versatile/Makefile.boot +2 -0
index c7e75ac..e2227d3 100644
@@ -2,3 +2,5 @@
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
 
+dtb-$(CONFIG_ARCH_VERSATILE_PB) += versatile-pb.dtb
+dtb-$(CONFIG_MACH_VERSATILE_AB) += versatile-ab.dtb
Signature · 6 lines
1.7.1

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
#2 lore raw

PATCH v2 1/1 arm/dt: Add a make rule to build dtb for enabled boards

Quoted 40 lines · Grant Likely
Quoted 10 lines · Shawn Guo

With 'make ARCH=arm dtb', it builds Device Tree Blobs for those boards enabled by build CONFIG.

---
It's based on commit fe8e6d0b0e601ca0a63fe768d4b812d5a45a9da7 "arm/dt: Add dtb make rule" from Rob Herring. And it works against Linaro kernel tree. But it needs to go through mainline review before it gets applied.

Quoted 4 lines

Changes since v1:
* Take suggestion from Rob Herring to move .dts dection into machine sepcific Makefile.boot, so that arch/arm/boot/Makefile can be as clean as it is.

Looks good, some minor comments below, but I've picked it up and asked Nicolas to merge it.

Cheers,
g.

Quoted 18 lines
 arch/arm/Makefile                     |    3 +++
 arch/arm/boot/Makefile                |    2 ++
 arch/arm/mach-exynos4/Makefile.boot   |    2 ++
 arch/arm/mach-mx5/Makefile.boot       |    5 +++++
 arch/arm/mach-omap2/Makefile.boot     |    4 ++++
 arch/arm/mach-tegra/Makefile.boot     |    2 ++
 arch/arm/mach-versatile/Makefile.boot |    2 ++
 7 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/Makefile +0 -0
index d51ab6c..7fd2af9 100644
@@ -292,6 +292,9 @@ zinstall uinstall install: vmlinux
 %.dtb:
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
 
Quoted 8 lines

arch/arm/Makefile zinstall uinstall install: vmlinux · line 297

Quoted 3 lines
arch/arm/Makefile +3 -0
+dtb:
+	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
+

Since the target is the same, I've merged this rule with the %.dtb rule. I also renamed the target 'dtbs' because it will build more than one .dtb file.

I started with 'dtbs' as target name, and later changed it to 'dtb' to align with $(dtb-y). And 'dtbs' looks truly fine for me, but you may want to change commit message accordingly, as there is 'make ARCH=arm dtb' in it.

Signature · 2 lines
Regards,
Shawn
#3 lore raw

PATCH v2 1/1 arm/dt: Add a make rule to build dtb for enabled boards

Quoted 49 lines · Shawn Guo
Quoted 40 lines · Grant Likely
Quoted 10 lines · Shawn Guo

With 'make ARCH=arm dtb', it builds Device Tree Blobs for those boards enabled by build CONFIG.

---
It's based on commit fe8e6d0b0e601ca0a63fe768d4b812d5a45a9da7 "arm/dt: Add dtb make rule" from Rob Herring. And it works against Linaro kernel tree. But it needs to go through mainline review before it gets applied.

Quoted 4 lines

Changes since v1:
* Take suggestion from Rob Herring to move .dts dection into machine sepcific Makefile.boot, so that arch/arm/boot/Makefile can be as clean as it is.

Looks good, some minor comments below, but I've picked it up and asked Nicolas to merge it.

Cheers,
g.

Quoted 18 lines
 arch/arm/Makefile                     |    3 +++
 arch/arm/boot/Makefile                |    2 ++
 arch/arm/mach-exynos4/Makefile.boot   |    2 ++
 arch/arm/mach-mx5/Makefile.boot       |    5 +++++
 arch/arm/mach-omap2/Makefile.boot     |    4 ++++
 arch/arm/mach-tegra/Makefile.boot     |    2 ++
 arch/arm/mach-versatile/Makefile.boot |    2 ++
 7 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/Makefile +0 -0
index d51ab6c..7fd2af9 100644
@@ -292,6 +292,9 @@ zinstall uinstall install: vmlinux
 %.dtb:
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
 
Quoted 8 lines

arch/arm/Makefile zinstall uinstall install: vmlinux · line 297

Quoted 3 lines
arch/arm/Makefile +3 -0
+dtb:
+	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
+

Since the target is the same, I've merged this rule with the %.dtb rule. I also renamed the target 'dtbs' because it will build more than one .dtb file.

Quoted 4 lines

I started with 'dtbs' as target name, and later changed it to 'dtb' to align with $(dtb-y). And 'dtbs' looks truly fine for me, but you may want to change commit message accordingly, as there is 'make ARCH=arm dtb' in it.

Thanks, fixed in my devicetree/test tree and also added something to the help text.

g.