Hi Gerd: > On Mon, Mar 11, 2024 at 02:39:24AM -0700, Chao Li wrote: >> Add NorFlashQemuLib for LoongArch, it is referenced from ArmVirtPkg. > What are the differences to the ArmVirtPkg version? In this lib we have assigned the following three pcd variables: PcdFlashNvStorageVariableBase PcdFlashNvStorageFtwWorkingBase PcdFlashNvStorageFtwSpareBase Instead of hardcoding these three variables in the VarStore.fdf.inc file as arm does, the benefit is that when the flash base address changes in the qemu implementation, there is no need to re-adapt and compile UEFI.
Other small differences are in the BIOS base address using different PCD variables, and this library only parse a flash rather than more pieces which handles arm Libs better. It is necessary to point out that the original NV variable address space is specified by the bios, and then look for flash in the NV variable address space, while the current lib implementation is given the flash base address as the NV variable address space The former implementation should theoretically be able to map multiple pieces of flash into the NV variable address space, but we currently only add a piece of flash as an NV variable storage space when using it. When I tried to implement the current patch scheme on aarch64, I found that the FaultTolerantWriteDxe driver loaded earlier than VirtNorFlashDxe. And It requires the PcdFlashNvStorageFtwWorkingSize and PcdFlashNvStorageFtwSpareSize variables for initialization, However the initialization of these two variables is completed in VirtNorFlashDxe, The fdf file specifies that VirtNorFlashDxe is loaded first and then FaultTolerantWriteDxe is loaded in loongarch64. So this is going to be a problem if we want to apply the current solution to aarch64 or risc-v. I can't tell the implementation scheme of the current lib and existing lib implementation scheme which one is better, Could you give we some advice? Thanks, Xianglai. > Is it possible to have a FdtNorFlashQemuLib which is shared > between arm and loongarch? And maybe risc-v too? > > take care, > Gerd > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116821): https://edk2.groups.io/g/devel/message/116821 Mute This Topic: https://groups.io/mt/104859896/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-