When emulating a full stack of ARM Trusted Firmware, OP-TEE, etc, UEFI will not be executed from (emulated) NOR flash but loaded in memory at an a priori unknown memory address and invoked from there.
This implements a version of ArmVirtQemu called ArmVirtQemuKernel which borrows the self relocation code and early DT parsing code from ArmVirtXen, and jumps straight from the SEC to the DXE phase as well. Patch #1 performs some groundwork so that the early PL011 code can be reused Patch #2 implements a new PlatformLib instance that implements the self relocation based on the actual load address and the contents of the DT Patch #3 contains the platform DSC and FDF definitions Ard Biesheuvel (3): ArmVirtPkg/EarlyFdtPL011: allow patchable PCD for initial DT base address ArmVirtPkg: introduce new ArmQemuRelocatablePlatformLib ArmVirtPkg: implement ArmVirtQemuKernel ArmVirtPkg/{ArmVirtQemu.dsc => ArmVirtQemuKernel.dsc} | 50 ++++++++------------ ArmVirtPkg/{ArmVirtQemu.fdf => ArmVirtQemuKernel.fdf} | 49 +++++++++++-------- ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib => ArmQemuRelocatablePlatformLib}/AARCH64/RelocatableVirtHelper.S | 0 ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib => ArmQemuRelocatablePlatformLib}/ARM/RelocatableVirtHelper.S | 0 ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib/ArmXenRelocatablePlatformLib.inf => ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePlatformLib.inf} | 3 +- ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib => ArmQemuRelocatablePlatformLib}/FdtParser.c | 1 + ArmVirtPkg/Library/{ArmVirtPlatformLib/VirtMem.c => ArmQemuRelocatablePlatformLib/QemuVirtMem.c} | 13 ++--- ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib => ArmQemuRelocatablePlatformLib}/RelocatableVirt.c | 0 ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.c | 2 +- ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf | 3 +- 10 files changed, 60 insertions(+), 61 deletions(-) copy ArmVirtPkg/{ArmVirtQemu.dsc => ArmVirtQemuKernel.dsc} (88%) copy ArmVirtPkg/{ArmVirtQemu.fdf => ArmVirtQemuKernel.fdf} (87%) copy ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib => ArmQemuRelocatablePlatformLib}/AARCH64/RelocatableVirtHelper.S (100%) copy ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib => ArmQemuRelocatablePlatformLib}/ARM/RelocatableVirtHelper.S (100%) copy ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib/ArmXenRelocatablePlatformLib.inf => ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePlatformLib.inf} (93%) copy ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib => ArmQemuRelocatablePlatformLib}/FdtParser.c (95%) copy ArmVirtPkg/Library/{ArmVirtPlatformLib/VirtMem.c => ArmQemuRelocatablePlatformLib/QemuVirtMem.c} (88%) copy ArmVirtPkg/Library/{ArmXenRelocatablePlatformLib => ArmQemuRelocatablePlatformLib}/RelocatableVirt.c (100%) -- 2.5.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel