From d3f8db07b618e79c05805a1598e5e834e42fea98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Sun, 11 Jul 2021 17:33:37 +0200 Subject: [PATCH] fix(plat/marvell/a3k): Fix building uart-images.tgz.bin archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For UART secure boot it is required also TIMN image, so pack it into uart-images.tgz.bin archive which is created by mrvl_uart target. $(TIMN_IMAGE) and $(TIM_IMAGE) variables are used only for UART images so their content needs to be initialized from $(TIMN_UART_CFG) and $(TIM_UART_CFG) config files. And not from $(TIMN_CFG) and $(TIM_CFG) as it is now because they are not generated during mrvl_uart target. Fix it to allow building mrvl_uart target before mrvl_flash target. To match usage of these variables, rename them to $(TIMN_UART_IMAGE) and $(TIM_UART_IMAGE). To not complicate rule for building uart-images.tgz.bin archive, set list of image files into a new $(UART_IMAGES) variable. Signed-off-by: Pali Rohár Change-Id: I83b980abb4047a3afb3ce3026842e1d873c490bf --- plat/marvell/armada/a3k/common/a3700_common.mk | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plat/marvell/armada/a3k/common/a3700_common.mk b/plat/marvell/armada/a3k/common/a3700_common.mk index a89b3a50e..0a8974293 100644 --- a/plat/marvell/armada/a3k/common/a3700_common.mk +++ b/plat/marvell/armada/a3k/common/a3700_common.mk @@ -89,7 +89,7 @@ TIMN_CFG := $(BUILD_PLAT)/atf-timN.txt TIMN_UART_CFG := $(BUILD_PLAT)/$(BUILD_UART)/atf-timN.txt TIMN_SIG := $(IMAGESPATH)/timnsign.txt TIM2IMGARGS := -i $(TIM_CFG) -n $(TIMN_CFG) -TIMN_IMAGE := $$(grep "Image Filename:" -m 1 $(TIMN_CFG) | cut -c 17-) +TIMN_UART_IMAGE := $$(grep "Image Filename:" -m 1 $(TIMN_UART_CFG) | cut -c 17-) else #MARVELL_SECURE_BOOT TIM_CFG := $(BUILD_PLAT)/atf-ntim.txt TIM_UART_CFG := $(BUILD_PLAT)/$(BUILD_UART)/atf-ntim.txt @@ -97,6 +97,8 @@ IMAGESPATH := $(WTP)/tim/untrusted TIM2IMGARGS := -i $(TIM_CFG) endif #MARVELL_SECURE_BOOT +TIM_UART_IMAGE := $$(grep "Image Filename:" -m 1 $(TIM_UART_CFG) | cut -c 17-) + TIMBUILD := $(WTP)/script/buildtim.sh TIM2IMG := $(WTP)/script/tim2img.pl TIMDDRTOOL := $(WTP)/tim/ddr/ddr_tool @@ -123,12 +125,17 @@ DDR_TOPOLOGY ?= 0 BOOTDEV ?= SPINOR PARTNUM ?= 0 -TIM_IMAGE := $$(grep "Image Filename:" -m 1 $(TIM_CFG) | cut -c 17-) TIMBLDARGS := $(MARVELL_SECURE_BOOT) $(BOOTDEV) $(IMAGESPATH) $(WTP) $(CLOCKSPRESET) \ $(DDR_TOPOLOGY) $(PARTNUM) $(DEBUG) $(TIM_CFG) $(TIMN_CFG) $(TIMN_SIG) 1 TIMBLDUARTARGS := $(MARVELL_SECURE_BOOT) UART $(IMAGESPATH) $(WTP) $(CLOCKSPRESET) \ $(DDR_TOPOLOGY) 0 0 $(TIM_UART_CFG) $(TIMN_UART_CFG) $(TIMN_SIG) 0 +UART_IMAGES := $(BUILD_UART)/$(TIM_UART_IMAGE) +ifeq ($(MARVELL_SECURE_BOOT),1) +UART_IMAGES += $(BUILD_UART)/$(TIMN_UART_IMAGE) +endif +UART_IMAGES += $(BUILD_UART)/wtmi_h.bin $(BUILD_UART)/boot-image_h.bin + CRYPTOPP_LIBDIR ?= $(CRYPTOPP_PATH) CRYPTOPP_INCDIR ?= $(CRYPTOPP_PATH) @@ -171,7 +178,7 @@ endif ifeq ($(MARVELL_SECURE_BOOT),1) $(Q)cd $(BUILD_PLAT)/$(BUILD_UART) && $(TBB) -r $(TIMN_UART_CFG) endif - $(Q)tar czf $(BUILD_PLAT)/$(UART_IMAGE) -C $(BUILD_PLAT) $(BUILD_UART)/$(TIM_IMAGE) $(BUILD_UART)/wtmi_h.bin $(BUILD_UART)/boot-image_h.bin + $(Q)tar czf $(BUILD_PLAT)/$(UART_IMAGE) -C $(BUILD_PLAT) $(UART_IMAGES) @$(ECHO_BLANK_LINE) @echo "Built $@ successfully" @$(ECHO_BLANK_LINE) -- GitLab