aboutsummaryrefslogtreecommitdiff
path: root/external/opal-prd
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2017-05-26 14:37:06 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-08 17:24:19 +1000
commit700b8962e5fef208c5c8c5b754d58178ea3ca647 (patch)
tree78fe232e6acec09d2499d2d69ed3190d409b53cf /external/opal-prd
parenta0811f87b84e71c7314d0fd92c34e9715b400817 (diff)
downloadskiboot-700b8962e5fef208c5c8c5b754d58178ea3ca647.zip
skiboot-700b8962e5fef208c5c8c5b754d58178ea3ca647.tar.gz
skiboot-700b8962e5fef208c5c8c5b754d58178ea3ca647.tar.bz2
opal-prd: Handle SBE passthrough message passing
This patch adds support to send SBE pass through command to HBRT. HBRT interface details provided by Daniel M. Crowell (<dcrowell@us.ibm.com>). CC: Daniel M Crowell <dcrowell@us.ibm.com> CC: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external/opal-prd')
-rw-r--r--external/opal-prd/opal-prd.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 73f1de9..798d59c 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);
@@ -1388,6 +1389,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;
@@ -1405,6 +1426,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);