[edk2-devel] [PATCH 52/79] RiscVPlatformPkg/Sec: Check Cold/Warm hart

Abner Chang abner.chang at hpe.com
Sat Jan 8 07:24:35 UTC 2022


(This is migrated from edk2-platforms:Platform)
Check Coldboot or Warmboot hart in SEC OpenSBI platform function.

Cc: Sunil V L <sunilvl at ventanamicro.com>
Cc: Daniel Schaefer <daniel.schaefer at hpe.com>
Signed-off-by: Abner Chang <abner.chang at hpe.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer at hpe.com>
Reviewed-by: Sunil V L <sunilvl at ventanamicro.com>
---
 .../RISC-V/PlatformPkg/Universal/Sec/SecMain.c    | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c
index 51d9edfe75..9b162fb3b6 100644
--- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c
+++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c
@@ -398,6 +398,13 @@ SecPostOpenSbiPlatformEarlylInit(
   IN BOOLEAN ColdBoot
   )
 {
+  UINT32 HartId;
+
+  if (!ColdBoot) {
+    HartId = current_hartid();
+    DEBUG ((DEBUG_INFO, "%a: Non boot hart %d.\n", __FUNCTION__, HartId));
+    return 0;
+  }
   //
   // Boot HART is already in the process of OpenSBI initialization.
   // We can let other HART to keep booting.
@@ -423,6 +430,12 @@ SecPostOpenSbiPlatformFinalInit (
   struct sbi_platform *SbiPlatform;
   EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext;
 
+  if (!ColdBoot) {
+    HartId = current_hartid();
+    DEBUG ((DEBUG_INFO, "%a: Non boot hart %d.\n", __FUNCTION__, HartId));
+    return 0;
+  }
+
   DEBUG((DEBUG_INFO, "%a: Entry, preparing to jump to PEI Core\n\n", __FUNCTION__));
 
   SbiScratch = sbi_scratch_thishart_ptr();
@@ -777,7 +790,7 @@ VOID EFIAPI SecCoreStartUpWithStack(
   sbi_init(Scratch);
 }
 
-void xxxx (char *debugstr, ...)
+void OpensbiDebugPrint (char *debugstr, ...)
 {
   VA_LIST  Marker;
 
-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85397): https://edk2.groups.io/g/devel/message/85397
Mute This Topic: https://groups.io/mt/88279797/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list