Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RME extension to SBSA #231

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mathieupoirier
Copy link

Hi maintainers,

This pull request is adding support for the RME extension to the SBSA machine. When RME is enabled, the RMM is occupying the first 1GB of system RAM, followed by the DT. This reality needs to be reflected in the base RAM address and more space in flash need to be reserved. Otherwise it is the same configuration as the non-RME aware SBSA implementation.

Thanks,
Mathieu

In preparation to add RME support for SBSA, create a generic descriptor
file with definitions that apply to both SBSA and SBSA-rme.  Definitions
that are specific to SBSA are kept in SbsaQemu.dsc.

No change in functionality.

Signed-off-by: Mathieu Poirier <[email protected]>
RME support for SBSA includes the RMM in the FLASH0 image, something
that needs modification to the FD.SBSA_FLASH0 section.  In order to
avoid enforcing those changes on the SBSA platform, break the flash
descriptor file between specific and generic declarations.

No change in functionality.

Signed-off-by: Mathieu Poirier <[email protected]>
Add support for SBSA-rme 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.

Signed-off-by: Mathieu Poirier <[email protected]>
@hrw
Copy link
Contributor

hrw commented Oct 25, 2024

I wonder can we move PcdSystemMemoryBase by those 1072MB always.

Then check "is there RME present" and if not then add that memory as another entry in memory map. That may require SMC call to TF-A to ask for RME (or other way as I am not familiar with RME yet).

This way one firmware image would work for the platform despite which firmware options are enabled/present.

@mathieupoirier
Copy link
Author

@hrw ok, that's a valuable point. I am completely new to EDK2, can you provide pointers to here the SMC call should be made and the memory map entry added?

@hrw
Copy link
Contributor

hrw commented Oct 25, 2024

All SMC are in Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c on EDK2 side and in plat/qemu/qemu_sbsa/sbsa_sip_svc.c on TF-A side.

When it comes to memory map - check functions which call GetMemInfo() in Silicon/Qemu/* - on NUMA systems we use SMC to get info about all memory nodes and add them into memory map.

So maybe instead of creating copy of dsc/fdf etc:

  • move memorybase to get space for RME (so you can check does it work with/without RME using hardcoded "is RME present or not")
  • add GetRmeInfo() function to SbsaHardwareInfoLib (it may return hardcoded value at start)
  • add SMC call to TF-A so it will report state of RME
  • use above SMC call in GetRmeInfo() function (handle situation when TF-A respond with "sorry, unknown SMC" cause people will get such combos)
  • if no RME then add memory reserved for RME into memory map

NOTE: TF-A 2.12 and edk202411 are coming. RME code for both of them will rather be merged after releases to make sure that we have combo which works for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants