From 6790be2439b0c31abbabcd26d15fd48fa3434f69 Mon Sep 17 00:00:00 2001 From: Youngmin Nam Date: Fri, 6 Jul 2018 18:26:43 +0900 Subject: [PATCH] [COMMON] arch: arm64: Support to build dtbo Change-Id: I4032912aedf24ab68125cad91f5da81408049381 Signed-off-by: Youngmin Nam --- arch/arm64/Makefile | 3 +++ arch/arm64/boot/Makefile | 2 +- arch/arm64/boot/dts/Makefile | 6 +++--- scripts/Makefile.dtbinst | 10 ++++++++-- scripts/Makefile.lib | 6 ++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 78df900d75b5..ed3edc597e70 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -149,6 +149,9 @@ zinstall install: %.dtb: scripts $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ +%.dtbo: scripts + $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ + PHONY += dtbs dtbs_install dtbs: prepare scripts diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile index 2c8cb864315e..aa890a90ae0b 100644 --- a/arch/arm64/boot/Makefile +++ b/arch/arm64/boot/Makefile @@ -24,7 +24,7 @@ DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE_NAMES)) ifneq ($(DTB_NAMES),) DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES)) else -DTB_LIST := $(dtb-y) +DTB_LIST := $(dtb-y) $(dtbo-y) endif DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST)) diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile index db5a70876487..dee60305eddb 100644 --- a/arch/arm64/boot/dts/Makefile +++ b/arch/arm64/boot/dts/Makefile @@ -31,7 +31,7 @@ dtstree := $(srctree)/$(src) dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(foreach d,$(dts-dirs), $(wildcard $(dtstree)/$(d)/*.dts))) -always := $(dtb-y) +always := $(dtb-y) $(dtbo-y) targets += dtbs @@ -39,10 +39,10 @@ DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE_NAMES)) ifneq ($(DTB_NAMES),) DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES)) else -DTB_LIST := $(dtb-y) +DTB_LIST := $(dtb-y) $(dtbo-y) endif targets += $(DTB_LIST) dtbs: $(addprefix $(obj)/, $(DTB_LIST)) -clean-files := dts/*.dtb *.dtb +clean-files := dts/*.dtb *.dtb* diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst index c8ba6e7f9868..b3770d5c8de5 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst @@ -22,6 +22,7 @@ include scripts/Kbuild.include include $(src)/Makefile dtbinst-files := $(dtb-y) +dtboinst-files := $(dtbo-y) dtbinst-dirs := $(dts-dirs) # Helper targets for Installing DTBs into the boot directory @@ -30,13 +31,18 @@ quiet_cmd_dtb_install = INSTALL $< install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj)) +$(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs): | __dtbs_install_prep + $(dtbinst-files): %.dtb: $(obj)/%.dtb $(call cmd,dtb_install,$(install-dir)) +$(dtboinst-files): %.dtbo: $(obj)/%.dtbo + $(call cmd,dtb_install,$(install-dir)) + $(dtbinst-dirs): $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ -PHONY += $(dtbinst-files) $(dtbinst-dirs) -__dtbs_install: $(dtbinst-files) $(dtbinst-dirs) +PHONY += $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs) +__dtbs_install: $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs) .PHONY: $(PHONY) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 95ca61de0ffb..630b6ecef467 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -270,6 +270,9 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \ # --------------------------------------------------------------------------- DTC ?= $(objtree)/scripts/dtc/dtc +# Overlay support +DTC_FLAGS += -@ + # Disable noisy checks by default ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) DTC_FLAGS += -Wno-unit_address_vs_reg @@ -304,6 +307,9 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ $(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep,dtc) +$(obj)/%.dtbo: $(src)/%.dts FORCE + $(call if_changed_dep,dtc) + dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) # cat -- 2.20.1