-
Notifications
You must be signed in to change notification settings - Fork 152
Add generators for SMBIOS type 4 and 7 tables (CPU and cache topologies) #517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
samimujawar
merged 8 commits into
tianocore:dynamictables-reorg
from
sarah-walker-arm:dynamictables-reorg-3735_SMBIOS_Type4_7
Jul 22, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
29f711a
MdePkg: Smbios: Add AArch64 ProcessorId variant for type 4 table
sarah-walker-arm 98f8bfa
DynamicTablesPkg: Implement abstract CM_OBJECT_TOKENs
sarah-walker-arm 893fb28
MdePkg: SmBios: Add structs for cache size and configuration data
sarah-walker-arm e4ed7e8
DynamicTablesPkg: Smbios Cache Information (Type 7)
sarah-walker-arm bc92fcf
DynamicTablesPkg: Smbios Processor Information (Type 4)
sarah-walker-arm 789cbfa
DynamicTablesPkg: DynamicTableManagerDxe: Fix NULL pointer dereference
sarah-walker-arm 3ab9870
DynamicTablesPkg: Add SmbiosSmcLib
sarah-walker-arm 3a39bb7
ArmPkg: Smbios: Update ProcessorSubClassDxe for new SMBIOS structures
sarah-walker-arm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** @file | ||
* | ||
* Copyright (c) 2025, ARM Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause-Patent | ||
* | ||
**/ | ||
|
||
#ifndef SMBIOS_SMC_LIB_H_ | ||
#define SMBIOS_SMC_LIB_H_ | ||
|
||
/** Returns the SOC ID, formatted for the SMBIOS Type 4 Processor ID field. | ||
|
||
@param Processor ID. | ||
|
||
@return 0 on success | ||
@return EFI_UNSUPPORTED if SMCCC_ARCH_SOC_ID is not implemented | ||
**/ | ||
UINT64 | ||
SmbiosSmcGetSocId ( | ||
UINT64 *ProcessorId | ||
); | ||
|
||
#endif // SMBIOS_SMC_LIB_H_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
DynamicTablesPkg/Library/Smbios/Arm/SmbiosSmcLib/SmbiosSmcLib.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/** @file | ||
SMBIOS SMC helper functions. | ||
|
||
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR> | ||
Copyright (c) 2021 - 2022, Ampere Computing LLC. All rights reserved.<BR> | ||
Copyright (c) 2025, ARM Ltd. All rights reserved.<BR> | ||
|
||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
**/ | ||
|
||
#include <Uefi.h> | ||
#include <IndustryStandard/ArmStdSmc.h> | ||
#include <Library/ArmSmcLib.h> | ||
#include <Library/SmbiosSmcLib.h> | ||
|
||
/** Checks if the ARM64 SoC ID SMC call is supported | ||
|
||
@return Whether the ARM64 SoC ID call is supported. | ||
**/ | ||
STATIC | ||
BOOLEAN | ||
HasSmcArm64SocId ( | ||
VOID | ||
) | ||
{ | ||
INT32 SmcCallStatus; | ||
BOOLEAN Arm64SocIdSupported; | ||
UINTN SmcParam; | ||
|
||
Arm64SocIdSupported = FALSE; | ||
|
||
SmcCallStatus = ArmCallSmc0 (SMCCC_VERSION, NULL, NULL, NULL); | ||
|
||
if ((SmcCallStatus < 0) || ((SmcCallStatus >> 16) >= 1)) { | ||
SmcParam = SMCCC_ARCH_SOC_ID; | ||
SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_FEATURES, &SmcParam, NULL, NULL); | ||
if (SmcCallStatus >= 0) { | ||
Arm64SocIdSupported = TRUE; | ||
} | ||
} | ||
|
||
return Arm64SocIdSupported; | ||
} | ||
|
||
/** Fetches the JEP106 code and SoC Revision. | ||
|
||
@param Jep106Code JEP 106 code. | ||
@param SocRevision SoC revision. | ||
|
||
@retval EFI_SUCCESS Succeeded. | ||
@retval EFI_UNSUPPORTED Failed. | ||
**/ | ||
STATIC | ||
EFI_STATUS | ||
SmbiosGetSmcArm64SocId ( | ||
OUT UINT32 *Jep106Code, | ||
OUT UINT32 *SocRevision | ||
) | ||
{ | ||
INT32 SmcCallStatus; | ||
EFI_STATUS Status; | ||
UINTN SmcParam; | ||
|
||
Status = EFI_SUCCESS; | ||
|
||
SmcParam = 0; | ||
SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL); | ||
|
||
if (SmcCallStatus >= 0) { | ||
*Jep106Code = (UINT32)SmcCallStatus; | ||
} else { | ||
Status = EFI_UNSUPPORTED; | ||
} | ||
|
||
SmcParam = 1; | ||
SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL); | ||
|
||
if (SmcCallStatus >= 0) { | ||
*SocRevision = (UINT32)SmcCallStatus; | ||
} else { | ||
Status = EFI_UNSUPPORTED; | ||
} | ||
|
||
return Status; | ||
} | ||
|
||
/** Returns the SOC ID, formatted for the SMBIOS Type 4 Processor ID field. | ||
|
||
@param Processor ID. | ||
|
||
@return 0 on success | ||
@return EFI_UNSUPPORTED if SMCCC_ARCH_SOC_ID is not implemented | ||
**/ | ||
UINT64 | ||
SmbiosSmcGetSocId ( | ||
UINT64 *ProcessorId | ||
) | ||
{ | ||
EFI_STATUS Status; | ||
UINT32 Jep106Code; | ||
UINT32 SocRevision; | ||
|
||
if (HasSmcArm64SocId ()) { | ||
Status = SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision); | ||
if (!EFI_ERROR (Status)) { | ||
*ProcessorId = ((UINT64)SocRevision << 32) | Jep106Code; | ||
} | ||
} else { | ||
Status = EFI_UNSUPPORTED; | ||
} | ||
|
||
return Status; | ||
} |
26 changes: 26 additions & 0 deletions
26
DynamicTablesPkg/Library/Smbios/Arm/SmbiosSmcLib/SmbiosSmcLib.inf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#/** @file | ||
# | ||
# Copyright (c) 2025, ARM Ltd. All rights reserved.<BR> | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
#**/ | ||
|
||
[Defines] | ||
INF_VERSION = 1.30 | ||
BASE_NAME = SmbiosSmcLib | ||
FILE_GUID = 201d7312-46c8-42f4-a1cf-38897ddfe916 | ||
MODULE_TYPE = BASE | ||
VERSION_STRING = 1.0 | ||
LIBRARY_CLASS = SmbiosSmcLib | ||
|
||
[Sources] | ||
SmbiosSmcLib.c | ||
|
||
[Packages] | ||
DynamicTablesPkg/DynamicTablesPkg.dec | ||
MdePkg/MdePkg.dec | ||
|
||
[LibraryClasses] | ||
ArmSmcLib | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.