Hi Gerd,


Thanks,
Chao
On 2024/3/18 23:28, 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).

I think we should add this as OvmfPkg/Library/FdtQemuFwCfgLib.
Ok, I will commit this change under OvmfPkg/Library next time. Same to patch 20, I will try to adjust and verify in risc-v and aarch64 after merging this change.

Another point that needs to be explained is that because loongarch virtual machine runs on flash in pei phase,
it cannot assign the pcd global variable, so we use Hob as the global variable to store the fwcfg base address.
I think the dynamic PCD database is stored in a HOB and you should be
able to set PCDs them even when running from (read-only) flash.
Let's me try.

take care,
  Gerd





_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116876) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_