aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/ocp/deltalake/ramstage.c
diff options
context:
space:
mode:
authorJohnny Lin <johnny_lin@wiwynn.com>2020-06-11 15:25:37 +0800
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2020-07-04 11:23:56 +0000
commit5e8709f89e3e4ee385b1798730281b2a9dacdcef (patch)
tree13a57b8f005481a4763b2c1560fe34d2aa6ba88f /src/mainboard/ocp/deltalake/ramstage.c
parent4a8e58fd93c9e3c7fe353026da9c9c2787ccd44b (diff)
mb/ocp/deltalake: Update SMBIOS type 2 Location In Chassis from BMC
There are 4 slots in YV3, Location In Chassis should be 1~4. Tested=on OCP Delta Lake, dmidecode -t 2 verified the string is correct. Change-Id: I3b65ecc6f6421d85d1cb890c522be4787362a01b Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42277 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jonathan Zhang <jonzhang@fb.com> Reviewed-by: Christian Walter <christian.walter@9elements.com>
Diffstat (limited to 'src/mainboard/ocp/deltalake/ramstage.c')
-rw-r--r--src/mainboard/ocp/deltalake/ramstage.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mainboard/ocp/deltalake/ramstage.c b/src/mainboard/ocp/deltalake/ramstage.c
index a8f92ad04a..9380304c0a 100644
--- a/src/mainboard/ocp/deltalake/ramstage.c
+++ b/src/mainboard/ocp/deltalake/ramstage.c
@@ -4,10 +4,32 @@
#include <drivers/ipmi/ipmi_ops.h>
#include <drivers/ocp/dmi/ocp_dmi.h>
#include <soc/ramstage.h>
+#include <stdio.h>
#include "ipmi.h"
+#define SLOT_ID_LEN 2
+
extern struct fru_info_str fru_strings;
+static char slot_id_str[SLOT_ID_LEN];
+
+/* Override SMBIOS 2 Location In Chassis from BMC */
+const char *smbios_mainboard_location_in_chassis(void)
+{
+ uint8_t slot_id = 0;
+
+ if (ipmi_get_slot_id(&slot_id) != CB_SUCCESS) {
+ printk(BIOS_ERR, "IPMI get slot_id failed\n");
+ return "";
+ }
+ /* Sanity check, slot_id can only be 1~4 since there are 4 slots in YV3 */
+ if (slot_id < PCIE_CONFIG_A || slot_id > PCIE_CONFIG_D) {
+ printk(BIOS_ERR, "slot_id %d is not between 1~4\n", slot_id);
+ return "";
+ }
+ snprintf(slot_id_str, SLOT_ID_LEN, "%d", slot_id);
+ return slot_id_str;
+}
static void dl_oem_smbios_strings(struct device *dev, struct smbios_type11 *t)
{