Reviewed-by: Chao Li <lichao@loongson.cn>


Thanks,
Chao
在 2023/1/13 11:17, xianglai 写道:
Add bootmode support in PEI phase.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Chao Li <lichao@loongson.cn>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: xianglai li <lixianglai@loongson.cn>
---
 Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform.c b/Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform.c
index 32b6518f8f..84bb8e8a6d 100644
--- a/Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform.c
+++ b/Platform/Loongson/LoongArchQemuPkg/PlatformPei/Platform.c
@@ -53,6 +53,8 @@ CONST EFI_PEI_PPI_DESCRIPTOR  mPpiListBootMode = {
   NULL
 };
 
+STATIC EFI_BOOT_MODE  mBootMode = BOOT_WITH_FULL_CONFIGURATION;
+
 /**
   Create Reserved type memory range hand off block.
 
@@ -417,6 +419,9 @@ InitializePlatform (
 
   DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n"));
 
+  Status = PeiServicesSetBootMode (mBootMode);
+  ASSERT_EFI_ERROR (Status);
+
   Status = PeiServicesInstallPpi (&mPpiListBootMode);
   ASSERT_EFI_ERROR (Status);