On Mon, 6 May 2024 at 12:02, Chao Li <lic...@loongson.cn> wrote: > > Hi Gerd, > > > Thanks, > Chao > On 2024/3/19 16:03, Gerd Hoffmann wrote: > > Hi, > > 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? > > I'd suggest to merge your code as OvmfPkg/Library/FdtNorFlashQemuLib as > it is not really loongarch-specific. > > If you want try switch aarch64 to use the same code that'll be great, > but sorting that out later is also fine with me. > > If you think this design is looks better, then I'm prepare to commit this > change under the OvmfPkg/Library as a public library. And I will enable it > in aarch64 after merging this change, because I think it may be tweaked and > validated in aarch64 for many platforms. Do you think that is good? > > The VirtNorFlashDxe is optimized for qemu-emulated pflash. It tries to > avoid switching between read and write mode much, because that operation > has a significant overhead in virtualization. So it's really only used > by ArmVirtPkg and not lots of other arm platforms. > > I'm moving the ARM version of the library to OvmfPkg and adding the set PCD > method, I have verified successfully on ArmVirtQemu.dsc(both -bios and > pflash), but I found that the ArmVirtQemuKernel.dsc also depends this > library, so what's the difference between the two platforms? > > When I try to verify on ArmVirtQemuKernel.dsc that it works based on -bios > option, I use the command line "qemu-system-aarch64 -M virt -cpu cortex-a57 > -bios LA_Virt_FW/AARCH64/QEMU_EFI.fd -net none -serial stdio -hdb > /home/lichao/Software/Qemu/SctPkg/share.imag -device ramfb -device > nec-usb-xhci -device usb-mouse -device usb-kbd", and it tells me "Could not > open option rom 'vgabios-ramfb.bin': No such file or directory", I tried > removing the option "-device ramfb", it looks like can't work. > > How does ArmVirtQemuKernel.dsc work? >
It uses the -kernel QEMU command line argument, not the -bios one. This uses the Linux/arm64 kernel boot protocol (and runs the firmware entirely from RAM) rather than booting from NOR flash. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118595): https://edk2.groups.io/g/devel/message/118595 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] -=-=-=-=-=-=-=-=-=-=-=-