summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Zhang <jonzhang@meta.com>2022-10-25 09:51:52 -0700
committerFelix Held <felix-coreboot@felixheld.de>2022-11-22 12:50:05 +0000
commitb09517b2fb0d423275c1228332bf7bf9e8607482 (patch)
tree64e900be094f159e502e51a1cf04cdadb5115a05
parentaec294a71ac3bf9438a7c43efd519630bd52130b (diff)
drivers/ocp/dmi: move smbios_ec_revision to ocp folder
Move smbios_ec_revision to ocp folder so that all ocp boards share the same function without implementing again. TESTED=Execute "dmidecode -t 0" to check corresponding field. Signed-off-by: Tim Chu <Tim.Chu@quantatw.com> Signed-off-by: Jonzhang Zhang <jonzhang@meta.com> Change-Id: I898662b78d3dbab1861cee6f1b6e148297a5d11b Reviewed-on: https://review.coreboot.org/c/coreboot/+/68785 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Marc Jones <marc@marcjonesconsulting.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/drivers/ocp/dmi/smbios.c15
-rw-r--r--src/mainboard/ocp/deltalake/ramstage.c15
2 files changed, 15 insertions, 15 deletions
diff --git a/src/drivers/ocp/dmi/smbios.c b/src/drivers/ocp/dmi/smbios.c
index 51c008d405..0ac3334751 100644
--- a/src/drivers/ocp/dmi/smbios.c
+++ b/src/drivers/ocp/dmi/smbios.c
@@ -22,6 +22,21 @@ struct fru_info_str fru_strings = {0};
msr_t xeon_sp_ppin[2] = {0};
static bool remote_ppin_done = false;
+/*
+ * Update SMBIOS type 0 ec version.
+ * For OCP platforms, BMC version is used to represent ec version.
+ * Refer to IPMI v2.0 spec, minor revision is defined as BCD encoded,
+ * format it accordingly.
+ */
+void smbios_ec_revision(uint8_t *ec_major_revision, uint8_t *ec_minor_revision)
+{
+ uint8_t bmc_major_revision, bmc_minor_revision;
+
+ ipmi_bmc_version(&bmc_major_revision, &bmc_minor_revision);
+ *ec_major_revision = bmc_major_revision & 0x7f; /* bit[6:0] Major Firmware Revision */
+ *ec_minor_revision = ((bmc_minor_revision / 16) * 10) + (bmc_minor_revision % 16);
+}
+
/* Override SMBIOS type 1 data. */
const char *smbios_system_manufacturer(void)
{
diff --git a/src/mainboard/ocp/deltalake/ramstage.c b/src/mainboard/ocp/deltalake/ramstage.c
index 0fca9207f2..d553392e16 100644
--- a/src/mainboard/ocp/deltalake/ramstage.c
+++ b/src/mainboard/ocp/deltalake/ramstage.c
@@ -30,21 +30,6 @@
extern struct fru_info_str fru_strings;
static char slot_id_str[SLOT_ID_LEN];
-/*
- * Update SMBIOS type 0 ec version.
- * In deltalake, BMC version is used to represent ec version.
- * In current version of OpenBMC, it follows IPMI v2.0 to define minor revision as BCD
- * encoded, so the format of it must be transferred before send to SMBIOS.
- */
-void smbios_ec_revision(uint8_t *ec_major_revision, uint8_t *ec_minor_revision)
-{
- uint8_t bmc_major_revision, bmc_minor_revision;
-
- ipmi_bmc_version(&bmc_major_revision, &bmc_minor_revision);
- *ec_major_revision = bmc_major_revision & 0x7f; /* bit[6:0] Major Firmware Revision */
- *ec_minor_revision = ((bmc_minor_revision / 16) * 10) + (bmc_minor_revision % 16);
-}
-
/* Override SMBIOS 2 Location In Chassis from BMC */
const char *smbios_mainboard_location_in_chassis(void)
{