* [PATCH v4 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib
2022-09-19 2:19 [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
@ 2022-09-19 2:19 ` Nhi Pham
2022-09-19 2:19 ` [PATCH v4 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Nhi Pham
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Nhi Pham @ 2022-09-19 2:19 UTC (permalink / raw)
To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
Cc: patches, Minh Nguyen, Nhi Pham, Rebecca Cran, Ard Biesheuvel
From: Minh Nguyen <minhn@amperecomputing.com>
In some scenarios, the processor version may be updated dynamically
from pre-UEFI firmware during booting. But the processor version is
fixed with PCD (PcdProcessorVersion), so it can not be updated it
dynamically. This patch will support setting that value both
statically and dynamically.
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
---
ArmPkg/Include/Library/OemMiscLib.h | 2 ++
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 47cb30d84a62..330bb4b014de 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -1,5 +1,6 @@
/** @file
*
+* Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
* Copyright (c) 2021, NUVIA Inc. All rights reserved.
* Copyright (c) 2015, Hisilicon Limited. All rights reserved.
* Copyright (c) 2015, Linaro Limited. All rights reserved.
@@ -58,6 +59,7 @@ typedef enum {
SkuNumberType03,
ProcessorPartNumType04,
ProcessorSerialNumType04,
+ ProcessorVersionType04,
SmbiosHiiStringFieldMax
} OEM_MISC_SMBIOS_HII_STRING_FIELD;
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index 0b9af9bd7e1c..3b12e26abf6e 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -1,6 +1,7 @@
/** @file
ProcessorSubClass.c
+ Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
Copyright (c) 2015, Hisilicon Limited. All rights reserved.
Copyright (c) 2015, Linaro Limited. All rights reserved.
@@ -512,7 +513,6 @@ AllocateType4AndSetProcessorInformationStrings (
PartNumber = STRING_TOKEN (STR_PROCESSOR_PART_NUMBER);
SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorManufacturer, ProcessorManu);
- SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorVersion, ProcessorVersion);
SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag);
if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorSerialNumber)) > 0) {
@@ -527,6 +527,12 @@ AllocateType4AndSetProcessorInformationStrings (
OemUpdateSmbiosInfo (mHiiHandle, PartNumber, ProcessorPartNumType04);
}
+ if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorVersion)) > 0) {
+ HiiSetString (mHiiHandle, ProcessorVersion, (CHAR16 *)FixedPcdGetPtr (PcdProcessorVersion), NULL);
+ } else {
+ OemUpdateSmbiosInfo (mHiiHandle, ProcessorVersion, ProcessorVersionType04);
+ }
+
// Processor Designation
StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;
ProcessorStr = AllocateZeroPool (StringBufferSize);
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call
2022-09-19 2:19 [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
2022-09-19 2:19 ` [PATCH v4 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Nhi Pham
@ 2022-09-19 2:19 ` Nhi Pham
2022-09-19 2:19 ` [PATCH v4 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID Nhi Pham
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Nhi Pham @ 2022-09-19 2:19 UTC (permalink / raw)
To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
Cc: patches, Minh Nguyen, Nhi Pham, Rebecca Cran, Ard Biesheuvel
From: Minh Nguyen <minhn@amperecomputing.com>
According to "SMC Calling Convention" specification, section 7.4,
return value of Arm Architecture Calls is stored at first argument of
SMC aguments (ARM_SMC_ARGS). This value can be negative values indicating
error or positive values (including zero) indicating success. Positive
value would contain information of respective Function ID (Section 7.3.4
and 7.4.4).
For that reason, "SMCCC_VERSION" and "SMCCC_ARCH_FEATURES"
Function ID calls read return value from "SmcCallStatus" variable
(Args.Arg0 - first argument of SMC call). But "SMCCC_ARCH_SOC_ID"
Function ID call is reading return value from "SmcParam" variable
(Args.Arg1 - second argument of SMC call) so it leads to unexpected
results of "Jep106Code" and "SocRevision". This patch is to correct it.
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
---
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
index e0010a40e489..b961be213358 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
@@ -2,7 +2,7 @@
Functions for processor information common to ARM and AARCH64.
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
- Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
+ Copyright (c) 2021 - 2022, Ampere Computing LLC. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -131,7 +131,7 @@ SmbiosGetSmcArm64SocId (
SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
if (SmcCallStatus >= 0) {
- *Jep106Code = (INT32)SmcParam;
+ *Jep106Code = SmcCallStatus;
} else {
Status = EFI_UNSUPPORTED;
}
@@ -140,7 +140,7 @@ SmbiosGetSmcArm64SocId (
SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
if (SmcCallStatus >= 0) {
- *SocRevision = (INT32)SmcParam;
+ *SocRevision = SmcCallStatus;
} else {
Status = EFI_UNSUPPORTED;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID
2022-09-19 2:19 [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
2022-09-19 2:19 ` [PATCH v4 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Nhi Pham
2022-09-19 2:19 ` [PATCH v4 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Nhi Pham
@ 2022-09-19 2:19 ` Nhi Pham
2022-09-19 2:19 ` [PATCH v4 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02" Nhi Pham
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Nhi Pham @ 2022-09-19 2:19 UTC (permalink / raw)
To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
Cc: patches, Nhi Pham, Rebecca Cran, Ard Biesheuvel
This adds an API to OemMiscLib for fetching the system UUID according to
the platform.
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
---
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf | 4 ++++
ArmPkg/Include/Library/OemMiscLib.h | 12 ++++++++++++
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 18 ++++++++++++++++++
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c | 3 ++-
4 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
index 5c4268f68b4a..8653f57720d1 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
@@ -1,6 +1,7 @@
#/** @file
# OemMiscLib.inf
#
+# Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
# Copyright (c) 2021, NUVIA Inc. All rights reserved.
# Copyright (c) 2018, Hisilicon Limited. All rights reserved.
# Copyright (c) 2018, Linaro Limited. All rights reserved.
@@ -29,3 +30,6 @@ [Packages]
[LibraryClasses]
BaseMemoryLib
DebugLib
+
+[Guids]
+ gZeroGuid
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 330bb4b014de..d87737db9c2b 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -235,4 +235,16 @@ OemGetChassisNumPowerCords (
VOID
);
+/**
+ Fetches the system UUID.
+
+ @param[out] SystemUuid The pointer to the buffer to store the System UUID.
+
+**/
+VOID
+EFIAPI
+OemGetSystemUuid (
+ OUT GUID *SystemUuid
+ );
+
#endif // OEM_MISC_LIB_H_
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 98970407a65e..32f6d55c1a9a 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -1,6 +1,7 @@
/** @file
* OemMiscLib.c
*
+* Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
* Copyright (c) 2021, NUVIA Inc. All rights reserved.
* Copyright (c) 2018, Hisilicon Limited. All rights reserved.
* Copyright (c) 2018, Linaro Limited. All rights reserved.
@@ -10,6 +11,7 @@
**/
#include <Uefi.h>
+#include <Guid/ZeroGuid.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/HiiLib.h>
@@ -236,3 +238,19 @@ OemGetChassisNumPowerCords (
ASSERT (FALSE);
return 1;
}
+
+/**
+ Fetches the system UUID.
+
+ @param[out] SystemUuid The pointer to the buffer to store the System UUID.
+
+**/
+VOID
+EFIAPI
+OemGetSystemUuid (
+ OUT GUID *SystemUuid
+ )
+{
+ ASSERT (FALSE);
+ CopyGuid (SystemUuid, &gZeroGuid);
+}
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
index 5cf72644d0b2..22fb5eccaa63 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
@@ -4,6 +4,7 @@
Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
+ Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
@@ -160,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);
- CopyGuid (&SmbiosRecord->Uuid, &InputData->Uuid);
+ OemGetSystemUuid (&SmbiosRecord->Uuid);
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1);
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02"
2022-09-19 2:19 [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
` (2 preceding siblings ...)
2022-09-19 2:19 ` [PATCH v4 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID Nhi Pham
@ 2022-09-19 2:19 ` Nhi Pham
2022-09-19 2:19 ` [PATCH v4 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2 Nhi Pham
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Nhi Pham @ 2022-09-19 2:19 UTC (permalink / raw)
To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
Cc: patches, Minh Nguyen, Nhi Pham, Rebecca Cran, Ard Biesheuvel
From: Minh Nguyen <minhn@amperecomputing.com>
This patch fixes typo from "AssertTagType02"
to "AssetTagType02".
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
---
ArmPkg/Include/Library/OemMiscLib.h | 2 +-
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index d87737db9c2b..1936619d9b5b 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -44,7 +44,7 @@ typedef enum {
VersionType01,
SkuNumberType01,
FamilyType01,
- AssertTagType02,
+ AssetTagType02,
SerialNumberType02,
BoardManufacturerType02,
ProductNameType02,
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
index 870610b17243..f61546955f12 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
@@ -4,6 +4,7 @@
Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
+ Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
@@ -112,7 +113,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
OemUpdateSmbiosInfo (
mSmbiosMiscHiiHandle,
STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG),
- AssertTagType02
+ AssetTagType02
);
OemUpdateSmbiosInfo (
mSmbiosMiscHiiHandle,
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2
2022-09-19 2:19 [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
` (3 preceding siblings ...)
2022-09-19 2:19 ` [PATCH v4 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02" Nhi Pham
@ 2022-09-19 2:19 ` Nhi Pham
2022-09-19 2:19 ` [PATCH v4 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib Nhi Pham
2022-09-23 14:46 ` [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Sami Mujawar
6 siblings, 0 replies; 8+ messages in thread
From: Nhi Pham @ 2022-09-19 2:19 UTC (permalink / raw)
To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
Cc: patches, Minh Nguyen, Nhi Pham, Rebecca Cran, Ard Biesheuvel
From: Minh Nguyen <minhn@amperecomputing.com>
This patch removes redundant updates of "BoardManufacturerType02"
and "SerialNumberType02".
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
---
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
index f61546955f12..3441e7798860 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
@@ -120,16 +120,6 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER),
SerialNumberType02
);
- OemUpdateSmbiosInfo (
- mSmbiosMiscHiiHandle,
- STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER),
- BoardManufacturerType02
- );
- OemUpdateSmbiosInfo (
- mSmbiosMiscHiiHandle,
- STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER),
- SerialNumberType02
- );
OemUpdateSmbiosInfo (
mSmbiosMiscHiiHandle,
STRING_TOKEN (STR_MISC_BASE_BOARD_SKU_NUMBER),
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib
2022-09-19 2:19 [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
` (4 preceding siblings ...)
2022-09-19 2:19 ` [PATCH v4 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2 Nhi Pham
@ 2022-09-19 2:19 ` Nhi Pham
2022-09-23 14:46 ` [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Sami Mujawar
6 siblings, 0 replies; 8+ messages in thread
From: Nhi Pham @ 2022-09-19 2:19 UTC (permalink / raw)
To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
Cc: patches, Minh Nguyen, Nhi Pham, Rebecca Cran, Ard Biesheuvel
From: Minh Nguyen <minhn@amperecomputing.com>
In some scenarios, the information of Bios Version, Bios Release
and Embedded Controller Firmware Release are fetched during UEFI
booting. This patch supports updating those fields dynamically
when the PCDs are empty.
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
---
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf | 5 ++++
ArmPkg/Include/Library/OemMiscLib.h | 21 ++++++++++++++
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 29 ++++++++++++++++++++
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 22 +++++++--------
4 files changed, 66 insertions(+), 11 deletions(-)
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
index 8653f57720d1..7286ed61142a 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
@@ -30,6 +30,11 @@ [Packages]
[LibraryClasses]
BaseMemoryLib
DebugLib
+ PcdLib
[Guids]
gZeroGuid
+
+[Pcd]
+ gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease
+ gArmTokenSpaceGuid.PcdSystemBiosRelease
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 1936619d9b5b..541274999e5c 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -37,6 +37,7 @@ typedef struct {
} OEM_MISC_PROCESSOR_DATA;
typedef enum {
+ BiosVersionType00,
ProductNameType01,
SerialNumType01,
UuidType01,
@@ -247,4 +248,24 @@ OemGetSystemUuid (
OUT GUID *SystemUuid
);
+/** Fetches the BIOS release.
+
+ @return The BIOS release.
+**/
+UINT16
+EFIAPI
+OemGetBiosRelease (
+ VOID
+ );
+
+/** Fetches the embedded controller firmware release.
+
+ @return The embedded controller firmware release.
+**/
+UINT16
+EFIAPI
+OemGetEmbeddedControllerFirmwareRelease (
+ VOID
+ );
+
#endif // OEM_MISC_LIB_H_
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 32f6d55c1a9a..a5d635da9e11 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -16,6 +16,7 @@
#include <Library/DebugLib.h>
#include <Library/HiiLib.h>
#include <Library/OemMiscLib.h>
+#include <Library/PcdLib.h>
/** Gets the CPU frequency of the specified processor.
@@ -254,3 +255,31 @@ OemGetSystemUuid (
ASSERT (FALSE);
CopyGuid (SystemUuid, &gZeroGuid);
}
+
+/** Fetches the BIOS release.
+
+ @return The BIOS release.
+**/
+UINT16
+EFIAPI
+OemGetBiosRelease (
+ VOID
+ )
+{
+ ASSERT (FALSE);
+ return PcdGet16 (PcdSystemBiosRelease);
+}
+
+/** Fetches the embedded controller firmware release.
+
+ @return The embedded controller firmware release.
+**/
+UINT16
+EFIAPI
+OemGetEmbeddedControllerFirmwareRelease (
+ VOID
+ )
+{
+ ASSERT (FALSE);
+ return PcdGet16 (PcdEmbeddedControllerFirmwareRelease);
+}
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
index b49c4b754cab..e1310f331009 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
@@ -1,5 +1,6 @@
/** @file
+ Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
@@ -13,6 +14,7 @@
#include <Library/DebugLib.h>
#include <Library/HiiLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/OemMiscLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
@@ -191,11 +193,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
} else {
- Version = (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString);
- if (StrLen (Version) > 0) {
- TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
- HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
- }
+ OemUpdateSmbiosInfo (
+ mSmbiosMiscHiiHandle,
+ STRING_TOKEN (STR_MISC_BIOS_VERSION),
+ BiosVersionType00
+ );
}
Char16String = GetBiosReleaseDate ();
@@ -251,13 +253,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
}
}
- SmbiosRecord->SystemBiosMajorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) >> 8);
- SmbiosRecord->SystemBiosMinorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) & 0xFF);
+ SmbiosRecord->SystemBiosMajorRelease = (UINT8)(OemGetBiosRelease () >> 8);
+ SmbiosRecord->SystemBiosMinorRelease = (UINT8)(OemGetBiosRelease () & 0xFF);
- SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)
- (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8);
- SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)
- (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF);
+ SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)(OemGetEmbeddedControllerFirmwareRelease () >> 8);
+ SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)(OemGetEmbeddedControllerFirmwareRelease () & 0xFF);
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1);
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements
2022-09-19 2:19 [PATCH v4 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
` (5 preceding siblings ...)
2022-09-19 2:19 ` [PATCH v4 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib Nhi Pham
@ 2022-09-23 14:46 ` Sami Mujawar
6 siblings, 0 replies; 8+ messages in thread
From: Sami Mujawar @ 2022-09-23 14:46 UTC (permalink / raw)
To: Nhi Pham, devel, quic_llindhol, ardb+tianocore, quic_rcran
Cc: patches, nd@arm.com
Merged as a8e8c43a0ef2..953438e4665c
Thanks.
Regards,
Sami Mujawar
On 19/09/2022 03:19 am, Nhi Pham wrote:
> This patchset is to update the ArmPkg/SMBIOS for fixes and improvements.
>
> Changes since v3:
> + Update for OemGetBiosRelease and
> OemGetEmbeddedControllerFirmwareRelease functions [Leif, Sami]
>
> Changes since v2:
> + Add tags from Ard and Sami
> + Fix patch 3 for compilation error with OemMiscLibNull due to lack
> of gZeroGuid in the INF file.
>
> Changes since v1:
> + Change PartNumber to ProcessorVersion [Sami]
>
> Minh Nguyen (5):
> ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib
> ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call
> ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02"
> ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2
> ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib
>
> Nhi Pham (1):
> ArmPkg/SmbiosMiscDxe: Support fetching System UUID
>
> ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf | 9 ++++
> ArmPkg/Include/Library/OemMiscLib.h | 37 ++++++++++++++-
> ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 47 ++++++++++++++++++++
> ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 8 +++-
> ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 6 +--
> ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 22 ++++-----
> ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c | 3 +-
> ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 13 +-----
> 8 files changed, 117 insertions(+), 28 deletions(-)
>
^ permalink raw reply [flat|nested] 8+ messages in thread