From patchwork Mon May 4 12:38:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 244996 List-Id: U-Boot discussion From: jan.kiszka at web.de (Jan Kiszka) Date: Mon, 4 May 2020 14:38:29 +0200 Subject: [PATCH 1/4] kbuild: efi: Avoid rebuilding efi targets In-Reply-To: References: Message-ID: From: Jan Kiszka Add a couple of missing targets so that helloworld and other efi targets are not needlessly rebuilt. CC: Heinrich Schuchardt Signed-off-by: Jan Kiszka Tested-by: Heinrich Schuchardt --- lib/efi_loader/Makefile | 1 + scripts/Makefile.lib | 2 ++ 2 files changed, 3 insertions(+) -- 2.26.1 diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index eff3c25ec3..84d61df55b 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -17,6 +17,7 @@ CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI) ifneq ($(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),) always += helloworld.efi +targets += helloworld.o endif obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 63fbadd757..734001c952 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -418,6 +418,8 @@ $(obj)/efi_reloc.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_RELOC:.o=.c) $(recordmcoun $(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o $(call cmd,efi_ld) +targets += $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o + # ACPI # --------------------------------------------------------------------------- # From patchwork Mon May 4 12:38:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 244998 List-Id: U-Boot discussion From: jan.kiszka at web.de (Jan Kiszka) Date: Mon, 4 May 2020 14:38:30 +0200 Subject: [PATCH 2/4] kbuild: spl: Fix parallel build In-Reply-To: References: Message-ID: <65f5ca0f701106950ae5634632b8648577f6e2d2.1588595912.git.jan.kiszka@web.de> From: Jan Kiszka The dts dir must exists when running this rule. That missing dependency broke e.g. "make -j" for the am65x targets. Fixes: 2f57c95100f2 ("spl: dm: Make it possible for the SPL to pick its own DTB from a FIT") CC: Jean-Jacques Hiblot Signed-off-by: Jan Kiszka --- scripts/Makefile.spl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.1 diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 6741ef911e..63ce5caf23 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -461,7 +461,7 @@ dtbs: SHRUNK_ARCH_DTB = $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST))) .SECONDEXPANSION: -$(SHRUNK_ARCH_DTB): $$(patsubst $(obj)/dts/%, arch/$(ARCH)/dts/%, $$@) +$(SHRUNK_ARCH_DTB): $$(patsubst $(obj)/dts/%, arch/$(ARCH)/dts/%, $$@) dts_dir $(call if_changed,fdtgrep) MKIMAGEFLAGS_$(SPL_BIN).multidtb.fit = -f auto -A $(ARCH) -T firmware -C none -O u-boot \ From patchwork Mon May 4 12:38:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 244997 List-Id: U-Boot discussion From: jan.kiszka at web.de (Jan Kiszka) Date: Mon, 4 May 2020 14:38:31 +0200 Subject: [PATCH 3/4] kbuild: spl: Add shrunk arch-dtbs to targets list In-Reply-To: References: Message-ID: From: Jan Kiszka This avoids needless rebuilding. Fixes: 2f57c95100f2 ("spl: dm: Make it possible for the SPL to pick its own DTB from a FIT") CC: Jean-Jacques Hiblot Signed-off-by: Jan Kiszka --- scripts/Makefile.spl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.26.1 diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 63ce5caf23..e6d56a1286 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -459,11 +459,14 @@ dtbs: # information in a variable so we can use it in if_changed and friends. .PHONY: $(PHONY) -SHRUNK_ARCH_DTB = $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST))) +SPL_OF_LIST_TARGETS = $(patsubst %,dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST))) +SHRUNK_ARCH_DTB = $(addprefix $(obj)/,$(SPL_OF_LIST_TARGETS)) .SECONDEXPANSION: $(SHRUNK_ARCH_DTB): $$(patsubst $(obj)/dts/%, arch/$(ARCH)/dts/%, $$@) dts_dir $(call if_changed,fdtgrep) +targets += $(SPL_OF_LIST_TARGETS) + MKIMAGEFLAGS_$(SPL_BIN).multidtb.fit = -f auto -A $(ARCH) -T firmware -C none -O u-boot \ -n "Multi DTB fit image for $(SPL_BIN)" -E \ $(patsubst %,-b %,$(SHRUNK_ARCH_DTB)) From patchwork Mon May 4 12:38:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 244999 List-Id: U-Boot discussion From: jan.kiszka at web.de (Jan Kiszka) Date: Mon, 4 May 2020 14:38:32 +0200 Subject: [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs In-Reply-To: References: Message-ID: From: Jan Kiszka Build the secured board dtbs (.dtb_HS) as part of the regular dtb build on CONFIG_TI_SECURE_DEVICE targets. This avoids rebuilding them, possibly overwriting artifacts that are in use, as it is done so far. In the same run, fix needless rebuilding of the secured spl dtb. Fixes: 508369672ca3 ("arm: mach-k3: Add secure device build support") CC: Andrew F. Davis Signed-off-by: Jan Kiszka --- arch/arm/dts/Makefile | 6 ++++-- arch/arm/mach-k3/config_secure.mk | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) -- 2.26.1 diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 2c123bd6da..b68e9c0726 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0+ +include $(srctree)/arch/arm/mach-k3/config_secure.mk + dtb-$(CONFIG_TARGET_SMARTWEB) += at91sam9260-smartweb.dtb dtb-$(CONFIG_TARGET_TAURUS) += at91sam9g20-taurus.dtb dtb-$(CONFIG_TARGET_CORVUS) += at91sam9g45-corvus.dtb @@ -927,13 +929,13 @@ dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb dtb-$(CONFIG_TARGET_PRESIDIO_ASIC) += ca-presidio-engboard.dtb -targets += $(dtb-y) +targets += $(dtb-y) $(TI_SECURE_DTBS) # Add any required device tree compiler flags here DTC_FLAGS += PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) +dtbs: $(addprefix $(obj)/, $(dtb-y) $(TI_SECURE_DTBS)) @: clean-files := *.dtb *.dtbo *_HS diff --git a/arch/arm/mach-k3/config_secure.mk b/arch/arm/mach-k3/config_secure.mk index 6d63c57665..d9141e10a0 100644 --- a/arch/arm/mach-k3/config_secure.mk +++ b/arch/arm/mach-k3/config_secure.mk @@ -26,7 +26,12 @@ endif $(obj)/u-boot-spl-nodtb.bin_HS: $(obj)/u-boot-spl-nodtb.bin FORCE $(call if_changed,k3secureimg) -tispl.bin_HS: $(obj)/u-boot-spl-nodtb.bin_HS $(patsubst %,$(obj)/dts/%.dtb_HS,$(subst ",,$(CONFIG_SPL_OF_LIST))) $(SPL_ITS) FORCE +SPL_OF_LIST_TARGETS = $(patsubst %,dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST))) +SPL_OF_LIST_TARGETS_HS = $(addsuffix _HS,$(SPL_OF_LIST_TARGETS)) + +targets += $(SPL_OF_LIST_TARGETS) $(SPL_OF_LIST_TARGETS_HS) + +tispl.bin_HS: $(obj)/u-boot-spl-nodtb.bin_HS $(addprefix $(obj)/,$(SPL_OF_LIST_TARGETS_HS)) $(SPL_ITS) FORCE $(call if_changed,mkfitimage) MKIMAGEFLAGS_u-boot.img_HS = -f auto -A $(ARCH) -T firmware -C none -O u-boot \ @@ -34,11 +39,15 @@ MKIMAGEFLAGS_u-boot.img_HS = -f auto -A $(ARCH) -T firmware -C none -O u-boot \ -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \ $(patsubst %,-b arch/$(ARCH)/dts/%.dtb_HS,$(subst ",,$(CONFIG_OF_LIST))) -OF_LIST_TARGETS = $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -$(OF_LIST_TARGETS): dtbs - u-boot-nodtb.bin_HS: u-boot-nodtb.bin FORCE $(call if_changed,k3secureimg) -u-boot.img_HS: u-boot-nodtb.bin_HS u-boot.img $(patsubst %.dtb,%.dtb_HS,$(OF_LIST_TARGETS)) FORCE +u-boot.img_HS: u-boot-nodtb.bin_HS u-boot.img dtbs FORCE $(call if_changed,mkimage) + +# Used when included by arch-dts makefile +-include include/config/auto.conf + +ifeq ($(CONFIG_TI_SECURE_DEVICE),y) +TI_SECURE_DTBS = $(addsuffix _HS, $(dtb-y)) +endif