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>
This commit is contained in:
Subrata Banik 2022-12-02 01:24:02 +05:30
parent e233fc7ac1
commit db59e48870
1 changed files with 13 additions and 1 deletions

View File

@ -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)