aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/ocp/deltalake/ipmi.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/ipmi.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/ipmi.c')
-rw-r--r--src/mainboard/ocp/deltalake/ipmi.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mainboard/ocp/deltalake/ipmi.c b/src/mainboard/ocp/deltalake/ipmi.c
index b8a4c53c4d..f60abf2e5c 100644
--- a/src/mainboard/ocp/deltalake/ipmi.c
+++ b/src/mainboard/ocp/deltalake/ipmi.c
@@ -46,3 +46,28 @@ enum cb_err ipmi_get_pcie_config(uint8_t *pcie_config)
return CB_SUCCESS;
}
+
+enum cb_err ipmi_get_slot_id(uint8_t *slot_id)
+{
+ int ret;
+ struct ipmi_config_rsp {
+ struct ipmi_rsp resp;
+ uint8_t board_sku_id;
+ uint8_t board_rev_id;
+ uint8_t slot_id;
+ uint8_t slot_config_id;
+ } __packed;
+ struct ipmi_config_rsp rsp;
+
+ ret = ipmi_kcs_message(CONFIG_BMC_KCS_BASE, IPMI_NETFN_OEM, 0x0, IPMI_OEM_GET_BOARD_ID,
+ NULL, 0, (unsigned char *) &rsp, sizeof(rsp));
+
+ if (ret < sizeof(struct ipmi_rsp) || rsp.resp.completion_code) {
+ printk(BIOS_ERR, "IPMI: %s command failed (ret=%d resp=0x%x)\n",
+ __func__, ret, rsp.resp.completion_code);
+ return CB_ERR;
+ }
+ *slot_id = rsp.slot_id;
+
+ return CB_SUCCESS;
+}