Tim Chu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45138 )
Change subject: arch/x86/smbios: Update SMBIOS type 0 ec version ......................................................................
arch/x86/smbios: Update SMBIOS type 0 ec version
Get embedded controller firmware version and update to SMBIOS type 0. Here BMC version is used to represent ec version.
TEST=Execute "dmidecode -t 0" to check if the ec version is correct
Signed-off-by: Tim Chu Tim.Chu@quantatw.com Change-Id: Ibd5ee27a1b8fa4e5bc66e359d3b62e052e19e8a2 --- M src/arch/x86/smbios.c M src/arch/x86/smbios_defaults.c M src/drivers/ipmi/ipmi_kcs_ops.c M src/include/smbios.h 4 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/45138/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 6c92d03..4a3a2e1 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -396,6 +396,7 @@ { struct smbios_type0 *t = (struct smbios_type0 *)*current; int len = sizeof(struct smbios_type0); + u8 ipmi_bmc_major_revision, ipmi_bmc_minor_revision;
memset(t, 0, sizeof(struct smbios_type0)); t->type = SMBIOS_BIOS_INFORMATION; @@ -424,6 +425,10 @@ t->system_bios_major_release = coreboot_major_revision; t->system_bios_minor_release = coreboot_minor_revision;
+ smbios_ec_revision(&ipmi_bmc_major_revision, &ipmi_bmc_minor_revision); + t->ec_major_release = ipmi_bmc_major_revision; + t->ec_minor_release = ipmi_bmc_minor_revision; + t->bios_characteristics = BIOS_CHARACTERISTICS_PCI_SUPPORTED | BIOS_CHARACTERISTICS_SELECTABLE_BOOT | diff --git a/src/arch/x86/smbios_defaults.c b/src/arch/x86/smbios_defaults.c index 22ce7a5..9ff645c 100644 --- a/src/arch/x86/smbios_defaults.c +++ b/src/arch/x86/smbios_defaults.c @@ -63,6 +63,12 @@ return SMBIOS_BOARD_TYPE_UNKNOWN; }
+__weak void smbios_ec_revision(uint8_t *ipmi_bmc_major_revision, uint8_t *ipmi_bmc_minor_revision) +{ + *ipmi_bmc_major_revision = 0x0; + *ipmi_bmc_minor_revision = 0x0; +} + /* * System Enclosure or Chassis Types as defined in SMBIOS specification. * The default value is SMBIOS_ENCLOSURE_DESKTOP (0x03) but laptop, diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c index 7fa28e3..aa07aa9 100644 --- a/src/drivers/ipmi/ipmi_kcs_ops.c +++ b/src/drivers/ipmi/ipmi_kcs_ops.c @@ -28,6 +28,9 @@ static u8 ipmi_revision_major = 0x1; static u8 ipmi_revision_minor = 0x0;
+static u8 bmc_revision_major = 0x0; +static u8 bmc_revision_minor = 0x0; + static int ipmi_get_device_id(struct device *dev, struct ipmi_devid_rsp *rsp) { int ret; @@ -144,6 +147,9 @@ ipmi_revision_minor = IPMI_IPMI_VERSION_MINOR(rsp.ipmi_version); ipmi_revision_major = IPMI_IPMI_VERSION_MAJOR(rsp.ipmi_version);
+ bmc_revision_major = rsp.fw_rev1; + bmc_revision_minor = rsp.fw_rev2; + memcpy(&man_id, rsp.manufacturer_id, sizeof(rsp.manufacturer_id));
@@ -272,6 +278,12 @@ } #endif
+void smbios_ec_revision(uint8_t *ipmi_bmc_major_revision, uint8_t *ipmi_bmc_minor_revision) +{ + *ipmi_bmc_major_revision = ((bmc_revision_major / 16) * 10) + (bmc_revision_major % 16); + *ipmi_bmc_minor_revision = ((bmc_revision_minor / 16) * 10) + (bmc_revision_minor % 16); +} + #if CONFIG(GENERATE_SMBIOS_TABLES) static int ipmi_smbios_data(struct device *dev, int *handle, unsigned long *current) diff --git a/src/include/smbios.h b/src/include/smbios.h index 521339e..fdc6b10 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -54,6 +54,9 @@ const char *smbios_chassis_serial_number(void); const char *smbios_processor_serial_number(void);
+void smbios_ec_revision(uint8_t *ipmi_bmc_major_revision, + uint8_t *ipmi_bmc_minor_revision); + unsigned int smbios_processor_external_clock(void); unsigned int smbios_processor_characteristics(void); struct cpuid_result;