41 return mFwCfgSelectorAddress;
57 return mFwCfgDataAddress;
73 return mFwCfgDmaAddress;
86 UINTN AddressCells, SizeCells;
87 UINT64 FwCfgSelectorAddress;
88 UINT64 FwCfgSelectorSize;
89 UINT64 FwCfgDataAddress;
91 UINT64 FwCfgDmaAddress;
100 if (FwCfgResource !=
NULL) {
101 mFwCfgSelectorAddress = FwCfgResource->FwCfgSelectorAddress;
102 mFwCfgDataAddress = FwCfgResource->FwCfgDataAddress;
103 mFwCfgDmaAddress = FwCfgResource->FwCfgDmaAddress;
105 if (mFwCfgDmaAddress != 0) {
114 Status =
gBS->LocateProtocol (
115 &gFdtClientProtocolGuid,
121 Status = FdtClient->FindCompatibleNodeReg (
129 if (EFI_ERROR (Status)) {
132 "%a: No 'qemu,fw-cfg-mmio' compatible DT node found (Status == %r)\n",
139 ASSERT (AddressCells == 2);
140 ASSERT (SizeCells == 2);
141 ASSERT (RegSize == 2 *
sizeof (UINT64));
145 FwCfgSelectorAddress = FwCfgDataAddress + FwCfgDataSize;
146 FwCfgSelectorSize = 2;
158 ASSERT (FwCfgSelectorAddress <= MAX_UINTN - FwCfgSelectorSize + 1);
159 ASSERT (FwCfgDataAddress <= MAX_UINTN - FwCfgDataSize + 1);
161 mFwCfgSelectorAddress = FwCfgSelectorAddress;
162 mFwCfgDataAddress = FwCfgDataAddress;
166 "Found FwCfg @ 0x%Lx/0x%Lx\n",
167 FwCfgSelectorAddress,
172 FwCfgDmaAddress = FwCfgDataAddress + 0x10;
178 ASSERT (FwCfgDmaAddress <= MAX_UINTN - FwCfgDmaSize + 1);
180 DEBUG ((DEBUG_INFO,
"Found FwCfg DMA @ 0x%Lx\n", FwCfgDmaAddress));
195 if (FwCfgDmaAddress != 0) {
200 if ((Features & FW_CFG_F_DMA) != 0) {
201 mFwCfgDmaAddress = FwCfgDmaAddress;
208 mFwCfgSelectorAddress = 0;
209 mFwCfgDataAddress = 0;
UINT64 EFIAPI SwapBytes64(IN UINT64 Value)
#define SIGNATURE_32(A, B, C, D)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
UINT32 EFIAPI QemuFwCfgRead32(VOID)
VOID EFIAPI QemuFwCfgSelectItem(IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem)
BOOLEAN EFIAPI QemuFwCfgIsAvailable(VOID)
VOID EFIAPI DmaSkipBytes(IN UINTN Size)
QEMU_FW_CFG_RESOURCE * QemuGetFwCfgResourceHob(VOID)
VOID EFIAPI DmaReadBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
VOID EFIAPI DmaWriteBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
UINTN EFIAPI QemuGetFwCfgDmaAddress(VOID)
UINTN EFIAPI QemuGetFwCfgDataAddress(VOID)
UINTN EFIAPI QemuGetFwCfgSelectorAddress(VOID)