mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
ArmPkg: Add SMBIOS Type 4 SocketType handling
The SMBIOS Type 4 field SocketType was added in commit
7f505d377b in 2024. This
caused the table size to be invalid when platforms specify
versions of SMBIOS before 3.8.
Update ProcessorSubClassDxe to handle fetching the string for the
socket type including calling into OemMiscLib to retrieve it.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
This commit is contained in:
parent
3fa842faf9
commit
08dd5e921c
5 changed files with 31 additions and 2 deletions
|
|
@ -166,6 +166,7 @@
|
|||
gArmTokenSpaceGuid.PcdProcessorSerialNumber|L""|VOID*|0x30000073
|
||||
gArmTokenSpaceGuid.PcdProcessorAssetTag|L""|VOID*|0x30000074
|
||||
gArmTokenSpaceGuid.PcdProcessorPartNumber|L""|VOID*|0x30000075
|
||||
gArmTokenSpaceGuid.PcdProcessorSocketType|L""|VOID*|0x30000076
|
||||
|
||||
#
|
||||
# ARM L2x0 PCDs
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ typedef enum {
|
|||
ProcessorPartNumType04,
|
||||
ProcessorSerialNumType04,
|
||||
ProcessorVersionType04,
|
||||
ProcessorSocketTypeType04,
|
||||
SmbiosHiiStringFieldMax
|
||||
} OEM_MISC_SMBIOS_HII_STRING_FIELD;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,9 @@ SMBIOS_TABLE_TYPE4 mSmbiosProcessorTableTemplate = {
|
|||
ProcessorFamilyARM, // ProcessorFamily2
|
||||
0, // CoreCount2
|
||||
0, // EnabledCoreCount2
|
||||
0 // ThreadCount2
|
||||
0, // ThreadCount2
|
||||
0, // ThreadEnabled
|
||||
7 // SocketType
|
||||
};
|
||||
|
||||
/** Sets the HII variable `StringId` is `Pcd` isn't empty.
|
||||
|
|
@ -495,12 +497,14 @@ AllocateType4AndSetProcessorInformationStrings (
|
|||
EFI_STRING_ID SerialNumber;
|
||||
EFI_STRING_ID AssetTag;
|
||||
EFI_STRING_ID PartNumber;
|
||||
EFI_STRING_ID SocketType;
|
||||
EFI_STRING ProcessorStr;
|
||||
EFI_STRING ProcessorManuStr;
|
||||
EFI_STRING ProcessorVersionStr;
|
||||
EFI_STRING SerialNumberStr;
|
||||
EFI_STRING AssetTagStr;
|
||||
EFI_STRING PartNumberStr;
|
||||
EFI_STRING SocketTypeStr;
|
||||
CHAR8 *OptionalStrStart;
|
||||
CHAR8 *StrStart;
|
||||
UINTN ProcessorStrLen;
|
||||
|
|
@ -509,6 +513,7 @@ AllocateType4AndSetProcessorInformationStrings (
|
|||
UINTN SerialNumberStrLen;
|
||||
UINTN AssetTagStrLen;
|
||||
UINTN PartNumberStrLen;
|
||||
UINTN SocketTypeStrLen;
|
||||
UINTN TotalSize;
|
||||
UINTN StringBufferSize;
|
||||
|
||||
|
|
@ -519,12 +524,14 @@ AllocateType4AndSetProcessorInformationStrings (
|
|||
SerialNumberStr = NULL;
|
||||
AssetTagStr = NULL;
|
||||
PartNumberStr = NULL;
|
||||
SocketTypeStr = NULL;
|
||||
|
||||
ProcessorManu = STRING_TOKEN (STR_PROCESSOR_MANUFACTURE);
|
||||
ProcessorVersion = STRING_TOKEN (STR_PROCESSOR_VERSION);
|
||||
SerialNumber = STRING_TOKEN (STR_PROCESSOR_SERIAL_NUMBER);
|
||||
AssetTag = STRING_TOKEN (STR_PROCESSOR_ASSET_TAG);
|
||||
PartNumber = STRING_TOKEN (STR_PROCESSOR_PART_NUMBER);
|
||||
SocketType = STRING_TOKEN (STR_PROCESSOR_SOCKET_TYPE);
|
||||
|
||||
SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorManufacturer, ProcessorManu);
|
||||
SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag);
|
||||
|
|
@ -547,6 +554,12 @@ AllocateType4AndSetProcessorInformationStrings (
|
|||
OemUpdateSmbiosInfo (mHiiHandle, ProcessorVersion, ProcessorVersionType04);
|
||||
}
|
||||
|
||||
if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorSocketType)) > 0) {
|
||||
HiiSetString (mHiiHandle, SocketType, (CHAR16 *)FixedPcdGetPtr (PcdProcessorSocketType), NULL);
|
||||
} else {
|
||||
OemUpdateSmbiosInfo (mHiiHandle, SocketType, ProcessorSocketTypeType04);
|
||||
}
|
||||
|
||||
// Processor Designation
|
||||
StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;
|
||||
ProcessorStr = AllocateZeroPool (StringBufferSize);
|
||||
|
|
@ -581,13 +594,17 @@ AllocateType4AndSetProcessorInformationStrings (
|
|||
PartNumberStr = HiiGetPackageString (&gEfiCallerIdGuid, PartNumber, NULL);
|
||||
PartNumberStrLen = StrLen (PartNumberStr);
|
||||
|
||||
SocketTypeStr = HiiGetPackageString (&gEfiCallerIdGuid, SocketType, NULL);
|
||||
SocketTypeStrLen = StrLen (SocketTypeStr);
|
||||
|
||||
TotalSize = sizeof (SMBIOS_TABLE_TYPE4) +
|
||||
ProcessorStrLen + 1 +
|
||||
ProcessorManuStrLen + 1 +
|
||||
ProcessorVersionStrLen + 1 +
|
||||
SerialNumberStrLen + 1 +
|
||||
AssetTagStrLen + 1 +
|
||||
PartNumberStrLen + 1 + 1;
|
||||
PartNumberStrLen + 1 +
|
||||
SocketTypeStrLen + 1 + 1;
|
||||
|
||||
*Type4Record = AllocateZeroPool (TotalSize);
|
||||
if (*Type4Record == NULL) {
|
||||
|
|
@ -639,6 +656,13 @@ AllocateType4AndSetProcessorInformationStrings (
|
|||
PartNumberStrLen + 1
|
||||
);
|
||||
|
||||
StrStart += PartNumberStrLen + 1;
|
||||
UnicodeStrToAsciiStrS (
|
||||
SocketTypeStr,
|
||||
StrStart,
|
||||
SocketTypeStrLen + 1
|
||||
);
|
||||
|
||||
Exit:
|
||||
FreePool (ProcessorStr);
|
||||
FreePool (ProcessorManuStr);
|
||||
|
|
@ -646,6 +670,7 @@ Exit:
|
|||
FreePool (SerialNumberStr);
|
||||
FreePool (AssetTagStr);
|
||||
FreePool (PartNumberStr);
|
||||
FreePool (SocketTypeStr);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
gArmTokenSpaceGuid.PcdProcessorSerialNumber
|
||||
gArmTokenSpaceGuid.PcdProcessorAssetTag
|
||||
gArmTokenSpaceGuid.PcdProcessorPartNumber
|
||||
gArmTokenSpaceGuid.PcdProcessorSocketType
|
||||
|
||||
[Guids]
|
||||
|
||||
|
|
|
|||
|
|
@ -21,4 +21,5 @@
|
|||
#string STR_PROCESSOR_SERIAL_NUMBER #language en-US "Not Specified"
|
||||
#string STR_PROCESSOR_ASSET_TAG #language en-US "Not Specified"
|
||||
#string STR_PROCESSOR_PART_NUMBER #language en-US "Not Specified"
|
||||
#string STR_PROCESSOR_SOCKET_TYPE #language en-US "Not Specified"
|
||||
#string STR_PROCESSOR_UNKNOWN #language en-US "Unknown"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue