summaryrefslogtreecommitdiff
path: root/cmd/smbios.c
AgeCommit message (Collapse)Author
2026-02-18smbios: print the properties only when they exist in a specified version of specRaymond Mao
By checking the payload length, we can know the version of the spec and skip the ones which are not expected to exist. Signed-off-by: Raymond Mao <[email protected]> Tested-by: Ilias Apalodimas <[email protected]>
2026-02-18smbios: add support for dynamic generation of Type 19 tableRaymond Mao
This commit implements SMBIOS Type 19 (Memory Array Mapped Address) generation with a hybrid approach supporting both: 1. Explicit definition via Device Tree 'smbios' node: Child node under '/smbios/smbios/memory-array-mapped-address' will be used to populate as individual Type 19 structure directly. - Properties follow SMBIOS field names with lowercase letters and hyphen-separated words (e.g., 'starting-address', 'ending-address', 'partition-width', etc.). - This method supports precise platform-defined overrides and system descriptions. 2. Fallback to automatic DT-based discovery: If child node under '/smbios/smbios/memory-array-mapped-address' does not exist, the implementation will: - Scan all top-level 'memory@' nodes to populate Type 19 structure with inferred size and location data. - Scan nodes named or marked as 'memory-controller' and parse associated 'dimm@' subnodes (if present) to extract DIMM sizes and map them accordingly. This dual-mode support enables flexible firmware SMBIOS reporting while aligning with spec-compliant naming and runtime-detected memory topology. Type 19 support is under GENERATE_SMBIOS_TABLE_VERBOSE to avoid increasing rom size for those platforms which only require basic SMBIOS support. Signed-off-by: Raymond Mao <[email protected]> Tested-by: Ilias Apalodimas <[email protected]>
2026-02-18smbios: add support for dynamic generation of Type 17 tableRaymond Mao
This commit implements SMBIOS Type 17 (Memory Device) generation with a hybrid approach supporting both: 1. Explicit definition via Device Tree 'smbios' node: Child node under '/smbios/smbios/memory-device' will be used to populate as individual Type 17 structure directly. - Properties follow SMBIOS field names with lowercase letters and hyphen-separated words (e.g., 'physical-memory-array-handle', ' memory-error-information-handle', 'configured-memory-speed', etc.). - This method supports precise platform-defined overrides and system descriptions. 2. Fallback to automatic DT-based discovery: If child node under '/smbios/smbios/memory-device' does not exist, the implementation will: - Scan all top-level 'memory@' nodes to populate Type 17 structure with inferred size and location data. - Scan nodes named or marked as 'memory-controller' and parse associated 'dimm@' subnodes (if present) to extract DIMM sizes and map them accordingly. This dual-mode support enables flexible firmware SMBIOS reporting while aligning with spec-compliant naming and runtime-detected memory topology. Type 17 support is under GENERATE_SMBIOS_TABLE_VERBOSE to avoid increasing rom size for those platforms which only require basic SMBIOS support. Signed-off-by: Raymond Mao <[email protected]> Tested-by: Ilias Apalodimas <[email protected]>
2026-02-18smbios: add support for dynamic generation of Type 16 tableRaymond Mao
This commit implements SMBIOS Type 16 (Physical Memory Array) generation with a hybrid approach supporting both: 1. Explicit definition via Device Tree 'smbios' node: Child node under '/smbios/smbios/memory-array' will be used to populate as individual Type 16 structure directly. - Properties follow SMBIOS field names with lowercase letters and hyphen-separated words (e.g., 'memory-error-correction', 'maximum-capacity', 'extended-maximum-capacity', etc.). - This method supports precise platform-defined overrides and system descriptions. 2. Fallback to automatic DT-based discovery: If child node under '/smbios/smbios/memory-array' does not exist, the implementation will: - Scan all top-level 'memory@' nodes to populate Type 16 structure with inferred size and location data. - Scan nodes named or marked as 'memory-controller' and parse associated 'dimm@' subnodes (if present) to extract DIMM sizes and map them accordingly. This dual-mode support enables flexible firmware SMBIOS reporting while aligning with spec-compliant naming and runtime-detected memory topology. Type 16 support is under GENERATE_SMBIOS_TABLE_VERBOSE to avoid increasing rom size for those platforms which only require basic SMBIOS support. Signed-off-by: Raymond Mao <[email protected]> Tested-by: Ilias Apalodimas <[email protected]>
2026-02-18smbios: add support for dynamic generation of Type 9 system slot tablesRaymond Mao
This commit introduces support for generating SMBIOS Type 9 (System Slot) tables using a hybrid approach: 1. Explicit Device Tree definitions: Child node under '/smbios/smbios/system-slot' will be interpreted as individual slot definitions. - Each child represents a slot (e.g., isa, pcmcia, etc.). - Properties follow the SMBIOS specification using lowercase hyphen-separated names such as 'slot-type', 'slot-id', 'segment-group-number', 'bus-number', 'slot-information', etc. - This approach allows full customization of each system slot and is especially suitable for platforms with well-defined slot topology. 2. Automatic detection fallback: If child node under '/smbios/smbios/system-slot' does not exist, the implementation will scan the entire device tree for nodes whose 'device_type' matches known slot-related types ("pci", "isa", "pcmcia", etc.). - When a match is found, default values or heuristics are applied to populate to the System Slot table. - This mode is useful for platforms that lack explicit SMBIOS nodes but still expose slot topology via standard DT conventions. Together, two approaches ensure that SMBIOS Type 9 entries are available whether explicitly described or automatically derived. Signed-off-by: Raymond Mao <[email protected]> Tested-by: Ilias Apalodimas <[email protected]>
2025-06-25cmd: smbios: Fix header for type 3 entriesMark Kettenis
Change from "Baseboard Information" to "Chassis information". Signed-off-by: Mark Kettenis <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2025-01-14cmd: update smbios cmdRaymond Mao
Update the cmd according to the changes of the smbios library: 1. Refactor smbios cmd print functions to match the content defined by the specification. 2. Add new print functions for Type 3, 4 and 7. 3. Remove the fallback string "Not specified" from smbios_get_string, as the spec requires a NULL output for those undefined strings. 4. Update the test_cmd_smbios_sandbox pytest expected result to align with the smbios library changes and add new pytest test_cmd_smbios_sysinfo_verbose to test the verbose smbios output. Signed-off-by: Raymond Mao <[email protected]>
2025-01-14smbios: Refactor the smbios headfileRaymond Mao
Move the smbios field definitions to a separated simple headfile, which is a prerequisite to be included by dts files. Add new definitions for cache information. This patch also includes a few of code optimizations in smbios. Signed-off-by: Raymond Mao <[email protected]> Acked-by: Heinrich Schuchardt <[email protected]>
2024-03-27cmd: smbios: type 1 wake-up time, familyHeinrich Schuchardt
Correct type 1 output * render wake up time as string * print family string * remove duplicate serial number output Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-02-02smbios: correctly name Structure Table Maximum Size fieldHeinrich Schuchardt
In the SMBIOS 3 entry point the Structure Table Maximum Size field was incorrectly named max_struct_size. A Maximum Structure Size field only exists in the SMBIOS 2.1 entry point and has a different meaning. Call the Structure Table Length field table_maximum_size. Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-02-02cmd: smbios: show correct table size for SMBIOS2.1 entry pointHeinrich Schuchardt
The SMBIOS table size for SMBIOS2.1 entry points is in field 'Structure Table Length' (offset 0x16) and not in field 'Maximum Structure Size' (offset 0x08). Rename the receiving variable max_struct_size to table_maximum_size to avoid future confusion. Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-02-02cmd: smbios: replace missing string by 'Not Specified'Heinrich Schuchardt
A missing string value is indicated by a string index of 0. In this case print 'Not Specified' like the Linux dmidecode command does. Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-02-02cmd: smbios: add missing colon after UUIDHeinrich Schuchardt
For consistent formatting add a colon ':' after the UUID label. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2024-02-02cmd: smbios: always use '0x%04x' for printing handlesHeinrich Schuchardt
Handles are u16 numbers. Consistently use '0x%04x' to print them. Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-01-26cmd: provide command to display SMBIOS informationHeinrich Schuchardt
U-Boot can either generated an SMBIOS table or copy it from a prior boot stage, e.g. QEMU. Provide a command to display the SMBIOS information. Currently only type 1 and 2 are translated to human readable text. Other types may be added later. Currently only a hexdump and the list of strings is provided for these. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>