From 700b8962e5fef208c5c8c5b754d58178ea3ca647 Mon Sep 17 00:00:00 2001 From: Vasant Hegde Date: Fri, 26 May 2017 14:37:06 +0530 Subject: 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 (). CC: Daniel M Crowell CC: Jeremy Kerr Signed-off-by: Vasant Hegde Signed-off-by: Stewart Smith --- external/opal-prd/opal-prd.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'external') 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); -- cgit v1.1