From 086075d70346bac61f04d157df764b16662c2a38 Mon Sep 17 00:00:00 2001 From: Mathieu Poirier Date: Mon, 11 Nov 2024 14:43:35 -0700 Subject: [PATCH] SbsaQemuRme: Add support for SbsaQemuRme platform Add support for SbsaQemuRme platform by 1) pushing the start of the base memory to 0x10043000000 to make room to the RMM and 2) increasing the size of FLASH0 to accomotate the RMM. Enabling RMM is done by specifying -D ENABLE_RME on the build command line. The name of the flag was chosen to reflect what is currently done on TF-A. Signed-off-by: Mathieu Poirier --- Platform/Qemu/SbsaQemu/Readme.md | 4 ++++ Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 18 +++++++++++++++--- Platform/Qemu/SbsaQemu/SbsaQemu.fdf | 8 ++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Platform/Qemu/SbsaQemu/Readme.md b/Platform/Qemu/SbsaQemu/Readme.md index f89a4597c99..cb8bd060dd9 100644 --- a/Platform/Qemu/SbsaQemu/Readme.md +++ b/Platform/Qemu/SbsaQemu/Readme.md @@ -97,6 +97,10 @@ Create a directory $WORKSPACE that would hold source code of the components. cd $WORKSPACE build -b RELEASE -a AARCH64 -t GCC5 -p edk2-platforms/Platform/Qemu/SbsaQemu/SbsaQemu.dsc ``` + An RME aware SBSA system can be compiled by adding `-D ENABLE_RME` to the + command line above. In that case `bl1.bin` and `fip.bin` also have to be RME + aware. Please refer to TF-A instructions to generate RME enabled binaries. + Copy SBSA_FLASH0.fd and SBSA_FLASH1.fd to top $WORKSPACE directory. Then extend the file size to match the machine flash size. ``` diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc index b2cd2529a96..07134dc6f27 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc @@ -11,11 +11,15 @@ # ################################################################################ [Defines] +!if $(ENABLE_RME) + PLATFORM_NAME = SbsaQemuRme +!else PLATFORM_NAME = SbsaQemu +!endif PLATFORM_GUID = feb0325c-b93d-4e47-8844-b832adeb9e0c PLATFORM_VERSION = 0.1 DSC_SPECIFICATION = 0x00010005 - OUTPUT_DIRECTORY = Build/SbsaQemu + OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) SUPPORTED_ARCHITECTURES = AARCH64 BUILD_TARGETS = DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER = DEFAULT @@ -392,10 +396,18 @@ DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE gArmTokenSpaceGuid.PcdVFPEnabled|1 # System Memory Base -- fixed - gArmTokenSpaceGuid.PcdSystemMemoryBase|0x10000000000 + !if $(ENABLE_RME) + # + # When RME is enabled the RMM is installed at 0x10000000000 + # and the system base memory bumped by 1072MB. + # + gArmTokenSpaceGuid.PcdSystemMemoryBase|0x10043000000 + !else + gArmTokenSpaceGuid.PcdSystemMemoryBase|0x10000000000 + !endif # Space for 32 stacks - gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x1000007c000 + gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|gArmTokenSpaceGuid.PcdSystemMemoryBase + 0x7c000 gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800 diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf index 73b71e01b28..f1ed1516e78 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf @@ -21,10 +21,10 @@ [FD.SBSA_FLASH0] BaseAddress = 0x00000000 -Size = 0x00200000 +Size = 0x00800000 ErasePolarity = 1 BlockSize = 0x00001000 -NumBlocks = 0x200 +NumBlocks = 0x800 ################################################################################ # @@ -46,8 +46,8 @@ NumBlocks = 0x200 0x00000000|0x00012000 FILE = Platform/Qemu/Sbsa/bl1.bin -# and FIP (BL2 + BL31) -0x00012000|0x00020000 +# and FIP (BL2 + BL31 + RMM (if present)) +0x00012000|0x007EE000 FILE = Platform/Qemu/Sbsa/fip.bin ################################################################################