From 9b73c2b2f485c002626ee404372475cdd8e2543a Mon Sep 17 00:00:00 2001 From: Anil Kumar Date: Wed, 9 Jun 2021 11:51:10 -0700 Subject: [PATCH] mb/intel/adlrvp: Add probed fw_configs to SMBIOS OEM strings This feature was added in ADL-M RVP for discovering correct audio topology using OEM string e.g., "ADL_MAX98373_ALC5682I_I2S" for discovering boards having audio expansion card Bug=None Test= With CBI FW_CONFIG set to 0x100 localhost /home/root # dmidecode -t 11 Getting SMBIOS data from sysfs. SMBIOS 3.0 present. Handle 0x0009, DMI type 11, 5 bytes OEM Strings String 1: ADL_MAX98373_ALC5682I_I2S Change-Id: I05887d9d654eae6d9d2da731d8ab4cf4a05c287f Signed-off-by: Anil Kumar Reviewed-on: https://review.coreboot.org/c/coreboot/+/55368 Reviewed-by: Tim Wawrzynczak Reviewed-by: Sathyanarayana Nujella Tested-by: build bot (Jenkins) --- src/mainboard/intel/adlrvp/mainboard.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/mainboard/intel/adlrvp/mainboard.c b/src/mainboard/intel/adlrvp/mainboard.c index eb86773ca0..1e1e3181cf 100644 --- a/src/mainboard/intel/adlrvp/mainboard.c +++ b/src/mainboard/intel/adlrvp/mainboard.c @@ -10,8 +10,8 @@ #include #include #include - #include "board_id.h" +#include const char *smbios_system_sku(void) { @@ -30,9 +30,31 @@ static void mainboard_init(void *chip_info) mainboard_ec_init(); } +#if CONFIG(BOARD_INTEL_ADLRVP_M_EXT_EC) +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) +{ + fw_config_for_each_found(add_fw_config_oem_string, t); +} +#endif + static void mainboard_enable(struct device *dev) { dev->ops->acpi_inject_dsdt = chromeos_dsdt_generator; + +#if CONFIG(BOARD_INTEL_ADLRVP_M_EXT_EC) + dev->ops->get_smbios_strings = mainboard_smbios_strings; +#endif } struct chip_operations mainboard_ops = { -- 2.11.4.GIT