audk/ArmVirtPkg/Library
Laszlo Ersek e8ae381f60 ArmVirtPkg/QemuFwCfgLib: use DMA for QemuFwCfgWriteBytes() if available
We use the "InternalQemuFwCfgReadBytes" static function pointer to
dispatch the reading of fw_cfg bytes between MMIO and DMA. This pointer is
initialized to MMIO, and we set it to DMA in the library constructor if
DMA is available.

Unlike the above, we write fw_cfg bytes only with MMIO at the moment.
Extend the write functionality so that it follows the read pattern:
- introduce the new function typedef WRITE_BYTES_FUNCTION,
- extract the current (MMIO-only) write internals from
  QemuFwCfgWriteBytes() to MmioWriteBytes(),
- provide a DMA-based implementation in DmaWriteBytes() -- a thin wrapper
  around DmaTransferBytes(),
- set the new static function pointer "InternalQemuFwCfgWriteBytes"
  according to the DMA feature provided by QEMU,
- In QemuFwCfgWriteBytes(), call the best available method through
  "InternalQemuFwCfgWriteBytes".

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-01-31 00:14:39 +01:00
..
ArmQemuRelocatablePlatformLib ArmVirtPkg/FdtParser: avoid unaligned accesses with the MMU off 2016-09-13 15:35:36 +01:00
ArmVirtDxeHobLib ArmVirtPkg DxeHobLib: Update func header description of BuildFv(2)Hob() 2016-11-17 09:27:14 +08:00
ArmVirtGicArchLib ArmVirtPkg/ArmVirtGicArchLib: eliminate unchecked PcdSetXX() calls 2016-10-25 10:46:29 +02:00
ArmVirtMemoryInitPeiLib ArmVirtPkg: restrict mapping attributes of normal memory to EFI_MEMORY_WB 2016-09-08 10:35:22 +01:00
ArmVirtPL031FdtClientLib ArmVirtPkg/ArmVirtPL031FdtClientLib: eliminate unchecked PcdSetXX() calls 2016-10-25 10:46:32 +02:00
ArmVirtPlatformLib ArmVirtPkg/ArmVirtPlatformLib: eliminate unchecked PcdSetXX() calls 2016-10-25 10:46:33 +02:00
ArmVirtPsciResetSystemLib ArmVirtPkg/ArmVirtPsciResetSystemLib: move to FDT client protocol 2016-04-11 18:12:21 +02:00
ArmVirtTimerFdtClientLib ArmVirtPkg/ArmVirtTimerFdtClientLib: eliminate unchecked PcdSetXX() calls 2016-10-25 10:46:35 +02:00
ArmXenRelocatablePlatformLib ArmVirtPkg/FdtParser: avoid unaligned accesses with the MMU off 2016-09-13 15:35:36 +01:00
BaseCachingPciExpressLib ArmVirtPkg/BaseCachingPciExpressLib: depend on PciPcdProducerLib 2016-04-12 16:57:20 +02:00
FdtPL011SerialPortLib ArmVirtPkg/FdtPL011SerialPortLib: Set the PL011 UART clock rate 2016-06-15 16:16:43 +02:00
FdtPciHostBridgeLib ArmVirtPkg/FdtPciHostBridgeLib: enable 64-bit PCI DMA 2016-09-06 15:46:53 +01:00
FdtPciPcdProducerLib ArmVirtPkg/FdtPciPcdProducerLib: eliminate unchecked PcdSetXX() calls 2016-10-25 10:46:36 +02:00
NorFlashQemuLib ArmVirtPkg/NorFlashQemuLib: rebase to ARRAY_SIZE() 2016-10-27 10:50:19 +02:00
PlatformBootManagerLib ArmVirPkg/PlatformBds: Dispatch deferred images after EndOfDxe 2016-11-10 15:58:04 +08:00
PlatformPeiLib Renamed ArmPlatformPkg/ArmVirtualizationPkg into ArmVirtPkg 2015-05-29 13:50:43 +00:00
QemuFwCfgLib ArmVirtPkg/QemuFwCfgLib: use DMA for QemuFwCfgWriteBytes() if available 2017-01-31 00:14:39 +01:00
XenRealTimeClockLib ArmVirtPkg: XenRealTimeClockLib: fixup typo in Linaro copyright notice 2015-06-08 22:00:32 +00:00