Hi Gerd,
I think it would be useful if some platforms(not LoongArch) could use the global variables in PEI, because the global variables are faster.Hi,+UINTN mFwCfgSelectorAddress; +UINTN mFwCfgDataAddress; +UINTN mFwCfgDmaAddress;Hmm, global variables for PEI? I think the point of storing these in the HOB is to avoid the need for global variables? Also does that work when running PEI in-place from flash?
This is a constructor in PEI, that has to parse the device tree and then build the HOBs.+RETURN_STATUS +EFIAPI +QemuFwCfgInitialize ( + VOID + ) +{ + VOID *DeviceTreeBase; + INT32 Node; + INT32 Prev; + CONST CHAR8 *Type; + INT32 Len; + CONST UINT64 *Reg; + UINT64 FwCfgSelectorAddress; + UINT64 FwCfgSelectorSize; + UINT64 FwCfgDataAddress; + UINT64 FwCfgDataSize; + UINT64 FwCfgDmaAddress; + UINT64 FwCfgDmaSize;First thing this function should do is check whenever the HOB already exists. Should that be the case there is no need to parse the device tree.
take care, Gerd