summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2022-12-02 01:24:02 +0530
committerSubrata Banik <subratabanik@google.com>2022-12-03 07:34:11 +0000
commitdb59e4887023b15b781dd85daa9df598dc241d5c (patch)
treeb48314cea6fb37f1f104cf0b21f2ee2983e6eb8a /src/mainboard/google
parente233fc7ac1425d54f5f237f6391d00141867836c (diff)
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 <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70228 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/rex/mainboard.c14
1 files changed, 13 insertions, 1 deletions
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 <baseboard/variants.h>
#include <device/device.h>
#include <ec/ec.h>
+#include <fw_config.h>
#include <vendorcode/google/chromeos/chromeos.h>
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)