summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnil Kumar <anil.kumar.k@intel.com>2021-06-09 11:51:10 -0700
committerPaul Fagerburg <pfagerburg@chromium.org>2021-08-05 15:55:12 +0000
commit9b73c2b2f485c002626ee404372475cdd8e2543a (patch)
tree23fb5d150bd1e4fa63f20ff709d923439fa42b9a
parent70a815a1e0e5cad76c82be950b195a2adc1c6d3a (diff)
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>
-rw-r--r--src/mainboard/intel/adlrvp/mainboard.c24
1 files changed, 23 insertions, 1 deletions
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 <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 = {