mirror of https://github.com/acidanthera/audk.git
ArmVirtPkg: VirtFdtDxe: detect fw-cfg DMA interface from the DTB
A DMA-like transfer interface has recently been implemented in QEMU for fw-cfg. For ARM and AARCH64 virtual machines, the binding prescribes a new 8-byte wide register at offset 0x10 in the register block. Make VirtFdtDxe expose this register if it is present. Please see "docs/specs/fw_cfg.txt" in the QEMU tree for more information. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18544 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6add86ab59
commit
50b91449a3
|
@ -67,6 +67,7 @@
|
||||||
|
|
||||||
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress|0x0|UINT64|0x00000004
|
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress|0x0|UINT64|0x00000004
|
||||||
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress|0x0|UINT64|0x00000005
|
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress|0x0|UINT64|0x00000005
|
||||||
|
gArmVirtTokenSpaceGuid.PcdFwCfgDmaAddress|0x0|UINT64|0x00000009
|
||||||
|
|
||||||
#
|
#
|
||||||
# Supported GIC revision (2, 3, ...)
|
# Supported GIC revision (2, 3, ...)
|
||||||
|
|
|
@ -199,6 +199,7 @@
|
||||||
|
|
||||||
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress|0x0
|
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress|0x0
|
||||||
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress|0x0
|
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress|0x0
|
||||||
|
gArmVirtTokenSpaceGuid.PcdFwCfgDmaAddress|0x0
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set video resolution for boot options and for text setup.
|
# Set video resolution for boot options and for text setup.
|
||||||
|
|
|
@ -144,6 +144,7 @@
|
||||||
|
|
||||||
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress|0x0
|
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress|0x0
|
||||||
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress|0x0
|
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress|0x0
|
||||||
|
gArmVirtTokenSpaceGuid.PcdFwCfgDmaAddress|0x0
|
||||||
|
|
||||||
gArmVirtTokenSpaceGuid.PcdArmPsciMethod|0
|
gArmVirtTokenSpaceGuid.PcdArmPsciMethod|0
|
||||||
|
|
||||||
|
|
|
@ -302,6 +302,8 @@ InitializeVirtFdtDxe (
|
||||||
UINT64 FwCfgSelectorSize;
|
UINT64 FwCfgSelectorSize;
|
||||||
UINT64 FwCfgDataAddress;
|
UINT64 FwCfgDataAddress;
|
||||||
UINT64 FwCfgDataSize;
|
UINT64 FwCfgDataSize;
|
||||||
|
UINT64 FwCfgDmaAddress;
|
||||||
|
UINT64 FwCfgDmaSize;
|
||||||
|
|
||||||
Hob = GetFirstGuidHob(&gFdtHobGuid);
|
Hob = GetFirstGuidHob(&gFdtHobGuid);
|
||||||
if (Hob == NULL || GET_GUID_HOB_DATA_SIZE (Hob) != sizeof (UINT64)) {
|
if (Hob == NULL || GET_GUID_HOB_DATA_SIZE (Hob) != sizeof (UINT64)) {
|
||||||
|
@ -382,6 +384,19 @@ InitializeVirtFdtDxe (
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "Found FwCfg @ 0x%Lx/0x%Lx\n", FwCfgSelectorAddress,
|
DEBUG ((EFI_D_INFO, "Found FwCfg @ 0x%Lx/0x%Lx\n", FwCfgSelectorAddress,
|
||||||
FwCfgDataAddress));
|
FwCfgDataAddress));
|
||||||
|
|
||||||
|
if (fdt64_to_cpu (((UINT64 *)RegProp)[1]) >= 0x18) {
|
||||||
|
FwCfgDmaAddress = FwCfgDataAddress + 0x10;
|
||||||
|
FwCfgDmaSize = 0x08;
|
||||||
|
|
||||||
|
//
|
||||||
|
// See explanation above.
|
||||||
|
//
|
||||||
|
ASSERT (FwCfgDmaAddress <= MAX_UINTN - FwCfgDmaSize + 1);
|
||||||
|
|
||||||
|
PcdSet64 (PcdFwCfgDmaAddress, FwCfgDmaAddress);
|
||||||
|
DEBUG ((EFI_D_INFO, "Found FwCfg DMA @ 0x%Lx\n", FwCfgDmaAddress));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PropertyTypeVirtio:
|
case PropertyTypeVirtio:
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
gArmVirtTokenSpaceGuid.PcdArmPsciMethod
|
gArmVirtTokenSpaceGuid.PcdArmPsciMethod
|
||||||
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress
|
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress
|
||||||
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress
|
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress
|
||||||
|
gArmVirtTokenSpaceGuid.PcdFwCfgDmaAddress
|
||||||
gArmVirtTokenSpaceGuid.PcdArmGicRevision
|
gArmVirtTokenSpaceGuid.PcdArmGicRevision
|
||||||
gArmTokenSpaceGuid.PcdGicDistributorBase
|
gArmTokenSpaceGuid.PcdGicDistributorBase
|
||||||
gArmTokenSpaceGuid.PcdGicRedistributorsBase
|
gArmTokenSpaceGuid.PcdGicRedistributorsBase
|
||||||
|
|
Loading…
Reference in New Issue