* [PATCH 0/4] Various build dependency fixes @ 2020-05-04 12:38 Jan Kiszka 2020-05-04 12:38 ` [PATCH 1/4] kbuild: efi: Avoid rebuilding efi targets Jan Kiszka ` (3 more replies) 0 siblings, 4 replies; 12+ messages in thread From: Jan Kiszka @ 2020-05-04 12:38 UTC (permalink / raw) To: u-boot See patches for details. Jan CC: Andrew F. Davis <afd@ti.com> CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Jan Kiszka <jan.kiszka@siemens.com> CC: Jean-Jacques Hiblot <jjhiblot@ti.com> Jan Kiszka (4): kbuild: efi: Avoid rebuilding efi targets kbuild: spl: Fix parallel build kbuild: spl: Add shrunk arch-dtbs to targets list kbuild: arm: Fix duplicate builds of dtbs arch/arm/dts/Makefile | 6 ++++-- arch/arm/mach-k3/config_secure.mk | 19 ++++++++++++++----- lib/efi_loader/Makefile | 1 + scripts/Makefile.lib | 2 ++ scripts/Makefile.spl | 7 +++++-- 5 files changed, 26 insertions(+), 9 deletions(-) -- 2.26.1 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/4] kbuild: efi: Avoid rebuilding efi targets 2020-05-04 12:38 [PATCH 0/4] Various build dependency fixes Jan Kiszka @ 2020-05-04 12:38 ` Jan Kiszka 2020-05-04 18:35 ` Heinrich Schuchardt 2020-05-04 12:38 ` [PATCH 2/4] kbuild: spl: Fix parallel build Jan Kiszka ` (2 subsequent siblings) 3 siblings, 1 reply; 12+ messages in thread From: Jan Kiszka @ 2020-05-04 12:38 UTC (permalink / raw) To: u-boot From: Jan Kiszka <jan.kiszka@siemens.com> Add a couple of missing targets so that helloworld and other efi targets are not needlessly rebuilt. CC: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- lib/efi_loader/Makefile | 1 + scripts/Makefile.lib | 2 ++ 2 files changed, 3 insertions(+) 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 # --------------------------------------------------------------------------- # -- 2.26.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 1/4] kbuild: efi: Avoid rebuilding efi targets 2020-05-04 12:38 ` [PATCH 1/4] kbuild: efi: Avoid rebuilding efi targets Jan Kiszka @ 2020-05-04 18:35 ` Heinrich Schuchardt 0 siblings, 0 replies; 12+ messages in thread From: Heinrich Schuchardt @ 2020-05-04 18:35 UTC (permalink / raw) To: u-boot On 5/4/20 2:38 PM, Jan Kiszka wrote: > From: Jan Kiszka <jan.kiszka@siemens.com> > > Add a couple of missing targets so that helloworld and other efi targets > are not needlessly rebuilt. > > CC: Heinrich Schuchardt <xypron.glpk@gmx.de> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> > --- > lib/efi_loader/Makefile | 1 + > scripts/Makefile.lib | 2 ++ > 2 files changed, 3 insertions(+) > > 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 > # --------------------------------------------------------------------------- > # > -- > 2.26.1 > ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/4] kbuild: spl: Fix parallel build 2020-05-04 12:38 [PATCH 0/4] Various build dependency fixes Jan Kiszka 2020-05-04 12:38 ` [PATCH 1/4] kbuild: efi: Avoid rebuilding efi targets Jan Kiszka @ 2020-05-04 12:38 ` Jan Kiszka 2020-05-14 17:15 ` Tom Rini 2020-05-04 12:38 ` [PATCH 3/4] kbuild: spl: Add shrunk arch-dtbs to targets list Jan Kiszka 2020-05-04 12:38 ` [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs Jan Kiszka 3 siblings, 1 reply; 12+ messages in thread From: Jan Kiszka @ 2020-05-04 12:38 UTC (permalink / raw) To: u-boot From: Jan Kiszka <jan.kiszka@siemens.com> 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 <jjhiblot@ti.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- scripts/Makefile.spl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 \ -- 2.26.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/4] kbuild: spl: Fix parallel build 2020-05-04 12:38 ` [PATCH 2/4] kbuild: spl: Fix parallel build Jan Kiszka @ 2020-05-14 17:15 ` Tom Rini 0 siblings, 0 replies; 12+ messages in thread From: Tom Rini @ 2020-05-14 17:15 UTC (permalink / raw) To: u-boot On Mon, May 04, 2020 at 02:38:30PM +0200, Jan Kiszka wrote: > From: Jan Kiszka <jan.kiszka@siemens.com> > > 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 <jjhiblot@ti.com> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200514/00504ac6/attachment.sig> ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/4] kbuild: spl: Add shrunk arch-dtbs to targets list 2020-05-04 12:38 [PATCH 0/4] Various build dependency fixes Jan Kiszka 2020-05-04 12:38 ` [PATCH 1/4] kbuild: efi: Avoid rebuilding efi targets Jan Kiszka 2020-05-04 12:38 ` [PATCH 2/4] kbuild: spl: Fix parallel build Jan Kiszka @ 2020-05-04 12:38 ` Jan Kiszka 2020-05-14 17:15 ` Tom Rini 2020-05-04 12:38 ` [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs Jan Kiszka 3 siblings, 1 reply; 12+ messages in thread From: Jan Kiszka @ 2020-05-04 12:38 UTC (permalink / raw) To: u-boot From: Jan Kiszka <jan.kiszka@siemens.com> 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 <jjhiblot@ti.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- scripts/Makefile.spl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)) -- 2.26.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/4] kbuild: spl: Add shrunk arch-dtbs to targets list 2020-05-04 12:38 ` [PATCH 3/4] kbuild: spl: Add shrunk arch-dtbs to targets list Jan Kiszka @ 2020-05-14 17:15 ` Tom Rini 0 siblings, 0 replies; 12+ messages in thread From: Tom Rini @ 2020-05-14 17:15 UTC (permalink / raw) To: u-boot On Mon, May 04, 2020 at 02:38:31PM +0200, Jan Kiszka wrote: > From: Jan Kiszka <jan.kiszka@siemens.com> > > 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 <jjhiblot@ti.com> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Applied to u-boot/master, thanks! [Aside, I'm assuming Andrew will reply back still on 4/4, but 2/4 and 3/4 are needed to fix building / testing right now] -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200514/8c3cfa71/attachment.sig> ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs 2020-05-04 12:38 [PATCH 0/4] Various build dependency fixes Jan Kiszka ` (2 preceding siblings ...) 2020-05-04 12:38 ` [PATCH 3/4] kbuild: spl: Add shrunk arch-dtbs to targets list Jan Kiszka @ 2020-05-04 12:38 ` Jan Kiszka 2020-05-08 15:40 ` Andrew F. Davis 3 siblings, 1 reply; 12+ messages in thread From: Jan Kiszka @ 2020-05-04 12:38 UTC (permalink / raw) To: u-boot From: Jan Kiszka <jan.kiszka@siemens.com> 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 <afd@ti.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- arch/arm/dts/Makefile | 6 ++++-- arch/arm/mach-k3/config_secure.mk | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) 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 -- 2.26.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs 2020-05-04 12:38 ` [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs Jan Kiszka @ 2020-05-08 15:40 ` Andrew F. Davis 2020-05-08 15:54 ` Jan Kiszka 0 siblings, 1 reply; 12+ messages in thread From: Andrew F. Davis @ 2020-05-08 15:40 UTC (permalink / raw) To: u-boot On 5/4/20 8:38 AM, Jan Kiszka wrote: > From: Jan Kiszka <jan.kiszka@siemens.com> > > 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 <afd@ti.com> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> > --- > arch/arm/dts/Makefile | 6 ++++-- > arch/arm/mach-k3/config_secure.mk | 19 ++++++++++++++----- > 2 files changed, 18 insertions(+), 7 deletions(-) > > 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 > + This is hacky, we should not in the top level dts makefile have a dependency on a specific platform configuration file. What about mach-omap/config_secure.mk, etc.. The negative of building dtbs twice for HS is very minor compared to the extra complexity this patch adds. It will be much more difficult to clean this up later. Andrew > 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 > -- > 2.26.1 > ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs 2020-05-08 15:40 ` Andrew F. Davis @ 2020-05-08 15:54 ` Jan Kiszka 2020-05-18 16:26 ` Andrew F. Davis 0 siblings, 1 reply; 12+ messages in thread From: Jan Kiszka @ 2020-05-08 15:54 UTC (permalink / raw) To: u-boot On 08.05.20 17:40, Andrew F. Davis wrote: > On 5/4/20 8:38 AM, Jan Kiszka wrote: >> From: Jan Kiszka <jan.kiszka@siemens.com> >> >> 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 <afd@ti.com> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> >> --- >> arch/arm/dts/Makefile | 6 ++++-- >> arch/arm/mach-k3/config_secure.mk | 19 ++++++++++++++----- >> 2 files changed, 18 insertions(+), 7 deletions(-) >> >> 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 >> + > > > This is hacky, we should not in the top level dts makefile have a > dependency on a specific platform configuration file. > > What about mach-omap/config_secure.mk, etc.. They don't need those special signing the k3 need. If they did, they could be included here as well. > > The negative of building dtbs twice for HS is very minor compared to the > extra complexity this patch adds. It will be much more difficult to > clean this up later. Overwriting a build artifacts that were already completed and may just be in use while doing so is broken. This must be fixed. As I wrote, I will add support for injecting public keys into the dtbs, and that also revealed this issue. Better suggestions welcome. Jan ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs 2020-05-08 15:54 ` Jan Kiszka @ 2020-05-18 16:26 ` Andrew F. Davis 2020-05-18 17:34 ` Jan Kiszka 0 siblings, 1 reply; 12+ messages in thread From: Andrew F. Davis @ 2020-05-18 16:26 UTC (permalink / raw) To: u-boot On 5/8/20 11:54 AM, Jan Kiszka wrote: > On 08.05.20 17:40, Andrew F. Davis wrote: >> On 5/4/20 8:38 AM, Jan Kiszka wrote: >>> From: Jan Kiszka <jan.kiszka@siemens.com> >>> >>> 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 <afd@ti.com> >>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> >>> --- >>> ? arch/arm/dts/Makefile???????????? |? 6 ++++-- >>> ? arch/arm/mach-k3/config_secure.mk | 19 ++++++++++++++----- >>> ? 2 files changed, 18 insertions(+), 7 deletions(-) >>> >>> 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 >>> + >> >> >> This is hacky, we should not in the top level dts makefile have a >> dependency on a specific platform configuration file. >> >> What about mach-omap/config_secure.mk, etc.. > > They don't need those special signing the k3 need. If they did, they > could be included here as well. > I did everything the same in that file, so I don't see why it wouldn't need the same treatment. But my point is that this will keep growing, the fixes should be local to the mk files or everyone who does something similar will need to add here. >> >> The negative of building dtbs twice for HS is very minor compared to the >> extra complexity this patch adds. It will be much more difficult to >> clean this up later. > > Overwriting a build artifacts that were already completed and may just > be in use while doing so is broken. This must be fixed. > Absolutely agree it needs fixed, just not sure this just doesn't add to the makefile complexity in the wrong way. > As I wrote, I will add support for injecting public keys into the dtbs, > and that also revealed this issue. > If I understand right, you are adding the keys into the dtb then signing them? Why not add them to the dts first, then nothing would need to change with multiple builds of the dtbs. Andrew > Better suggestions welcome. > > Jan ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs 2020-05-18 16:26 ` Andrew F. Davis @ 2020-05-18 17:34 ` Jan Kiszka 0 siblings, 0 replies; 12+ messages in thread From: Jan Kiszka @ 2020-05-18 17:34 UTC (permalink / raw) To: u-boot On 18.05.20 18:26, Andrew F. Davis wrote: > On 5/8/20 11:54 AM, Jan Kiszka wrote: >> On 08.05.20 17:40, Andrew F. Davis wrote: >>> On 5/4/20 8:38 AM, Jan Kiszka wrote: >>>> From: Jan Kiszka <jan.kiszka@siemens.com> >>>> >>>> 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 <afd@ti.com> >>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> >>>> --- >>>> ? arch/arm/dts/Makefile???????????? |? 6 ++++-- >>>> ? arch/arm/mach-k3/config_secure.mk | 19 ++++++++++++++----- >>>> ? 2 files changed, 18 insertions(+), 7 deletions(-) >>>> >>>> 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 >>>> + >>> >>> >>> This is hacky, we should not in the top level dts makefile have a >>> dependency on a specific platform configuration file. >>> >>> What about mach-omap/config_secure.mk, etc.. >> >> They don't need those special signing the k3 need. If they did, they >> could be included here as well. >> > > > I did everything the same in that file, so I don't see why it wouldn't > need the same treatment. But my point is that this will keep growing, > the fixes should be local to the mk files or everyone who does something > similar will need to add here. > The problem is that dtbs are built in a separate make session. If you want to address specific dtbs in a rule, you must do that in that session, not outside like you did. That applies to signing for TI K3, just like it would for bringing in public keys as discussed below. I think you mentioned offlist that eliminating this nesting would help, but I do not yet see if that can be easily done. > >>> >>> The negative of building dtbs twice for HS is very minor compared to the >>> extra complexity this patch adds. It will be much more difficult to >>> clean this up later. >> >> Overwriting a build artifacts that were already completed and may just >> be in use while doing so is broken. This must be fixed. >> > > > Absolutely agree it needs fixed, just not sure this just doesn't add to > the makefile complexity in the wrong way. > As I said, I'm open for other approaches that resolve this. > >> As I wrote, I will add support for injecting public keys into the dtbs, >> and that also revealed this issue. >> > > > If I understand right, you are adding the keys into the dtb then signing > them? Why not add them to the dts first, then nothing would need to > change with multiple builds of the dtbs. You sign the chain from right to left, while loading is left to right: the right-side image is signed while injecting the necessary keys/certs into the left-side image that loads it. And then that is signed as well, in the end often with a hardware-specific mechanism (unfortunately). But dtbs are hardware-specific, keys are deployment-specific. That's why they are injected into existing dtbs, rather than asking the user to patch them into dts files in the source tree. Just today I ran into another piece of code that models this signing and key injection outside of U-Boot, with a lot of knowledge about the particular target. It would be way nicer to solve that generically. Jan ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-05-18 17:34 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-05-04 12:38 [PATCH 0/4] Various build dependency fixes Jan Kiszka 2020-05-04 12:38 ` [PATCH 1/4] kbuild: efi: Avoid rebuilding efi targets Jan Kiszka 2020-05-04 18:35 ` Heinrich Schuchardt 2020-05-04 12:38 ` [PATCH 2/4] kbuild: spl: Fix parallel build Jan Kiszka 2020-05-14 17:15 ` Tom Rini 2020-05-04 12:38 ` [PATCH 3/4] kbuild: spl: Add shrunk arch-dtbs to targets list Jan Kiszka 2020-05-14 17:15 ` Tom Rini 2020-05-04 12:38 ` [PATCH 4/4] kbuild: arm: Fix duplicate builds of dtbs Jan Kiszka 2020-05-08 15:40 ` Andrew F. Davis 2020-05-08 15:54 ` Jan Kiszka 2020-05-18 16:26 ` Andrew F. Davis 2020-05-18 17:34 ` Jan Kiszka
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.