15 Star 6 Fork 58

src-openEuler/edk2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0081-Platform-Loongson-Modify-loongarch-uefi-firmware-siz.patch 2.50 KB
一键复制 编辑 原始数据 按行查看 历史
Wu Xiaotian 提交于 2024-11-20 09:23 +08:00 . Update LoongArch virtual machine
From c9cb2611ae34a79c28671a703368e88267d6cc24 Mon Sep 17 00:00:00 2001
From: Xiaotian Wu <wuxiaotian@loongson.cn>
Date: Tue, 19 Nov 2024 19:05:49 +0800
Subject: [PATCH 2/2] Platform/Loongson: 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.
---
Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc | 8 ++++----
Platform/Loongson/LoongArchQemuPkg/VarStore.fdf.inc | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc b/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc
index e30c4629f7..c31909ca9a 100644
--- a/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc
+++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc
@@ -18,12 +18,12 @@ DEFINE FD_SIZE = 0x400000
#flash code layout
#Set Sec base address and size in flash
DEFINE SECFV_OFFSET = 0x00000000
-DEFINE SECFV_SIZE = 0x00010000
+DEFINE SECFV_SIZE = 0x00040000
#Set Pei base address and size in flash
-DEFINE PEIFV_OFFSET = 0x00010000
+DEFINE PEIFV_OFFSET = 0x00040000
DEFINE PEIFV_SIZE = 0x00040000
#Set Dxe base address and size in flash
-DEFINE DXEFV_OFFSET = 0x00050000
-DEFINE DXEFV_SIZE = 0x00350000
+DEFINE DXEFV_OFFSET = 0x00080000
+DEFINE DXEFV_SIZE = 0x00380000
diff --git a/Platform/Loongson/LoongArchQemuPkg/VarStore.fdf.inc b/Platform/Loongson/LoongArchQemuPkg/VarStore.fdf.inc
index 83ce3d8008..f34901950d 100644
--- a/Platform/Loongson/LoongArchQemuPkg/VarStore.fdf.inc
+++ b/Platform/Loongson/LoongArchQemuPkg/VarStore.fdf.inc
@@ -10,8 +10,8 @@
BaseAddress = 0x0
Size = 0x1000000
ErasePolarity = 1
-BlockSize = 0x20000
-NumBlocks = 128
+BlockSize = 0x40000
+NumBlocks = 64
0x00000000|0x00040000
#NV_VARIABLE_STORE
--
2.46.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/edk2.git
git@gitee.com:src-openeuler/edk2.git
src-openeuler
edk2
edk2
master

搜索帮助