Hi Nhi,
Other than the code style issue (which I believe uncrustify will
complain about), this patch looks good to me.
With that fixed.
Reviewed-by: Sami Mujawar <sami.muja...@arm.com>
Regards,
Sami Mujawar
On 01/12/2021 04:10 AM, Nhi Pham via groups.io wrote:
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 <l...@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Rebecca Cran <rebe...@nuviainc.com>
Signed-off-by: Nhi Pham <n...@os.amperecomputing.com>
---
ArmPkg/Include/Library/OemMiscLib.h
| 3 +++
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
| 10 ++++++++++
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
| 15 +++++++++++++++
3 files changed, 28 insertions(+)
diff --git a/ArmPkg/Include/Library/OemMiscLib.h
b/ArmPkg/Include/Library/OemMiscLib.h
index 0b03fe8d4de3..aa68c0a92632 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -44,11 +44,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 2c69c2593f5d..2c73d63444fe 100644
---
a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
+++
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
@@ -75,12 +75,22 @@ 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
+ );
[SAMI] I think uncrustify would fail here, similar issue at other places.
}
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 (mSmbiosMiscHiiHandle,
diff --git
a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
index 097777a23904..7f397d8d2aaa 100644
---
a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
+++
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
@@ -79,18 +79,33 @@ 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 (mSmbiosMiscHiiHandle,
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#84917): https://edk2.groups.io/g/devel/message/84917
Mute This Topic: https://groups.io/mt/87420727/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-