From 043f38fd50c91ec29140dfbf5e1afdf2c2fdadc3 Mon Sep 17 00:00:00 2001 From: Juan Pablo Conde Date: Wed, 9 Aug 2023 13:19:21 -0500 Subject: [PATCH] build(bl32): added check for AARCH32_SP If AACRH32_SP is not specified, it causes the DEFAULT_LINKER_SCRIPT variable to be empty, and then the linker takes the variable following it as if it was the linker script, which is not one. This patch addresses that issue by requiring the AARCH32_SP variable to be set before continuing. Change-Id: I21db7d5bd86b98faaa1a1cd3f985daa592556a2d Signed-off-by: Juan Pablo Conde --- Makefile | 4 ++-- plat/arm/board/a5ds/platform.mk | 6 +++++- plat/arm/board/corstone700/platform.mk | 6 +++++- plat/arm/board/fvp/platform.mk | 4 ---- plat/arm/board/fvp_ve/platform.mk | 6 +++++- plat/arm/common/arm_common.mk | 6 ++++++ plat/imx/imx7/common/imx7.mk | 6 +++++- plat/qti/msm8916/platform.mk | 11 +++++++---- plat/rockchip/rk3288/platform.mk | 6 +++++- 9 files changed, 40 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 0c35120f3..8e2fd8169 100644 --- a/Makefile +++ b/Makefile @@ -768,8 +768,8 @@ ifeq (${ARCH},aarch32) ifeq (${AARCH32_SP_MAKE},) $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located) endif - $(info Including ${AARCH32_SP_MAKE}) - include ${AARCH32_SP_MAKE} + $(info Including ${AARCH32_SP_MAKE}) + include ${AARCH32_SP_MAKE} endif endif #(ARCH=aarch32) diff --git a/plat/arm/board/a5ds/platform.mk b/plat/arm/board/a5ds/platform.mk index 6fcf080a1..3ed7a6374 100644 --- a/plat/arm/board/a5ds/platform.mk +++ b/plat/arm/board/a5ds/platform.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, Arm Limited. All rights reserved. +# Copyright (c) 2019-2023, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -98,6 +98,10 @@ endif NEED_BL32 := yes +ifeq (${AARCH32_SP},none) + $(error Variable AARCH32_SP has to be set for AArch32) +endif + MULTI_CONSOLE_API := 1 ARM_DISABLE_TRUSTED_WDOG := 1 diff --git a/plat/arm/board/corstone700/platform.mk b/plat/arm/board/corstone700/platform.mk index 75833f651..d6d3befac 100644 --- a/plat/arm/board/corstone700/platform.mk +++ b/plat/arm/board/corstone700/platform.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2022, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2019-2023, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -25,6 +25,10 @@ PLAT_INCLUDES := -Iplat/arm/board/corstone700/common/include \ NEED_BL32 := yes +ifeq (${AARCH32_SP},none) + $(error Variable AARCH32_SP has to be set for AArch32) +endif + # Include GICv2 driver files include drivers/arm/gic/v2/gicv2.mk diff --git a/plat/arm/board/fvp/platform.mk b/plat/arm/board/fvp/platform.mk index 6ac4e092a..910483817 100644 --- a/plat/arm/board/fvp/platform.mk +++ b/plat/arm/board/fvp/platform.mk @@ -407,10 +407,6 @@ ifneq (${ENABLE_STACK_PROTECTOR},0) PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp/fvp_stack_protector.c endif -ifeq (${ARCH},aarch32) - NEED_BL32 := yes -endif - # Enable the dynamic translation tables library. ifeq ($(filter 1,${RESET_TO_BL2} ${ARM_XLAT_TABLES_LIB_V1}),) ifeq (${ARCH},aarch32) diff --git a/plat/arm/board/fvp_ve/platform.mk b/plat/arm/board/fvp_ve/platform.mk index f7eace833..79cf35691 100644 --- a/plat/arm/board/fvp_ve/platform.mk +++ b/plat/arm/board/fvp_ve/platform.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, Arm Limited. All rights reserved. +# Copyright (c) 2019-2023, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -96,6 +96,10 @@ endif NEED_BL32 := yes +ifeq (${AARCH32_SP},none) + $(error Variable AARCH32_SP has to be set for AArch32) +endif + # Modification of arm_common.mk # Process ARM_DISABLE_TRUSTED_WDOG flag diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk index 491455346..41d1b66c1 100644 --- a/plat/arm/common/arm_common.mk +++ b/plat/arm/common/arm_common.mk @@ -6,6 +6,12 @@ include common/fdt_wrappers.mk +ifeq (${ARCH},aarch32) + ifeq (${AARCH32_SP},none) + $(error Variable AARCH32_SP has to be set for AArch32) + endif +endif + ifeq (${ARCH}, aarch64) # On ARM standard platorms, the TSP can execute from Trusted SRAM, Trusted # DRAM (if available) or the TZC secured area of DRAM. diff --git a/plat/imx/imx7/common/imx7.mk b/plat/imx/imx7/common/imx7.mk index f4f5bfc0c..156c55dd8 100644 --- a/plat/imx/imx7/common/imx7.mk +++ b/plat/imx/imx7/common/imx7.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved. +# Copyright (c) 2018-2023, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -110,3 +110,7 @@ endif ifeq (${ARCH},aarch64) $(error Error: AArch64 not supported on i.mx7) endif + +ifeq (${AARCH32_SP}, none) + $(error Variable AARCH32_SP has to be set for AArch32) +endif diff --git a/plat/qti/msm8916/platform.mk b/plat/qti/msm8916/platform.mk index 4f4dcb428..c71ad949c 100644 --- a/plat/qti/msm8916/platform.mk +++ b/plat/qti/msm8916/platform.mk @@ -75,11 +75,14 @@ BL31_BASE ?= 0x86500000 PRELOADED_BL33_BASE ?= 0x8f600000 ifeq (${ARCH},aarch64) -BL32_BASE ?= BL31_LIMIT -$(eval $(call add_define,BL31_BASE)) + BL32_BASE ?= BL31_LIMIT + $(eval $(call add_define,BL31_BASE)) else -# There is no BL31 on aarch32, so reuse its location for BL32 -BL32_BASE ?= $(BL31_BASE) + ifeq (${AARCH32_SP},none) + $(error Variable AARCH32_SP has to be set for AArch32) + endif + # There is no BL31 on aarch32, so reuse its location for BL32 + BL32_BASE ?= $(BL31_BASE) endif $(eval $(call add_define,BL32_BASE)) diff --git a/plat/rockchip/rk3288/platform.mk b/plat/rockchip/rk3288/platform.mk index b8dd1953d..e6f78cfb8 100644 --- a/plat/rockchip/rk3288/platform.mk +++ b/plat/rockchip/rk3288/platform.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved. +# Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -67,3 +67,7 @@ $(eval $(call add_define,PLAT_SP_MIN_EXTRA_LD_SCRIPT)) ENABLE_SVE_FOR_NS := 0 WORKAROUND_CVE_2017_5715 := 0 + +ifeq (${AARCH32_SP}, none) + $(error Variable AARCH32_SP has to be set for AArch32) +endif