aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWisley Chen <wisley.chen@quanta.corp-partner.google.com>2021-08-25 18:13:59 +0600
committerTim Wawrzynczak <twawrzynczak@chromium.org>2021-09-01 19:32:43 +0000
commitb8461aab5271dcabf4663e6e7123f657f52cb4f2 (patch)
treeb3406132a0d7a81d25a1d9e507e44c30b7008f70
parentb9c22e09651a7a07af7b2869a91f2d100b08f71b (diff)
mb/goog/brya: 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. BUG=b:191931762 TEST=With CBI FW_CONFIG field set to 0x8, set probe AUDIO MAX98390_ALC5682I_I2S_4SPK in devicetree dmidecode -t 11 OEM Strings AUDIO-MAX98390_ALC5682I_I2S_4SPK Change-Id: I93cd9ef2d1ad963e66c422cff17b083abf731046 Signed-off-by: Wisley Chen <wisley.chen@quanta.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57142 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
-rw-r--r--src/mainboard/google/brya/mainboard.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/mainboard.c b/src/mainboard/google/brya/mainboard.c
index 388926fbf7..6287d2ceb5 100644
--- a/src/mainboard/google/brya/mainboard.c
+++ b/src/mainboard/google/brya/mainboard.c
@@ -6,6 +6,23 @@
#include <ec/ec.h>
#include <soc/ramstage.h>
#include <vendorcode/google/chromeos/chromeos.h>
+#include <fw_config.h>
+
+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);
+}
void mainboard_update_soc_chip_config(struct soc_intel_alderlake_config *config)
{
@@ -44,6 +61,7 @@ static void mainboard_enable(struct device *dev)
{
dev->ops->init = mainboard_dev_init;
dev->ops->acpi_inject_dsdt = chromeos_dsdt_generator;
+ dev->ops->get_smbios_strings = mainboard_smbios_strings;
}
struct chip_operations mainboard_ops = {