Skip to content
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

Dynamictables: Add SMBIOS dispatcher and generators #510

Open
wants to merge 12 commits into
base: dynamictables-reorg
Choose a base branch
from

Conversation

gmahadevan
Copy link

Initial set of changes to add support for SMBIOS table generation that has the mods to the DynamicTablesPkg framework to install SMBIOS tables and 3 SMBIOS table generators for Type 16/17/19

DynamicTablesPkg: Smbios Memory Array Mapped Address (Type 19)
DynamicTablesPkg: Smbios Physical Memory Array (Type 16)
DynamicTablesPkg: Smbios Memory Device (Type 17)
DynamicTablesPkg: Introduce new namespace for SMBIOS Objects
DynamicTablesPkg: Split the ACPI and SMBIOS table generators
DynamicTablesPkg: Add SMBIOS table generation
DynamicTablesPkg: Add Ordered dispatch support for SMBIOS tables
DynamicTablesPkg: Update SMBIOS dispatcher dependency table
DynamicTablesPkg: Add extern call to build SMBIOS table
DynamicTablesPkg: Add SMBIOS table dispatcher
DynamicTablesPkg: Define a SMBIOS Structure/Table type
DynamicTablesPkg: SmbiosStringLib: Add new helper macro

gmahadevan and others added 12 commits January 10, 2025 14:44
Add a new helper macro which is a wrapper over StringTableAddString().
It adds a string to the string table, and if the string is NULL or empty,
add "" string instead.

Signed-off-by: Dat Mach <[email protected]>
Signed-off-by: Nick Ramirez <[email protected]>
Signed-off-by: Girish Mahadevan <[email protected]>
SMBIOS Structure Types 0 through 127 (7Fh) are reserved
for and defined by the SMBIOS specification. Types 128
through 256 (80h to FFh) are available for system and
OEM-specific information.

Therefore, define a new type 'SMBIOS_TABLE_TYPE' that
represents a SMBIOS structure type and include it in
the definition of CM_STD_OBJ_SMBIOS_TABLE_INFO.

Acked-by: Abner Chang <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Cc: Alexei Fedorov <[email protected]>
Cc: Pierre Gondois <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Ashish Singhal <[email protected]>
Cc: Nick Ramirez <[email protected]>
Cc: William Watson <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Samer El-Haj-Mahmoud <[email protected]>
Cc: Jose Marinho <[email protected]>
Some SMBIOS structure/table fields have dependency on other SMBIOS
structures/tables. These dependencies are established using handles
pointing to the dependent tables.

A SMBIOS table handle can be obtained by either installing a SMBIOS
table or by allocating a handle, which requires complex management
to avoid any clashes.

Obtaining a SMBIOS handle by installation requires that the dependent
table is installed before the parent SMBIOS table can be installed.
Therefore, introduce a SMBIOS table dispatcher that walks the SMBIOS
dependency list and schedules the dependent tables to be installed
before the parent table is installed.

Signed-off-by: Sami Mujawar <[email protected]>
Cc: Alexei Fedorov <[email protected]>
Cc: Pierre Gondois <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Ashish Singhal <[email protected]>
Cc: Nick Ramirez <[email protected]>
Cc: William Watson <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Samer El-Haj-Mahmoud <[email protected]>
Cc: Jose Marinho <[email protected]>
Add an extern call to build SMBIOS table as this seemed to have
been removed during v2.

Signed-off-by: Girish Mahadevan <[email protected]>
Update the SMBIOS table dispatcher dependency table to add the
table dependencies for SMBIOS table Type 19, Type 20, Type 27,
Type 35 and Type 37.

The SMBIOS table Type 35 can have dependency on 6 other SMBIOS
tables. Therefore, increase the MAX_SMBIOS_DEPENDENCY to 6, and
also update the SMBIOS table dispatcher table accordingly.

Signed-off-by: Sami Mujawar <[email protected]>
Cc: Alexei Fedorov <[email protected]>
Cc: Pierre Gondois <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Ashish Singhal <[email protected]>
Cc: Nick Ramirez <[email protected]>
Cc: William Watson <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Samer El-Haj-Mahmoud <[email protected]>
Cc: Jose Marinho <[email protected]>
Some SMBIOS tables do not have a fixed dependency and can depend on any
other SMBIOS tables. Therefore, the SMBIOS dispatcher cannot define a
fixed sequence for dispatching these tables. A possible solution is to
defer the dispatch of such SMBIOS tables towards the end, assuming that
the dependent SMBIOS tables would have been dispatched by then.

Therefore, introduce a dispatch order attribute such that SMBIOS tables
that have a fixed dependency sequence are configured as Default Ordered,
and the SMBIOS tables that do not have a fixed dependency have an Order
attribute specifying an Order Level. An Order Level is used to sequence
the dispatch of Ordered SMBIOS tables.

The Default Ordered SMBIOS tables are dispatched first and a dependency
walk is performed to dispatch the dependent tables by iterating through
the SMBIOS_TABLE_DISPATCHER.Dependency[].

Once all Default ordered SMBIOS tables have been dispatched, the Ordered
SMBIOS tables would be scheduled for dispatch in increasing order as of
the Order Level, e.g. OrderL1, OrderL2, ...
Note: The dispatcher does not perform a dependency walk for the Ordered
SMBIOS tables as the expectation is that the dependent SMBIOS tables
would be already dispatched.

A top level dispatch function DispatchSmbiosTables() has been introduced
to schedule the dispatch of Default Ordered and Ordered SMBIOS tables.

Signed-off-by: Sami Mujawar <[email protected]>
Cc: Alexei Fedorov <[email protected]>
Cc: Pierre Gondois <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Ashish Singhal <[email protected]>
Cc: Nick Ramirez <[email protected]>
Cc: William Watson <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Samer El-Haj-Mahmoud <[email protected]>
Cc: Jose Marinho <[email protected]>
Add the SMBIOS Table generator code to the DynamicTablesPkg.

This change includes adding new logic to the DynamicTableManager
to process and add SMBIOS tables and augmenting the existing SMBIOS
Factory generator to include installing multiple SMBIOS tables .
Also included is running the SMBIOS and ACPI table generation as part
of the SMBIOS and ACPI protocol GUID callback notifications respectively.

Change-Id: Icc090108c16e87657260af6daf856f3d69b602e3
Signed-off-by: Girish Mahadevan <[email protected]>
Reviewed-by: Jeff Brasen <[email protected]>
Split the SMBIOS and ACPI table generators into their own files.

Signed-off-by: Girish Mahadevan <[email protected]>
Reviewed-by: Jeff Brasen <[email protected]>
Introduce a new namespace for SMBIOS related CM Objects.

Signed-off-by: Girish Mahadevan <[email protected]>
Reviewed-by: Nick Ramirez <[email protected]>
Reviewed-by: Jeff Brasen <[email protected]>
Add the Generator library for SMBIOS Table Type 17 - Memory
Device.

Signed-off-by: Girish Mahadevan <[email protected]>
Reviewed-by: Jeff Brasen <[email protected]>
Add the Generator library for SMBIOS Table Type 16 - Physical
Memory Array.

Signed-off-by: Girish Mahadevan <[email protected]>
Reviewed-by: Jeff Brasen <[email protected]>
Reviewed-by: Nick Ramirez <[email protected]>
Add the Generator library for SMBIOS Table Type 19 - Memory Array
Mapped Address.

Signed-off-by: Girish Mahadevan <[email protected]>
Reviewed-by: Jeff Brasen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants