Hi Gerd,
I guess if the PCD type is FixedAtbuild, then it might not be in the HOB, because the global symbols will be in the GOT table. And it really doesn't work in the flash stage(I tried it before and I just tried it again).On Fri, Mar 15, 2024 at 06:19:12PM +0800, Chao Li wrote:Hi Gerd, Thanks, Chao On 2024/3/15 17:36, Gerd Hoffmann wrote:On Mon, Mar 11, 2024 at 05:39:08PM +0800, Chao Li wrote:Add a early serial port output library into LoongArchVirt that named EarlyFdtSerialPortLib16550, this library is referenced from MdeModulePkg.Why create your own copy? What are the differences to MdeModulePkg/Library/BaseSerialPortLib16550?This library is used in the PEI stage, same as the Hook Library, LoongArch QEMU is runs on flash in PEI stage, MdeModule version does not support to get the SerialRegisterBase via registers or HOB or FDT,It uses PcdSerialRegisterBase. Having a quick look at the PCD code it looks like the PCD are stored in in a HOB (gPcdDataBaseHobGuid), so setting dynamic PCDs should work even when running directly from flash.
take care, Gerd