audk/ArmVirtPkg
Sami Mujawar 6038e7a2c2 ArmVirtPkg: Support for kvmtool virtual platform
Kvmtool is a virtual machine manager that enables hosting
KVM guests. Kvmtool emulates certain devices like serial
port, RTC, etc. essentially providing a virtual platform.

This patch adds support for kvmtool virtual platform.

Following is a brief description of the firmware
implementation choices:

- Serial Port: 16550 UART
  On some platforms the 16550 UART is interfaced using
  PCI. Therefore, the 16550 Serial port library is
  dependent on the PCI library. The 16550 UART driver
  checks the Device ID represented using the PCD
  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialPciDeviceInfo
  to determine if the UART is behind PCI.
  If the Device ID is 0xFF then the serial 16550 UART
  is not behind PCI.

  On Kvmtool the Serial 16550 UART is not behind PCI,
  and therefore a combination of BasePciLibPciExpress
  and BasePciExpressLib is used to satisfy the PCI
  library dependency.

  The PcdSerialPciDeviceInfo is also set to 0xFF to
  indicate that the Serial 16550 UART is not behind
  PCI. The PCD PcdSerialUseMmio is also set to TRUE
  to indicate MMIO accesses are required for the
  UART registers.

  Additionally two instances of PlatformHookLibs are
  provided EarlyFdt16550SerialPortHookLib and
  Fdt16550SerialPortHookLib to patch the
  PcdSerialRegisterBase so that BaseSerialPortLib16550
  and retrieve the base address of the 16550 UART.

- Dependency order for Flash
  FaultTolerantWriteDxe makes use of PCDs (e.g.
  PcdFlashNvStorageFtwSpareBase64 etc.), which in
  case of kvmtool will be evaluated based on the CFI
  flash base address read from the DT. These variables
  are populated in the NorFlashPlatformLib loaded by
  ArmVeNorFlashDxe.

  This results in a dependency issue with
  FaultTolerantWriteDxe. To resolve this make the
  NorFlashPlatformLib as a library dependency for
  FaultTolerantWriteDxe.

- RTC Controller
  A separate patch updates the MC146818 RTC controller
  driver to support MMIO accesses.
  A KvmtoolRtcFdtClientLib has been introduced to
  extract the base addresses of the RTC controller
  from the platform device tree and map the RTC
  register space as Runtime Memory.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-10-16 17:21:04 +00:00
..
FdtClientDxe ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
HighMemDxe ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
Include ArmVirtPkg: GUID Hob for 16550 UART base address 2020-10-16 17:21:04 +00:00
KvmtoolPlatformDxe ArmVirtPkg: Add kvmtool platform driver 2020-10-16 17:21:04 +00:00
Library ArmVirtPkg: Add Kvmtool Platform Pei Lib 2020-10-16 17:21:04 +00:00
PlatformCI ArmVirtPkg: Add Platform CI and configuration for Core CI 2020-04-28 18:07:59 +00:00
PlatformHasAcpiDtDxe ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
PrePi ArmVirtPkg: remove unused files 2020-06-12 22:17:46 +00:00
VirtioFdtDxe ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
XenAcpiPlatformDxe ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
XenPlatformHasAcpiDtDxe ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
XenioFdtDxe ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
ArmVirt.dsc.inc ArmVirtPkg: enable HttpDynamiCommand 2020-10-01 11:36:06 +00:00
ArmVirtKvmTool.dsc ArmVirtPkg: Support for kvmtool virtual platform 2020-10-16 17:21:04 +00:00
ArmVirtKvmTool.fdf ArmVirtPkg: Support for kvmtool virtual platform 2020-10-16 17:21:04 +00:00
ArmVirtPkg.ci.yaml ArmVirtPkg/ArmVirtPkg.ci.yaml: Add configuration for Ecc check 2020-08-17 03:28:09 +00:00
ArmVirtPkg.dec ArmVirtPkg: GUID Hob for 16550 UART base address 2020-10-16 17:21:04 +00:00
ArmVirtQemu.dsc ArmVirtPkg: control PXEv4 / PXEv6 boot support from the QEMU command line 2020-04-28 22:37:35 +00:00
ArmVirtQemu.fdf ArmVirtPkg/ArmVirtQemu: enable TPM2 support in the PEI phase 2020-03-04 08:48:09 +00:00
ArmVirtQemuFvMain.fdf.inc ArmVirtPkg: enable HttpDynamiCommand 2020-10-01 11:36:06 +00:00
ArmVirtQemuKernel.dsc ArmVirtPkg/PrePi: use standard PeCoff routines for self-relocation 2020-06-12 22:17:46 +00:00
ArmVirtQemuKernel.fdf ArmVirtPkg: add FDF rule for self-relocating PrePi 2020-06-12 22:17:46 +00:00
ArmVirtRules.fdf.inc ArmVirtPkg: add FDF rule for self-relocating PrePi 2020-06-12 22:17:46 +00:00
ArmVirtXen.dsc ArmVirtPkg/PrePi: use standard PeCoff routines for self-relocation 2020-06-12 22:17:46 +00:00
ArmVirtXen.fdf ArmVirtPkg: enable HttpDynamiCommand 2020-10-01 11:36:06 +00:00
VarStore.fdf.inc ArmVirtPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00