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 <anil.kumar.k@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55368
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Anil Kumar 2021-06-09 11:51:10 -07:00 committed by Paul Fagerburg
parent 70a815a1e0
commit 9b73c2b2f4
1 changed files with 23 additions and 1 deletions

View File

@ -10,8 +10,8 @@
#include <smbios.h>
#include <stdint.h>
#include <string.h>
#include "board_id.h"
#include <fw_config.h>
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 = {