From: Achin Gupta achin.gupta@arm.com
Hi,
This patch makes some tweaks to the ARM Trusted firmware build command being used to include support for the MM Dispatcher and EDK2 MM images. It also updated the atf-build.sh to not export the SCP_BL2 option for the FVP platform.
cheers, Achin
Changelog:
v2: Replaced platform specific conditional to not export the SCP_BL2 option with a generic condition.
v1: First patchset
Achin Gupta (2): Do not export SCP firmware path on FVP build MM: Change options to include MM image in ARM TF
atf-build.sh | 33 +++++++++++++++++++++------------ platforms.config | 11 +++++------ 2 files changed, 26 insertions(+), 18 deletions(-)
From: Achin Gupta achin.gupta@arm.com
This patch ensures that the SCP_BL2 flag is exported only if the platform configuration has defined the path of the BL30 image. This flag was always set for all platforms for ARM TF versions greater than 1. If included in the FVP build, it made the FIP generation fail since SCP_BL2 would point to a directory (no BL30) instead of a file.
Signed-off-by: Achin Gupta achin.gupta@arm.com --- atf-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/atf-build.sh b/atf-build.sh index 4d6afa0..8df1a11 100755 --- a/atf-build.sh +++ b/atf-build.sh @@ -145,7 +145,7 @@ function build_platform export BL30 BL31 BL32 BL33
echo "BL30=$BL30" - if [ $ATF_BUILDVER -gt 1 ]; then + if [ $ATF_BUILDVER -gt 1 ] && [ X"$BL30" != X"" ]; then export SCP_BL2 echo "SCP_BL2=$BL30" fi
From: Achin Gupta achin.gupta@arm.com
The build options for including the Standalone MM image in a FIP during an ARM TF build have changed. The MM image is now included as a pre-built BL32 image instead of an SFS_PAYLOAD image. Also, the option to include the MM Dispatcher component has changed from SFSD=mmd to SPM=1. This patch implements these changes to match the latest ARM TF patchset for MM support.
Signed-off-by: Achin Gupta achin.gupta@arm.com --- atf-build.sh | 31 ++++++++++++++++++++----------- platforms.config | 11 +++++------ 2 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/atf-build.sh b/atf-build.sh index 8df1a11..5c45708 100755 --- a/atf-build.sh +++ b/atf-build.sh @@ -60,14 +60,12 @@ function build_platform PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o arch`" PLATFORM_IMAGE_DIR="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_image_dir`" PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_buildflags`" - PLATFORM_SFS_PAYLOAD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_sfs_payload`"
if [ $VERBOSE -eq 1 ]; then echo "PLATFORM_NAME=$PLATFORM_NAME" echo "PLATFORM_ARCH=$PLATFORM_ARCH" echo "PLATFORM_IMAGE_DIR=$PLATFORM_IMAGE_DIR" echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS" - echo "PLATFORM_SFS_PAYLOAD=$PLATFORM_SFS_PAYLOAD" fi
unset BL30 BL31 BL32 BL33 @@ -118,16 +116,27 @@ function build_platform echo " Please specify both ATF_SPD and TOS_BIN" echo " if you wish to use a Trusted OS!" fi - fi + else + # + # BL32 could be the secure partition. + # If TOS_DIR is not set and the SPD is none then include BL32 as a + # prebuilt secure partition. + # + SPD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_spd`" + TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`"
- if [ X"$PLATFORM_SFS_PAYLOAD" != X"" ]; then - # - # Since SFS cannot be exported or undefined, - # we parametrise it here - # - SFS_OPTION="SFS_PAYLOAD=$EDK2_DIR/$PLATFORM_SFS_PAYLOAD" + if [ X"$SPD" == X"none" ] && [ X"$TOS_BIN" != X"" ]; then + BL32=$EDK2_DIR/$TOS_BIN + SPD_OPTION="BL32=$BL32" + else + echo "WARNING: Proceeding without Secure Partition!" + echo " Please specify both ATF_SPD=none and TOS_BIN" + echo " if you wish to use a Secure Partition!" + fi fi
+ + # # Debug extraction handling # @@ -167,9 +176,9 @@ function build_platform # if [ $VERBOSE -eq 1 ]; then echo "Calling ARM Trusted Firmware build:" - echo "CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION $SFS_OPTION DEBUG=$DEBUG ${PLATFORM_BUILDFLAGS} all fip" + echo "CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION DEBUG=$DEBUG ${PLATFORM_BUILDFLAGS} all fip" fi - CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION $SFS_OPTION DEBUG=$DEBUG ${PLATFORM_BUILDFLAGS} all fip + CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION DEBUG=$DEBUG ${PLATFORM_BUILDFLAGS} all fip if [ $? -eq 0 ]; then # # Copy resulting images to UEFI image dir diff --git a/platforms.config b/platforms.config index dc1ee21..5332e0f 100644 --- a/platforms.config +++ b/platforms.config @@ -51,8 +51,6 @@ # - BUILDFLAGS Any special flags you want to pass to the build command. # - ATF_BUILDFLAGS Any special flags you want to pass to the ARM Trusted # Firmware build command. -# - ATF_SFS_PAYLOAD Any special secure firmware service payload you want -# to pass to the ARM trusted Firmware build command. # - TOS_BUILDFLAGS Any special flags you want to pass to the Trusted OS # build command. # - EXTRA_FILES Any additional files to be copied to output dir. @@ -101,16 +99,17 @@ UEFI_BIN=FVP_AARCH64_EFI_MM_STANDALONE.fd UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-MM-Standalone
[fvp_mm_normal] -LONGNAME=FVP Base for UEFI image with MM support in normal world" +LONGNAME=FVP Base for UEFI image with MM support in normal world DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc -BUILDFLAGS=-D EDK2_OUT_DIR=Build/ArmVExpress-FVP-AArch64-MM-Normal -D EDK2_ENABLE_SMSC_91X=1 -D ARM_STANDALONE_MM_ENABLE=TRUE +BUILDFLAGS=-D EDK2_OUT_DIR=Build/ArmVExpress-FVP-AArch64-MM-Normal -D ARM_STANDALONE_MM_ENABLE=TRUE ARCH=AARCH64 BUILD_ATF=debug UEFI_BIN=FVP_AARCH64_EFI.fd UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-MM-Normal ATF_PLATFORM=fvp -ATF_SFS_PAYLOAD=Build/StandaloneSmmPkg/DEBUG_GCC49/FV/STANDALONESMM.fd -ATF_BUILDFLAGS=ARM_TSP_RAM_LOCATION=dram SFSD=mmd +TOS_BIN=Build/StandaloneSmmPkg/DEBUG_GCC49/FV/STANDALONESMM.fd +ATF_SPD=none +ATF_BUILDFLAGS=ARM_BL31_IN_DRAM=1 SPM=1
[tc2] LONGNAME=Versatile Express TC2