smbios: Refactor smbios library

Current smbios library does not fully match to the specification.
It hardcodes values instead of exposing values from the device.
It does not reserve the space to support dynamic length for
contained object handles or elements and misses the handling of
a few of fields.

The refactoring of this patch includes:
1. Expose values from device via sysinfo interface.
2. Replace smbios_add_prop with smbios_add_prop_si to allow getting
   string values from sysinfo.
3. Add smbios_get_val_si to get values from sysinfo or device tree.
4. Use sysinfo_get_data to get data area.
5. Reserve the space of contained object handles and elements.
6. Miscellaneous fixes in smbios.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
This commit is contained in:
Raymond Mao
2024-12-06 14:54:22 -08:00
committed by Simon Glass
parent 3546baca5d
commit 1d03c4b28d
3 changed files with 175 additions and 45 deletions

View File

@@ -1102,6 +1102,12 @@ config GENERATE_SMBIOS_TABLE
See also SYSINFO_SMBIOS which allows SMBIOS values to be provided in
the devicetree.
config GENERATE_SMBIOS_TABLE_VERBOSE
bool "Generate a verbose SMBIOS (System Management BIOS) table"
depends on GENERATE_SMBIOS_TABLE
help
Provide verbose SMBIOS information.
endmenu
config LIB_RATIONAL