This replaces the EmuVariableRuntime driver (which loses its memory at reset) with the real VariableRuntimeDxe runtime driver backed by the SPI flash which is accessed via the SCP.
This involves keeping a copy of the varstore contents in memory, and keeping it in sync with the Write() and Erase() commands that are issued via the firmware volume protocol.
Only mildly tested. Not tested yet under the OS.
Ard Biesheuvel (4): Platforms/AMD/Styx: implement SPI flash runtime driver to back the varstore Platforms/AMD/Styx: reshuffle flash layout and add variable store region Platforms/AMD/Styx: reallocate the in-memory copy of the varstore FV Platforms/AMD/Styx: switch to the real variable runtime driver
Platforms/AMD/Styx/AmdStyx.dec | 6 + Platforms/AMD/Styx/CelloBoard/CelloBoard.dsc | 14 +- Platforms/AMD/Styx/CelloBoard/CelloBoard.fdf | 10 +- Platforms/AMD/Styx/Common/Varstore.fdf.inc | 70 +++ Platforms/AMD/Styx/Drivers/StyxSpiFvDxe/StyxSpiFvDxe.c | 503 ++++++++++++++++++++ Platforms/AMD/Styx/Drivers/StyxSpiFvDxe/StyxSpiFvDxe.inf | 63 +++ Platforms/AMD/Styx/Library/MemoryInitPei/MemoryInitPeiLib.c | 41 ++ Platforms/AMD/Styx/Library/MemoryInitPei/MemoryInitPeiLib.inf | 9 + Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.dsc | 15 +- Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.fdf | 10 +- 10 files changed, 729 insertions(+), 12 deletions(-) create mode 100644 Platforms/AMD/Styx/Common/Varstore.fdf.inc create mode 100644 Platforms/AMD/Styx/Drivers/StyxSpiFvDxe/StyxSpiFvDxe.c create mode 100644 Platforms/AMD/Styx/Drivers/StyxSpiFvDxe/StyxSpiFvDxe.inf