summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorNhi Pham <nhi@os.amperecomputing.com>2021-12-16 10:54:55 +0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-16 18:08:22 +0000
commitb451c6908878c448c2a2aa6e9ca2a2dfe078fbb8 (patch)
tree2bac6c84d4c783f09283cf4bb95b1d5800304526 /ArmPkg
parent45e38429700af53617d04dfa05ee57adcecef3de (diff)
downloadedk2-b451c6908878c448c2a2aa6e9ca2a2dfe078fbb8.tar.gz
edk2-b451c6908878c448c2a2aa6e9ca2a2dfe078fbb8.tar.bz2
edk2-b451c6908878c448c2a2aa6e9ca2a2dfe078fbb8.zip
ArmPkg/ProcessorSubClassDxe: Get serial and part number from OemMiscLib
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. Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Include/Library/OemMiscLib.h2
-rw-r--r--ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c14
2 files changed, 14 insertions, 2 deletions
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index f25c8f3342..47cb30d84a 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 a4f98e6a81..0b9af9bd7e 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;