ArmPkg: Smbios: Update ProcessorSubClassDxe for new SMBIOS structures

Update ProcessorSubClassDxe to handle the new cache size and AArch64
PROCESSOR_ID_DATA SMBIOS structures.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
This commit is contained in:
Sarah Walker
2025-07-22 09:52:53 +01:00
committed by mergify[bot]
parent 34e3bd44ff
commit ba079eda61

View File

@ -68,12 +68,19 @@ SMBIOS_TABLE_TYPE4 mSmbiosProcessorTableTemplate = {
ProcessorFamilyIndicatorFamily2, // ProcessorFamily
2, // ProcessorManufacture
{ // ProcessorId
#ifdef MDE_CPU_AARCH64
0, // SocId
0, // SipId
0, // SipBankIndex
0 // SocRevision
#else
{ // Signature
0
},
{ // FeatureFlags
0
}
#endif
},
3, // ProcessorVersion
{ // Voltage
@ -192,10 +199,10 @@ ConfigureCacheArchitectureInformation (
OUT SMBIOS_TABLE_TYPE7 *Type7Record
)
{
UINT8 Associativity;
UINT32 CacheSize32;
UINT16 CacheSize16;
UINT64 CacheSize64;
UINT8 Associativity;
SMBIOS_CACHE_SIZE_2 CacheSize32;
SMBIOS_CACHE_SIZE CacheSize16;
UINT64 CacheSize64;
if (!DataCache && !UnifiedCache) {
Type7Record->SystemCacheType = CacheTypeInstruction;
@ -223,19 +230,26 @@ ConfigureCacheArchitectureInformation (
// Encode the cache size into the format SMBIOS wants
if (CacheSize64 < MAX_INT16) {
CacheSize16 = CacheSize64;
CacheSize32 = CacheSize16;
CacheSize16.Size = CacheSize64;
CacheSize16.Granularity64K = 0;
CacheSize32.Size = CacheSize64;
CacheSize32.Granularity64K = 0;
} else if ((CacheSize64 / 64) < MAX_INT16) {
CacheSize16 = (1 << 15) | (CacheSize64 / 64);
CacheSize32 = (1 << 31) | (CacheSize64 / 64);
CacheSize16.Size = CacheSize64 / 64;
CacheSize16.Granularity64K = 1;
CacheSize32.Size = CacheSize64 / 64;
CacheSize32.Granularity64K = 1;
} else {
if ((CacheSize64 / 1024) <= 2047) {
CacheSize32 = CacheSize64;
CacheSize32.Size = CacheSize64;
CacheSize32.Granularity64K = 0;
} else {
CacheSize32 = (1 << 31) | (CacheSize64 / 64);
CacheSize32.Size = CacheSize64 / 64;
CacheSize32.Granularity64K = 1;
}
CacheSize16 = -1;
CacheSize16.Size = 0x7fff;
CacheSize16.Granularity64K = 1;
}
Type7Record->MaximumCacheSize = CacheSize16;