[Skiboot] [PATCH v2 2/2] opal-prd: Handle SBE passthrough message passing

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Fri May 26 19:07:06 AEST 2017


This patch adds support to send SBE pass through command to HBRT.

HBRT interface details provided by Daniel M. Crowell (<dcrowell at us.ibm.com>).

CC: Daniel M Crowell <dcrowell at us.ibm.com>
CC: Jeremy Kerr <jk at ozlabs.org>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 external/opal-prd/opal-prd.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index cd8fc93..b6256e1 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -281,6 +281,7 @@ extern int call_mfg_htmgt_pass_thru(uint16_t i_cmdLength, uint8_t *i_cmdData,
 				uint16_t *o_rspLength, uint8_t *o_rspData);
 extern int call_apply_attr_override(uint8_t *i_data, size_t size);
 extern int call_run_command(int argc, const char **argv, char **o_outString);
+extern int call_sbe_message_passing(uint32_t i_chipId);
 extern uint64_t call_get_ipoll_events(void);
 extern int call_firmware_notify(uint64_t len, void *data);
 extern int call_reset_pm_complex(uint64_t chip);
@@ -1377,6 +1378,26 @@ static int handle_msg_firmware_notify(struct opal_prd_ctx *ctx,
 	return 0;
 }
 
+static int handle_msg_sbe_passthrough(struct opal_prd_ctx *ctx,
+				      struct opal_prd_msg *msg)
+{
+	uint32_t proc;
+	int rc;
+
+	proc = be64toh(msg->sbe_passthrough.chip);
+
+	pr_debug("FW: firmware sent SBE pass through command for proc 0x%x\n",
+		 proc);
+
+	if (!hservice_runtime->sbe_message_passing) {
+		pr_log_nocall("sbe_message_passing");
+		return -1;
+	}
+
+	rc = call_sbe_message_passing(proc);
+	return rc;
+}
+
 static int handle_prd_msg(struct opal_prd_ctx *ctx, struct opal_prd_msg *msg)
 {
 	int rc = -1;
@@ -1394,6 +1415,9 @@ static int handle_prd_msg(struct opal_prd_ctx *ctx, struct opal_prd_msg *msg)
 	case OPAL_PRD_MSG_TYPE_FIRMWARE_NOTIFY:
 		rc = handle_msg_firmware_notify(ctx, msg);
 		break;
+	case OPAL_PRD_MSG_TYPE_SBE_PASSTHROUGH:
+		rc = handle_msg_sbe_passthrough(ctx, msg);
+		break;
 	default:
 		pr_log(LOG_WARNING, "Invalid incoming message type 0x%x",
 				msg->hdr.type);
-- 
2.9.3



More information about the Skiboot mailing list