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:
v3: Split last patch in v2 to separate changes to remove the EDK2_ENABLE_SMSC_91X build option and to update the ARM TF build command line
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
This patch removes the EDK2_ENABLE_SMSC_91X option from the EDK2 build for the Normal world Standalone MM image. This option was adding to the boot time and is not relevant to Standalone MM feature development.
Signed-off-by: Achin Gupta achin.gupta@arm.com --- platforms.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platforms.config b/platforms.config index dc1ee21..5455477 100644 --- a/platforms.config +++ b/platforms.config @@ -103,7 +103,7 @@ UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-MM-Standalone [fvp_mm_normal] 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
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 | 9 ++++----- 2 files changed, 24 insertions(+), 16 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 5455477..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,7 +99,7 @@ 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 ARM_STANDALONE_MM_ENABLE=TRUE ARCH=AARCH64 @@ -109,8 +107,9 @@ 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
On Wed, 2017-05-24 at 17:38 +0100, achin.gupta@arm.com wrote:
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 | 9 ++++----- 2 files changed, 24 insertions(+), 16 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_PAYL
OAD"
if [ X"$SPD" == X"none" ] && [ X"$TOS_BIN" != X"" ];
then
BL32=$EDK2_DIR/$TOS_BIN
SPD_OPTION="BL32=$BL32"
Here, we need to set SPD_OPTION="SPM=1" as BL32 is set in the previous statement already.
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 5455477..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,7 +99,7 @@ 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 ARM_STANDALONE_MM_ENABLE=TRUE ARCH=AARCH64 @@ -109,8 +107,9 @@ 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
It should be "Build/StandaloneSmmPkg/DEBUG_GCC5/FV/STANDALONESMM.fd"
+ATF_SPD=none +ATF_BUILDFLAGS=ARM_BL31_IN_DRAM=1 SPM=1
SPM=1 should be set TOS_BIN is available and ATF_SPD=none, so better to remove it from here.
[tc2] LONGNAME=Versatile Express TC2
On Wed, May 24, 2017 at 05:38:43PM +0100, achin.gupta@arm.com wrote:
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
I updated the subject line on 1/3 before committing but: Signed-off-by: Leif Lindholm leif.lindholm@linaro.org
Pushed as 79419dc..b9bf00c.
Regards,
Leif
Changelog:
v3: Split last patch in v2 to separate changes to remove the EDK2_ENABLE_SMSC_91X build option and to update the ARM TF build command line
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(-)
-- 1.9.1