Hi Gerd, Thanks, Chao On 2024/3/20 18:16, Gerd Hoffmann wrote: > On Mon, Mar 18, 2024 at 04:28:17PM +0100, Gerd Hoffmann wrote: >> On Sat, Mar 16, 2024 at 10:17:00AM +0800, lixianglai wrote: >>> Hi Gerd: >>>> On Mon, Mar 11, 2024 at 02:39:31AM -0700, Chao Li wrote: >>>>> This library for PEI phase, and obtains the QemuFwCfg base address by >>>>> directly parsing the FDT, reads and writes the data in QemuFwCfg by >>>>> operating on the QemuFwCfg base address. >>>>> create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.c >>>>> create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.inf >>>>> create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgLibInternal.h >>>>> create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgPei.c >>>> Is there anything LoongArch-specific in there? >>> No,The main function of this lib library is to obtain the fwcfg base address by parsing fdt in the pei stage, >>>  and provide access to fwcfg through mmio mode, >>>  the difference between it and the existing library is that the fwcfg base address is not hard-coded in the compilation stage, >>>  and is accessed through mmio rather than io port. >> That would be the case for risc-v and aarch64 too, although I think they >> don't need fw_cfg right now (they get all info needed via fdt). > Oops, I was wrong, we have OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf QemuFwCfgLibMmio.inf is looks like a DXE stage library, while this patch is the PEI stage library we are dicussing. I have tow plans: *Plan A:* Keep this library under LoongArchQemuVirt. *Plan  B:* Create a new INF named QemuFwCfgPeiLibMmio.inf under OvmfPkg/Library/QemuFwCfgLib/, which will obtain the resources from FDT, and store them in the HOB or dynamic PCD. Which one do you like? I'm leaning toward B because more people will be served if it's under OvmfPkg/Library. > > take care, > Gerd > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116944): https://edk2.groups.io/g/devel/message/116944 Mute This Topic: https://groups.io/mt/104859897/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-