PropertyTypeRtc,\r
PropertyTypeVirtio,\r
PropertyTypeUart,\r
- PropertyTypeFwCfg,\r
PropertyTypePciHost,\r
PropertyTypeXen,\r
} PROPERTY_TYPE;\r
{ PropertyTypeRtc, "arm,pl031" },\r
{ PropertyTypeVirtio, "virtio,mmio" },\r
{ PropertyTypeUart, "arm,pl011" },\r
- { PropertyTypeFwCfg, "qemu,fw-cfg-mmio" },\r
{ PropertyTypePciHost, "pci-host-ecam-generic" },\r
{ PropertyTypeXen, "xen,xen" },\r
{ PropertyTypeUnknown, "" }\r
VIRTIO_TRANSPORT_DEVICE_PATH *DevicePath;\r
EFI_HANDLE Handle;\r
UINT64 RegBase;\r
- UINT64 FwCfgSelectorAddress;\r
- UINT64 FwCfgSelectorSize;\r
- UINT64 FwCfgDataAddress;\r
- UINT64 FwCfgDataSize;\r
- UINT64 FwCfgDmaAddress;\r
- UINT64 FwCfgDmaSize;\r
BOOLEAN HavePci;\r
\r
Hob = GetFirstGuidHob(&gFdtHobGuid);\r
HavePci = TRUE;\r
break;\r
\r
- case PropertyTypeFwCfg:\r
- ASSERT (Len == 2 * sizeof (UINT64));\r
-\r
- FwCfgDataAddress = fdt64_to_cpu (((UINT64 *)RegProp)[0]);\r
- FwCfgDataSize = 8;\r
- FwCfgSelectorAddress = FwCfgDataAddress + FwCfgDataSize;\r
- FwCfgSelectorSize = 2;\r
-\r
- //\r
- // The following ASSERT()s express\r
- //\r
- // Address + Size - 1 <= MAX_UINTN\r
- //\r
- // for both registers, that is, that the last byte in each MMIO range is\r
- // expressible as a MAX_UINTN. The form below is mathematically\r
- // equivalent, and it also prevents any unsigned overflow before the\r
- // comparison.\r
- //\r
- ASSERT (FwCfgSelectorAddress <= MAX_UINTN - FwCfgSelectorSize + 1);\r
- ASSERT (FwCfgDataAddress <= MAX_UINTN - FwCfgDataSize + 1);\r
-\r
- PcdSet64 (PcdFwCfgSelectorAddress, FwCfgSelectorAddress);\r
- PcdSet64 (PcdFwCfgDataAddress, FwCfgDataAddress);\r
-\r
- DEBUG ((EFI_D_INFO, "Found FwCfg @ 0x%Lx/0x%Lx\n", FwCfgSelectorAddress,\r
- FwCfgDataAddress));\r
-\r
- if (fdt64_to_cpu (((UINT64 *)RegProp)[1]) >= 0x18) {\r
- FwCfgDmaAddress = FwCfgDataAddress + 0x10;\r
- FwCfgDmaSize = 0x08;\r
-\r
- //\r
- // See explanation above.\r
- //\r
- ASSERT (FwCfgDmaAddress <= MAX_UINTN - FwCfgDmaSize + 1);\r
-\r
- PcdSet64 (PcdFwCfgDmaAddress, FwCfgDmaAddress);\r
- DEBUG ((EFI_D_INFO, "Found FwCfg DMA @ 0x%Lx\n", FwCfgDmaAddress));\r
- }\r
- break;\r
-\r
case PropertyTypeVirtio:\r
ASSERT (Len == 16);\r
//\r