From db59e4887023b15b781dd85daa9df598dc241d5c Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Fri, 2 Dec 2022 01:24:02 +0530 Subject: [PATCH] mb/google/rex: Add probed fw_configs to SMBIOS OEM strings Enable this feature, and it can use the probe statement in devicetree to cache of fw_config field as oem string. TEST=With CBI FW_CONFIG field set to 0x1561 localhost ~ # dmidecode -t 11 Getting SMBIOS data from sysfs. SMBIOS 3.0 present. Handle 0x0009, DMI type 11, 5 bytes OEM Strings String 1: AUDIO-MAX98357_ALC5682I_I2S String 2: CELLULAR-CELLULAR_PCIE String 3: UFC-UFC_MIPI String 4: WFC-WFC_MIPI String 5: DB_SD-SD_GL9755S Change-Id: I6cb35eb9c0fbe32764ca76bb7a929cc92fc38404 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/70228 Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) --- src/mainboard/google/rex/mainboard.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/rex/mainboard.c b/src/mainboard/google/rex/mainboard.c index 552c0d3dc8..2414eddc77 100644 --- a/src/mainboard/google/rex/mainboard.c +++ b/src/mainboard/google/rex/mainboard.c @@ -4,6 +4,7 @@ #include #include #include +#include #include static void mainboard_init(void *chip_info) @@ -19,9 +20,20 @@ static void mainboard_fill_ssdt(const struct device *dev) /* TODO: Add mainboard-specific SSDT entries */ } +static void add_fw_config_oem_string(const struct fw_config *config, void *arg) +{ + struct smbios_type11 *t; + char buffer[64]; + + t = (struct smbios_type11 *)arg; + + snprintf(buffer, sizeof(buffer), "%s-%s", config->field_name, config->option_name); + t->count = smbios_add_string(t->eos, buffer); +} + static void mainboard_smbios_strings(struct device *dev, struct smbios_type11 *t) { - /* TODO: Add mainboard-smbios entries */ + fw_config_for_each_found(add_fw_config_oem_string, t); } static void mainboard_dev_init(struct device *dev)