Skip to content

Commit

Permalink
SbsaQemuRme: Add support for SbsaQemuRme platform
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mathieupoirier committed Nov 26, 2024
1 parent 4f0b58d commit 086075d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Platform/Qemu/SbsaQemu/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
```
Expand Down
18 changes: 15 additions & 3 deletions Platform/Qemu/SbsaQemu/SbsaQemu.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Platform/Qemu/SbsaQemu/SbsaQemu.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

[FD.SBSA_FLASH0]
BaseAddress = 0x00000000
Size = 0x00200000
Size = 0x00800000
ErasePolarity = 1
BlockSize = 0x00001000
NumBlocks = 0x200
NumBlocks = 0x800

################################################################################
#
Expand All @@ -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

################################################################################
Expand Down

0 comments on commit 086075d

Please sign in to comment.