aboutsummaryrefslogtreecommitdiff
path: root/lib/smbios-parser.c
AgeCommit message (Collapse)AuthorFilesLines
2021-10-26efi_loader: add SMBIOS table measurementMasahisa Kojima1-10/+142
TCG PC Client Platform Firmware Profile Specification requires to measure the SMBIOS table that contains static configuration information (e.g. Platform Manufacturer Enterprise Number assigned by IANA, platform model number, Vendor and Device IDs for each SMBIOS table). The device- and environment-dependent information such as serial number is cleared to zero or space character for the measurement. Existing smbios_string() function returns pointer to the string with const qualifier, but exisintg use case is updating version string and const qualifier must be removed. This commit removes const qualifier from smbios_string() return value and reuses to clear the strings for the measurement. This commit also fixes the following compiler warning: lib/smbios-parser.c:59:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] const struct smbios_header *header = (struct smbios_header *)entry->struct_table_address; Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2021-03-27smbios: Allow writing to the coreboot version stringSimon Glass1-0/+38
When U-Boot is booted from coreboot the SMBIOS tables are written by coreboot, not U-Boot. The existing method of updating the BIOS version string does not work in that case, since gd->smbios_version is only set when U-Boot writes the tables. Add a new function which allows the version to be updated by parsing the tables and writing the string in the correct place. Since coreboot provides a pointer to the SMBIOS tables in its sysinfo structure, this makes it easy to do the update. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05smbios: add parsing APIChristian Gmeiner1-0/+96
Add a very simple API to be able to access SMBIOS strings like vendor, model and bios version. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>