diff options
author | Nhi Pham <nhi@os.amperecomputing.com> | 2021-12-16 10:54:54 +0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-16 18:08:22 +0000 |
commit | 45e38429700af53617d04dfa05ee57adcecef3de (patch) | |
tree | 3e5d4f26dd8b7945dd1966017cf6679f9ea3333a /ArmPkg/Universal/Smbios/SmbiosMiscDxe | |
parent | a6c04186513e720a8ab1b3d9bcbc6583f7f895a1 (diff) | |
download | edk2-45e38429700af53617d04dfa05ee57adcecef3de.zip edk2-45e38429700af53617d04dfa05ee57adcecef3de.tar.gz edk2-45e38429700af53617d04dfa05ee57adcecef3de.tar.bz2 |
ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
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.
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'ArmPkg/Universal/Smbios/SmbiosMiscDxe')
-rw-r--r-- | ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c | 12 | ||||
-rw-r--r-- | ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c index 6d08a75..5cf7264 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 99ba99e..870610b 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 (
|