[Skiboot] [PATCH 2/2] astbmc: Introduce ISOLATE_SP IPMI OEM command
Andrew Jeffery
andrew at aj.id.au
Fri Jul 27 17:33:46 AEST 2018
This is a trapdoor function for severing communications with the service
processor (BMC in this case) on platform exit.
Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
include/platform.h | 1 +
platforms/astbmc/common.c | 20 +++++++++++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/include/platform.h b/include/platform.h
index 1a35a86a6f8b..4cfc238fa8a0 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -42,6 +42,7 @@ struct bmc_platform {
*/
uint32_t ipmi_oem_partial_add_esel;
uint32_t ipmi_oem_pnor_access_status;
+ uint32_t ipmi_oem_isolate_sp;
};
/* OpenCAPI platform-specific I2C information */
diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c
index 2c32db7295af..61b72f8b234f 100644
--- a/platforms/astbmc/common.c
+++ b/platforms/astbmc/common.c
@@ -433,9 +433,26 @@ static bool astbmc_isolate_via_io(void)
return ast_sio_disable();
}
+static bool astbmc_ipmi_isolated = false;
+
+static void astbmc_ipmi_isolation_complete(struct ipmi_msg *msg)
+{
+ astbmc_ipmi_isolated = (msg->cc == IPMI_CC_NO_ERROR);
+}
+
static bool astbmc_isolate_via_ipmi(void)
{
- return false;
+ const uint32_t code = bmc_platform->ipmi_oem_isolate_sp;
+ struct ipmi_msg *msg;
+
+ if (!code)
+ return false;
+
+ msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, code,
+ astbmc_ipmi_isolation_complete, NULL, NULL, 0, 0);
+ ipmi_queue_msg_sync(msg);
+
+ return astbmc_ipmi_isolated;
}
static void astbmc_isolate(void)
@@ -469,4 +486,5 @@ const struct bmc_platform astbmc_ami = {
const struct bmc_platform astbmc_openbmc = {
.name = "OpenBMC",
.ipmi_oem_partial_add_esel = IPMI_CODE(0x3a, 0xf0),
+ .ipmi_oem_isolate_sp = IPMI_CODE(0x32, 0xa5),
};
--
2.17.1
More information about the Skiboot
mailing list