From: "Daniel Schaefer" <daniel.schaefer@hpe.com>
To: <devel@edk2.groups.io>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>,
Abner Chang <abner.chang@hpe.com>,
Sunil V L <sunilvl@ventanamicro.com>
Subject: [edk2-platforms] [PATCH v3 02/14] RISC-V: Split SMBIOS out of PlatformPei
Date: Tue, 19 Oct 2021 11:48:37 +0800 [thread overview]
Message-ID: <20211019034849.16847-3-daniel.schaefer@hpe.com> (raw)
In-Reply-To: <20211019034849.16847-1-daniel.schaefer@hpe.com>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h | 33 ++++----------------
Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c | 17 +---------
Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c | 32 ++++++++++++++++++-
3 files changed, 38 insertions(+), 44 deletions(-)
diff --git a/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h b/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h
index 5d70e26f8359..363b34a8f1ac 100644
--- a/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h
+++ b/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h
@@ -1,7 +1,7 @@
/** @file
SiFive U54 Coreplex library definitions.
- Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+ Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -17,35 +17,14 @@
#define SIFIVE_U5MC_COREPLEX_MC_HART_ID 0
/**
- Build up U5MC coreplex processor core-specific information.
+ Build processor and platform information for the U5 platform
- @param UniqueId U5MC unique ID.
-
- @return EFI_STATUS
+ @return EFI_SUCCESS Status.
**/
EFI_STATUS
-EFIAPI
-CreateU5MCCoreplexProcessorSpecificDataHob (
- IN UINTN UniqueId
- );
-
-/**
- Function to build processor related SMBIOS information. RISC-V SMBIOS DXE driver collect
- this information and build SMBIOS Type4 and Type7 record.
-
- @param ProcessorUid Unique ID of pysical processor which owns this core.
- @param SmbiosDataHobPtr Pointer to receive RISC_V_PROCESSOR_SMBIOS_DATA_HOB. The pointers
- maintained in this structure is only valid before memory is discovered.
- Access to those pointers after memory is installed will cause unexpected issues.
+BuildRiscVSmbiosHobs (
+ VOID
+);
- @return EFI_SUCCESS The PEIM initialized successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-CreateU5MCProcessorSmbiosDataHob (
- IN UINTN ProcessorUid,
- OUT RISC_V_PROCESSOR_SMBIOS_HOB_DATA **SmbiosDataHobPtr
- );
#endif
diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c
index 24192c692ba7..8586a94b6285 100644
--- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c
+++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c
@@ -254,22 +254,7 @@ BuildCoreInformationHob (
VOID
)
{
- EFI_STATUS Status;
- RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr;
-
- // TODO: Create SMBIOS libs for non-U540 platforms
- Status = CreateU5MCCoreplexProcessorSpecificDataHob (0);
- if (EFI_ERROR (Status)) {
- ASSERT(FALSE);
- }
- Status = CreateU5MCProcessorSmbiosDataHob (0, &SmbiosHobPtr);
- if (EFI_ERROR (Status)) {
- ASSERT(FALSE);
- }
-
- DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", SmbiosHobPtr));
-
- return EFI_SUCCESS;
+ return BuildRiscVSmbiosHobs ();
}
/**
diff --git a/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c b/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c
index b2f74c2a743b..bc1b252946d9 100644
--- a/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c
+++ b/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c
@@ -1,7 +1,7 @@
/**@file
Build up platform processor information.
- Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+ Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -32,6 +32,7 @@
@return EFI_SUCCESS The PEIM initialized successfully.
**/
+STATIC
EFI_STATUS
EFIAPI
CreateU5MCCoreplexProcessorSpecificDataHob (
@@ -96,6 +97,7 @@ CreateU5MCCoreplexProcessorSpecificDataHob (
@return EFI_SUCCESS The SMBIOS Hobs were created successfully.
**/
+STATIC
EFI_STATUS
EFIAPI
CreateU5MCProcessorSmbiosDataHob (
@@ -163,3 +165,31 @@ CreateU5MCProcessorSmbiosDataHob (
return EFI_SUCCESS;
}
+
+/**
+ Build processor and platform information for the U5 platform
+
+ @return EFI_SUCCESS Status.
+
+**/
+EFI_STATUS
+BuildRiscVSmbiosHobs (
+ VOID
+)
+{
+ EFI_STATUS Status;
+ RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr;
+
+ Status = CreateU5MCCoreplexProcessorSpecificDataHob (0);
+ if (EFI_ERROR (Status)) {
+ ASSERT(FALSE);
+ }
+ Status = CreateU5MCProcessorSmbiosDataHob (0, &SmbiosHobPtr);
+ if (EFI_ERROR (Status)) {
+ ASSERT(FALSE);
+ }
+
+ DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", SmbiosHobPtr));
+
+ return EFI_SUCCESS;
+}
--
2.31.1
next prev parent reply other threads:[~2021-10-19 3:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-19 3:48 [edk2-platforms] [PATCH v3 00/14] Use generic OpenSBI platform Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 01/14] U5SeriesPkg: Deduplicate PlatformPei Daniel Schaefer
2021-10-19 3:48 ` Daniel Schaefer [this message]
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 03/14] RISC-V: Use U5 SMBIOS library only for those platforms Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 04/14] Silicon/RISC-V: Introduce FirmwareContext library Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 05/14] Silicon/RISC-V: PeiServiceTableLib uses RiscVFirmwareContextLib Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 06/14] SiFive/U5SeriesPkg: Use FirmwareContext library Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 07/14] U540: Add and build device tree Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 08/14] RISC-V/PlatformPkg: Build DeviceTree and use that in SEC Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 09/14] RISC-V/PlatformPkg: Add FdtPeim to pass DTB from PEI to DXE via HOB Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 10/14] RISC-V/PlatformPkg: Fixup FDT from HOB and install into config table Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 11/14] U5SeriesPkg: Switch to generic OpenSBI platform Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 12/14] RISC-V: Switch to latest OpenSBI Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 13/14] RISC-V: Implement ResetSystem RT call Daniel Schaefer
2021-10-19 3:48 ` [edk2-platforms] [PATCH v3 14/14] Move OpenSbiPlatformLib to RISC-V/PlatformPkg Daniel Schaefer
2021-10-19 5:58 ` [edk2-platforms] [PATCH v3 00/14] Use generic OpenSBI platform Abner Chang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211019034849.16847-3-daniel.schaefer@hpe.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox