
From: Simon Glass <sjg@chromium.org> Quite a few SMBIOS features are not yet described in the documentation. Add a new section the 'usage' and add more to the developer documentation, including how to use the devicetree to provide values. Add some links between usage docs, developer docs and the command. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <sjg@chromium.org> --- doc/develop/smbios.rst | 65 ++++++++++++++ doc/usage/cmd/smbios.rst | 3 +- doc/usage/index.rst | 1 + doc/usage/smbios.rst | 180 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 248 insertions(+), 1 deletion(-) create mode 100644 doc/usage/smbios.rst diff --git a/doc/develop/smbios.rst b/doc/develop/smbios.rst index a4efb0a0a38..42942e547c1 100644 --- a/doc/develop/smbios.rst +++ b/doc/develop/smbios.rst @@ -18,5 +18,70 @@ must be enabled. The easiest way to provide the values to use is via the device tree. For details see :download:`smbios.txt <../device-tree-bindings/sysinfo/smbios.txt>`. +See also the :doc:`/usage/cmd/smbios`. + +Programming Interface +--------------------- + +Developers can access SMBIOS information programmatically: + +Functions +~~~~~~~~~ + +* ``smbios_locate()`` - Locate and parse SMBIOS tables +* ``smbios_get_header()`` - Get a specific SMBIOS table by type +* ``smbios_string()`` - Extract strings from SMBIOS tables + +Example code:: + + const struct smbios_type1 *sys; + struct smbios_info info; + int ret; + + ret = smbios_locate(gd_smbios_start(), &info); + if (ret) + return ret; + + sys = smbios_get_header(&info, SMBIOS_SYSTEM_INFORMATION); + if (sys) { + const char *manufacturer = smbios_string(&sys->hdr, sys->manufacturer); + + printf("Manufacturer: %s\n", manufacturer); + } + + +Board-specific Implementation +----------------------------- + +Boards can provide custom SMBIOS data by implementing board-specific functions: + +* ``smbios_update_version()`` - Update version strings +* ``smbios_system_serial()`` - Provide system serial number +* ``smbios_system_uuid()`` - Provide system UUID +* ``smbios_system_sku()`` - Provide SKU number +* ``smbios_baseboard_serial()`` - Provide baseboard serial number + +These functions are called during SMBIOS table generation if defined. + + +Troubleshooting +--------------- + +Common issues and solutions: + +**Tables not generated** + Ensure ``CONFIG_SMBIOS`` is enabled and memory allocation is sufficient + +**Missing information** + Check that board-specific functions are implemented or default configuration + values are set + +**Incorrect data** + Verify environment variables and board-specific function implementations + +**Memory layout issues** + Check memory map and ensure SMBIOS tables don't conflict with other data + + .. [1] `System Management BIOS (SMBIOS) Reference, version 3.5 <https://www.dmtf.org/content/dmtf-releases-smbios-35>`_ diff --git a/doc/usage/cmd/smbios.rst b/doc/usage/cmd/smbios.rst index 1ffd706d7de..52935b0ea02 100644 --- a/doc/usage/cmd/smbios.rst +++ b/doc/usage/cmd/smbios.rst @@ -13,7 +13,8 @@ Synopsis Description ----------- -The smbios command displays information from the SMBIOS tables. +The smbios command displays information from the SMBIOS tables. See also +:doc:`../smbios`. Examples -------- diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 3b45d443d5c..89341349d12 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -15,6 +15,7 @@ Use U-Boot partitions cmdline semihosting + smbios measured_boot upl diff --git a/doc/usage/smbios.rst b/doc/usage/smbios.rst new file mode 100644 index 00000000000..90dc5a58961 --- /dev/null +++ b/doc/usage/smbios.rst @@ -0,0 +1,180 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +SMBIOS support in U-Boot +======================== + +U-Boot supports generating and using SMBIOS (System Management BIOS) tables, +which provide standardized hardware and firmware information to the operating +system and applications. + +Overview +-------- + +SMBIOS is a standard developed by the Desktop Management Task Force (DMTF) that +defines a way for firmware to present hardware information to software running +on the system. The information is organized into typed data structures called +SMBIOS tables or structures. + +SMBIOS Generation in U-Boot +--------------------------- + +U-Boot can automatically generate SMBIOS tables based on configuration and +hardware detection. The tables are created during the boot process and made +available to the operating system. + +See also the developer documentation: :doc:`/develop/smbios`. + +Configuration +~~~~~~~~~~~~~ + +SMBIOS support is enabled through several Kconfig options: + +* ``CONFIG_SMBIOS`` - Enable SMBIOS table generation +* ``CONFIG_SMBIOS_PARSER`` - Enable SMBIOS table parsing support +* ``CONFIG_CMD_SMBIOS`` - Enable the :doc:`/usage/cmd/smbios` + +Providing Values +~~~~~~~~~~~~~~~~ + +SMBIOS field values can be provided through two mechanisms, in order of +precedence: + +1. **Sysinfo Driver**: A sysinfo driver (``UCLASS_SYSINFO``) can provide dynamic + values at runtime through predefined sysinfo IDs. + +2. **Device Tree Properties**: Static values can be defined in device tree nodes + corresponding to each SMBIOS table type. + +Device Tree Configuration +^^^^^^^^^^^^^^^^^^^^^^^^^ + +SMBIOS values can be specified in device tree nodes, but only when a sysinfo +driver is present. The 'smbios' node must be a subnode of the sysinfo device +in the device tree. + +The following smbios subnodes and properties are supported: + +**BIOS Information** (``smbios/bios``): + * ``version`` - BIOS version string + +**System Information** (``smbios/system``): + * ``manufacturer`` - System manufacturer + * ``product`` - Product name + * ``version`` - System version + * ``serial`` - Serial number + * ``sku`` - SKU number + * ``family`` - Product family + * ``wakeup-type`` - System wakeup type (numeric) + +**Baseboard Information** (``smbios/baseboard``): + * ``manufacturer`` - Baseboard manufacturer + * ``product`` - Baseboard product name + * ``version`` - Baseboard version + * ``serial`` - Baseboard serial number + * ``asset-tag`` - Asset tag number + * ``feature-flags`` - Feature flags (numeric) + * ``chassis-location`` - Location in chassis + +**Chassis Information** (``smbios/chassis``): + * ``manufacturer`` - Chassis manufacturer + * ``version`` - Chassis version + * ``serial`` - Chassis serial number + * ``asset-tag`` - Chassis asset tag + * ``sku`` - Chassis SKU number + +**Processor Information** (``smbios/processor``): + * ``manufacturer`` - CPU manufacturer + * ``version`` - Processor version/model + * ``socket-design`` - Socket designation + +**Cache Information** (``smbios/cache``): + * ``socket-design`` - Socket designation + +Example device tree configuration:: + + sysinfo { + compatible = "sandbox,sysinfo-sandbox"; + + smbios { + system { + manufacturer = "Example Corp"; + product = "Example Board"; + version = "1.0"; + serial = "123456789"; + sku = "EXAMPLE-SKU-001"; + family = "Example Family"; + }; + + baseboard { + manufacturer = "Example Corp"; + product = "Example Baseboard"; + version = "Rev A"; + serial = "BB123456789"; + }; + }; + }; + +The device tree values serve as defaults and will be overridden by any values +provided by a sysinfo driver. + +SMBIOS Table Types +------------------ + +U-Boot generates several standard SMBIOS table types: + +Type 0: BIOS Information + Contains BIOS vendor, version, release date, and characteristics + +Type 1: System Information + Contains system manufacturer, product name, version, serial number, UUID, + SKU number, and family + +Type 2: Baseboard Information + Contains motherboard/baseboard manufacturer, product name, version, and + serial number + +Type 3: System Enclosure + Contains chassis information including type, manufacturer, version, and + serial number + +Type 4: Processor Information + Contains CPU information including family, manufacturer, version, and + characteristics + +Type 16: Physical Memory Array + Describes the physical memory configuration + +Type 17: Memory Device + Describes individual memory modules + +Type 19: Memory Array Mapped Address + Maps physical memory arrays to system addresses + +Type 32: System Boot Information + Contains boot status information + +Using SMBIOS Tables +------------------- + +Generated SMBIOS tables are typically placed in memory where the operating +system can find them. The location varies by architecture: + +* **x86**: Tables placed in conventional memory below 1MB +* **ARM/AArch64**: Tables passed via device tree or ACPI + +The smbios command +------------------ + +U-Boot provides the ``smbios`` command to display SMBIOS information. + +Example:: + + smbios # Show all tables + + +References +---------- + +* `DMTF SMBIOS Specification <https://www.dmtf.org/standards/smbios>`_ +* `Microsoft System and Enclosure Chassis Types <https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/smbios>`_ +* `Computer Hardware ID (CHID) Specification <https://docs.microsoft.com/en-us/windows-hardware/drivers/install/specifying-hardware-ids-for-a-computer>`_ -- 2.43.0