* [PATCH v2 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
2021-12-16 3:54 [PATCH v2 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
@ 2021-12-16 3:54 ` Nhi Pham
2021-12-16 3:54 ` [PATCH v2 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib Nhi Pham
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Nhi Pham @ 2021-12-16 3:54 UTC (permalink / raw)
To: devel
Cc: patches, Nhi Pham, Leif Lindholm, Ard Biesheuvel, Rebecca Cran,
Sami Mujawar
This patch removes duplicate HII string definition in the
MiscSystemManufacturer.uni.
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni | 1 -
1 file changed, 1 deletion(-)
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
index 8038f0e4b0bf..2b3b19cab2ea 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
@@ -13,7 +13,6 @@
#string STR_MISC_SYSTEM_MANUFACTURER #language en-US "Not Specified"
#string STR_MISC_SYSTEM_PRODUCT_NAME #language en-US "Not Specified"
-#string STR_MISC_SYSTEM_PRODUCT_NAME #language en-US "Not Specified"
#string STR_MISC_SYSTEM_VERSION #language en-US "Not Specified"
#string STR_MISC_SYSTEM_SERIAL_NUMBER #language en-US "Not Specified"
#string STR_MISC_SYSTEM_SKU_NUMBER #language en-US "Not Specified"
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
2021-12-16 3:54 [PATCH v2 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
2021-12-16 3:54 ` [PATCH v2 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition Nhi Pham
@ 2021-12-16 3:54 ` Nhi Pham
2021-12-16 3:54 ` [PATCH v2 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number " Nhi Pham
2021-12-16 18:56 ` [PATCH v2 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Ard Biesheuvel
3 siblings, 0 replies; 5+ messages in thread
From: Nhi Pham @ 2021-12-16 3:54 UTC (permalink / raw)
To: devel
Cc: patches, Nhi Pham, Leif Lindholm, Ard Biesheuvel, Rebecca Cran,
Sami Mujawar
Typically, the information of the SMBIOS type 1/2/3 is fetched from an
FRU device during UEFI booting intead of fixed PCDs. Therefore, this
patch is to add more HII string fields in the OemMiscLib and support
updating these SMBIOS types with the strings provided by the OemMiscLib
if the PCDs are empty.
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
ArmPkg/Include/Library/OemMiscLib.h | 3 +++
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c | 12 ++++++++++++
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 18 ++++++++++++++++++
3 files changed, 33 insertions(+)
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 569cd5135276..f25c8f3342a9 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -40,11 +40,14 @@ typedef enum {
SerialNumType01,
UuidType01,
SystemManufacturerType01,
+ VersionType01,
SkuNumberType01,
FamilyType01,
AssertTagType02,
SerialNumberType02,
BoardManufacturerType02,
+ ProductNameType02,
+ VersionType02,
SkuNumberType02,
ChassisLocationType02,
AssetTagType03,
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
index 6d08a75580e7..5cf72644d0b2 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
@@ -74,12 +74,24 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
if (StrLen (Product) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Product, NULL);
+ } else {
+ OemUpdateSmbiosInfo (
+ mSmbiosMiscHiiHandle,
+ STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME),
+ ProductNameType01
+ );
}
pVersion = (CHAR16 *)PcdGetPtr (PcdSystemVersion);
if (StrLen (pVersion) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, pVersion, NULL);
+ } else {
+ OemUpdateSmbiosInfo (
+ mSmbiosMiscHiiHandle,
+ STRING_TOKEN (STR_MISC_SYSTEM_VERSION),
+ VersionType01
+ );
}
OemUpdateSmbiosInfo (
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
index 99ba99e913b6..870610b17243 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
@@ -77,18 +77,36 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
if (StrLen (BaseBoardManufacturer) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardManufacturer, NULL);
+ } else {
+ OemUpdateSmbiosInfo (
+ mSmbiosMiscHiiHandle,
+ STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER),
+ BoardManufacturerType02
+ );
}
BaseBoardProductName = (CHAR16 *)PcdGetPtr (PcdBaseBoardProductName);
if (StrLen (BaseBoardProductName) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardProductName, NULL);
+ } else {
+ OemUpdateSmbiosInfo (
+ mSmbiosMiscHiiHandle,
+ STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME),
+ ProductNameType02
+ );
}
Version = (CHAR16 *)PcdGetPtr (PcdBaseBoardVersion);
if (StrLen (Version) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
+ } else {
+ OemUpdateSmbiosInfo (
+ mSmbiosMiscHiiHandle,
+ STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION),
+ VersionType02
+ );
}
OemUpdateSmbiosInfo (
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number from OemMiscLib
2021-12-16 3:54 [PATCH v2 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
2021-12-16 3:54 ` [PATCH v2 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition Nhi Pham
2021-12-16 3:54 ` [PATCH v2 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib Nhi Pham
@ 2021-12-16 3:54 ` Nhi Pham
2021-12-16 18:56 ` [PATCH v2 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Ard Biesheuvel
3 siblings, 0 replies; 5+ messages in thread
From: Nhi Pham @ 2021-12-16 3:54 UTC (permalink / raw)
To: devel
Cc: patches, Nhi Pham, Leif Lindholm, Ard Biesheuvel, Rebecca Cran,
Sami Mujawar
Currently, the serial and part number of a processor are filled with
fixed PCDs. However, they may be updated dynamically according to the
information being passed from a the pre-UEFI firmware during booting.
So, this patch is to support updating these string fields from
OemMiscLib if the PCDs are empty.
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
ArmPkg/Include/Library/OemMiscLib.h | 2 ++
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 14 ++++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index f25c8f3342a9..47cb30d84a62 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -56,6 +56,8 @@ typedef enum {
ChassisTypeType03,
ManufacturerType03,
SkuNumberType03,
+ ProcessorPartNumType04,
+ ProcessorSerialNumType04,
SmbiosHiiStringFieldMax
} OEM_MISC_SMBIOS_HII_STRING_FIELD;
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index a4f98e6a81d2..0b9af9bd7e1c 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -513,9 +513,19 @@ AllocateType4AndSetProcessorInformationStrings (
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 (PcdProcessorSerialNumber, SerialNumber);
SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag);
- SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorPartNumber, PartNumber);
+
+ if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorSerialNumber)) > 0) {
+ HiiSetString (mHiiHandle, SerialNumber, (CHAR16 *)FixedPcdGetPtr (PcdProcessorSerialNumber), NULL);
+ } else {
+ OemUpdateSmbiosInfo (mHiiHandle, SerialNumber, ProcessorSerialNumType04);
+ }
+
+ if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorPartNumber)) > 0) {
+ HiiSetString (mHiiHandle, PartNumber, (CHAR16 *)FixedPcdGetPtr (PcdProcessorPartNumber), NULL);
+ } else {
+ OemUpdateSmbiosInfo (mHiiHandle, PartNumber, ProcessorPartNumType04);
+ }
// Processor Designation
StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS
2021-12-16 3:54 [PATCH v2 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
` (2 preceding siblings ...)
2021-12-16 3:54 ` [PATCH v2 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number " Nhi Pham
@ 2021-12-16 18:56 ` Ard Biesheuvel
3 siblings, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2021-12-16 18:56 UTC (permalink / raw)
To: Nhi Pham
Cc: edk2-devel-groups-io, patches, Leif Lindholm, Ard Biesheuvel,
Rebecca Cran, Sami Mujawar
On Thu, 16 Dec 2021 at 04:57, Nhi Pham <nhi@os.amperecomputing.com> wrote:
>
> This patchset leverages the OemUpdateSmbiosInfo API functions from
> OemMiscLib for updating some HII string fields in the SMBIOS Type 1/2/4
> because they may be updated dynamically during UEFI booting with the
> data being passed from the pre-UEFI firmware.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
>
> Changes from v1:
> * Change to use FixedPcdGetPtr() instead of PcdGetPtr(). [SAMI]
> * Fix coding style issue after running uncrustify. [SAMI]
>
> Nhi Pham (3):
> ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
> ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
> ArmPkg/ProcessorSubClassDxe: Get serial and part number from
> OemMiscLib
>
Merged as #2318
Thanks all,
^ permalink raw reply [flat|nested] 5+ messages in thread