From fe6b6feca7b6012278a432226a56f0836ad1c457 Mon Sep 17 00:00:00 2001 From: Xianglai Li Date: Wed, 11 Sep 2024 16:58:53 +0800 Subject: [PATCH] OvmfPkg/LoongArchVirt: Modify loongarch uefi firmware size After the loongarch flash block size is changed from 128K to 256K, qemu requires that the UEFI firmware size be aligned with the flash block size(256K). Otherwise, the firmware cannot be loaded, Use the following code to resolve the old firmware loading problem: mv QEMU_EFI.fd QEMU_EFI.fd-bak cat QEMU_EFI.fd-bak /dev/zero | head -c 16m > ./QEMU_EFI.fd mv QEMU_VARS.fd QEMU_VARS.fd-bak cat QEMU_VARS.fd-bak /dev/zero | head -c 16m > ./QEMU_VARS.fd For the new firmware, we refer to other architecture UEFI and set the UEFI firmware size to align with the flash block size(256K). So for this patch, we set the UEFI firmware size to 256K alignment. Cc: Bibo Mao Cc: Chao Li Signed-off-by: Xianglai Li --- OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc b/OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc index 22373bec6a..6d68a9e3a6 100644 --- a/OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc +++ b/OvmfPkg/LoongArchVirt/LoongArchVirt.fdf.inc @@ -15,18 +15,8 @@ DEFINE FW_BLOCKS = 0x400 DEFINE FW_SIZE = 0x400000 ############################################################################ -#Flash code layout -#Set Sec size in flash -DEFINE SECFV_SIZE = 0x00010000 - -#Set Pei size in flash -DEFINE PEIFV_SIZE = 0x00040000 - -#Set Dxe size in flash -DEFINE DXEFV_SIZE = 0x00350000 - #Set FVMAIN size -DEFINE FVMAIN_SIZE = $(SECFV_SIZE) + $(PEIFV_SIZE) +$(DXEFV_SIZE) +DEFINE FVMAIN_SIZE = $(FW_SIZE) #Set Memory layout DEFINE SEC_PEI_TEMP_RAM_BASE = 0x10000