aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2016-11-08 15:25:46 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-11-08 16:51:27 +1100
commit5611389876a748e19b7593d4eb426ced7a6ed31f (patch)
tree53c6669911a5326db0616a7f31abf48184262e97 /hw
parent566150620014c5ee941dd84480fb8b6223abbb33 (diff)
downloadskiboot-5611389876a748e19b7593d4eb426ced7a6ed31f.zip
skiboot-5611389876a748e19b7593d4eb426ced7a6ed31f.tar.gz
skiboot-5611389876a748e19b7593d4eb426ced7a6ed31f.tar.bz2
Add BMC platform to enable correct OEM IPMI commands
An out of tree platform (p8dtu) uses a different IPMI OEM command for IPMI_PARTIAL_ADD_ESEL. This exposed some assumptions about the BMC implementation in our core code. Now, with platform.bmc, each platform can dictate (or detect) the BMC that is present. We allow it to be set at runtime rather than purely statically in struct platform as it's possible to have differing BMC implementations on the one machine (e.g. AMI BMC or OpenBMC). Acked-by: Jeremy Kerr <jk@ozlabs.org> [stewart@linux.vnet.ibm.com: remove enum, update (C) years] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/ipmi/ipmi-sel.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index 369cebc..b79959c 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -334,6 +334,11 @@ static void ipmi_elog_poll(struct ipmi_msg *msg)
struct errorlog *elog_buf = (struct errorlog *) msg->user_data;
size_t req_size;
+ if (bmc_platform->ipmi_oem_partial_add_esel == 0) {
+ prlog(PR_WARNING, "BUG: Dropping ESEL on the floor due to buggy/mising code in OPAL for this BMC");
+ return;
+ }
+
ipmi_init_esel_record();
if (msg->cmd == IPMI_CMD(IPMI_RESERVE_SEL)) {
first = true;
@@ -386,7 +391,8 @@ static void ipmi_elog_poll(struct ipmi_msg *msg)
req_size = IPMI_MAX_REQ_SIZE;
}
- ipmi_init_msg(msg, IPMI_DEFAULT_INTERFACE, IPMI_PARTIAL_ADD_ESEL,
+ ipmi_init_msg(msg, IPMI_DEFAULT_INTERFACE,
+ bmc_platform->ipmi_oem_partial_add_esel,
ipmi_elog_poll, elog_buf, req_size, 2);
msg->data[0] = reservation_id & 0xff;
@@ -462,8 +468,19 @@ static void sel_pnor(uint8_t access)
if (granted)
occ_pnor_set_owner(PNOR_OWNER_EXTERNAL);
+ if (bmc_platform->ipmi_oem_pnor_access_status == 0) {
+ /**
+ * @fwts-label PNORAccessYeahButNoBut
+ * @fwts-advice OPAL doesn't know that the BMC supports
+ * PNOR access commands. This will be a bug in the OPAL
+ * support for this BMC.
+ */
+ prlog(PR_ERR, "PNOR BUG: access requested but BMC doesn't support request\n");
+ break;
+ }
+
/* Ack the request */
- msg = ipmi_mkmsg_simple(IPMI_PNOR_ACCESS_STATUS, &granted, 1);
+ msg = ipmi_mkmsg_simple(bmc_platform->ipmi_oem_pnor_access_status, &granted, 1);
ipmi_queue_msg(msg);
break;
case RELEASE_PNOR: