Hi Beom, Good to know you are able to get TFTF working with RME enabled. I may know the reason for the problem you are facing with UEFI. Setting the ENABLE_RME=1 flag in TF-A, causes BL31 to carve out final 64 MB of DRAM for Secure, Root and Realm world usage. See here for the code changes : https://github.com/ARM-software/arm-trusted-firmware/blob/330669de94bace7431...
Previously , without RME, this carveout was 16 MB for Secure world usage (0xff00 0000 – 0xffff ffff). UEFI tries to access the region between 0xfc00 0000 – 0xff00 0000 and when ENABLE_RME=1, this region is no longer available to Normal world/UEFI and will generate a fault.
For linux boot, we modify the DT to convey this information about carveout size as seen here : https://github.com/ARM-software/arm-trusted-firmware/blob/master/fdts/fvp-ba...
Similarly, UEFI needs to be told about change in DDR memory such that it will only access memory from 0x80000000 to 0xFBFF FFFF when running on FVP with RME enabled in TF-A.
Best Regards Soby Mathew
From: Beom Heyn Kim via TF-A tf-a@lists.trustedfirmware.org Sent: 08 February 2022 09:51 To: tf-a@lists.trustedfirmware.org Subject: [TF-A] Cannot successfully jump to the UEFI Boot Loader in the normal world with the RME enabled FVP_Base_RevC_2xAEMvA
Hi,
With RME enabled FVP_Base_RevC_2xAEMvA, we are trying to have TF-A's BL31 successfully exit EL3 and jump to a normal world boot firmware (edk2 UEFI boot loader) instead of tftf.bin. Yet, it fails with the following log messages (showing the last 3): INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0x88000000 INFO: SPSR = 0x3c9 We could boot and run RMM and tftf.bin successfully following the instructions on the TF-A documentation page (https://trustedfirmware-a.readthedocs.io/en/latest/components/realm-manageme...). While keeping build and run commands same, we tried to just replace the tftf.bin with FVP_AARCH64_EFI.fd, the build artifact of the edk2-platform for ARM (https://github.com/tianocore/edk2-platforms/tree/master/Platform/ARM)
We checked both tftf.bin and FVP_AARCH64_EFI.fd cases result in the same entry point address 0x88000000. Yet, the latter stops after exiting EL3 as aforementioned, unlike tftf.bin which successfully proceeds to run some tests afterwards. Also, we found that FVP_AARCH64_EFI.fd can boot successfully with the same fast model but without RME enabled.
What is the possible reason for this symptom and the necessary tweaks we should do to address this issue? What should we look for to get some clue?
Cheers,