Browse Source

ARM: dts: dt-overlays: Add base support for DT overlay building

Add base support for DT overlay building for TI SoCs. Adds support
for building .dtso files into .dtbo, and building .its files into
.itb for FIT image support. Also, add new kernel build target for
building all available FIT images (make itbs.)

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tero Kristo 7 years ago
parent
commit
9d5a8f7ab0
4 changed files with 33 additions and 7 deletions
  1. 17 4
      arch/arm/Makefile
  2. 3 0
      arch/arm/boot/.gitignore
  3. 4 0
      arch/arm/boot/dts/Makefile
  4. 9 3
      scripts/Makefile.dtbinst

+ 17 - 4
arch/arm/Makefile

@@ -309,7 +309,7 @@ endif
 
 # Build the DT binary blobs if we have OF configured
 ifeq ($(CONFIG_USE_OF),y)
-KBUILD_DTBS := dtbs
+KBUILD_DTBS := dtbs itbs
 endif
 
 all:	$(notdir $(KBUILD_IMAGE)) $(KBUILD_DTBS)
@@ -339,17 +339,28 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
-%.dtb: | scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+%.dtb %.dtbo %.itb: dtbdir=$(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
 
-PHONY += dtbs dtbs_install
+%.dtb %.dtbo: | scripts
+	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
+
+%.itb: | scripts zImage
+	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
+
+PHONY += dtbs dtbs_install itbs_install
 
 dtbs: prepare scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts
 
+itbs: prepare scripts zImage
+	$(Q)$(MAKE) $(build)=$(boot)/dts BUILD_ITBS=y
+
 dtbs_install:
 	$(Q)$(MAKE) $(dtbinst)=$(boot)/dts
 
+itbs_install:
+	$(Q)$(MAKE) $(dtbinst)=$(boot)/dts BUILD_ITBS=y
+
 PHONY += vdso_install
 vdso_install:
 ifeq ($(CONFIG_VDSO),y)
@@ -373,6 +384,8 @@ define archhelp
   echo  '                  (supply initrd image via make variable INITRD=<path>)'
   echo  '* dtbs          - Build device tree blobs for enabled boards'
   echo  '  dtbs_install  - Install dtbs to $(INSTALL_DTBS_PATH)'
+  echo  '* itbs          - Build FIT images for enabled boards'
+  echo  '  itbs_install  - Install FIT images to $(INSTALL_DTBS_PATH)'
   echo  '  install       - Install uncompressed kernel'
   echo  '  zinstall      - Install compressed kernel'
   echo  '  uinstall      - Install U-Boot wrapped compressed kernel'

+ 3 - 0
arch/arm/boot/.gitignore

@@ -3,3 +3,6 @@ zImage
 xipImage
 bootpImage
 uImage
+*.dtb
+*.dtbo
+*.itb

+ 4 - 0
arch/arm/boot/dts/Makefile

@@ -1207,3 +1207,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
 	aspeed-bmc-opp-zaius.dtb \
 	aspeed-bmc-portwell-neptune.dtb \
 	aspeed-bmc-quanta-q71l.dtb
+
+ifeq ($(BUILD_ITBS),y)
+dtb-y=
+endif

+ 9 - 3
scripts/Makefile.dtbinst

@@ -28,13 +28,19 @@ quiet_cmd_dtb_install =	INSTALL $<
 
 install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
 
-$(dtbinst-files): %.dtb: $(obj)/%.dtb
+$(filter %.dtb,$(dtbinst-files)): %.dtb: $(obj)/%.dtb
+	$(call cmd,dtb_install,$(install-dir))
+
+$(filter %.itb,$(dtbinst-files)): %.itb: $(obj)/%.itb
 	$(call cmd,dtb_install,$(install-dir))
 
 $(dtbinst-dirs):
 	$(Q)$(MAKE) $(dtbinst)=$(obj)/$@
 
-PHONY += $(dtbinst-files) $(dtbinst-dirs)
-__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
+dummy:
+	@echo > /dev/null
+
+PHONY += $(dtbinst-files) $(dtbinst-dirs) dummy
+__dtbs_install: $(dtbinst-files) $(dtbinst-dirs) dummy
 
 .PHONY: $(PHONY)