From patchwork Wed Apr 19 04:33:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 752084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w78L86bgCz9ryZ for ; Wed, 19 Apr 2017 14:34:56 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3w78L85r7JzDqC6 for ; Wed, 19 Apr 2017 14:34:56 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w78Kr3yvlzDq8t for ; Wed, 19 Apr 2017 14:34:40 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3J4Xdux021244 for ; Wed, 19 Apr 2017 00:34:37 -0400 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0b-001b2d01.pphosted.com with ESMTP id 29wqpu38us-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 19 Apr 2017 00:34:37 -0400 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Apr 2017 14:34:35 +1000 Received: from d23relay06.au.ibm.com (202.81.31.225) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 19 Apr 2017 14:34:32 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3J4YO0n61210790 for ; Wed, 19 Apr 2017 14:34:32 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v3J4Xwmt009365 for ; Wed, 19 Apr 2017 14:33:58 +1000 Received: from hegdevasant.in.ibm.com ([9.109.222.194]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v3J4XtEV009032; Wed, 19 Apr 2017 14:33:57 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Wed, 19 Apr 2017 10:03:37 +0530 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170419043337.14669-1-hegdevasant@linux.vnet.ibm.com> References: <20170419043337.14669-1-hegdevasant@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-MML: disable x-cbid: 17041904-0016-0000-0000-0000022F3AF1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17041904-0017-0000-0000-000006AA375D Message-Id: <20170419043337.14669-2-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-19_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704190042 Subject: [Skiboot] [PATCH 2/2] opal-prd: Handle SBE passthrough message passing X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dcrowell@us.ibm.com Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This patch adds support to send SBE pass through command to HBRT. HBRT interface details provided by Daniel M. Crowell (). Signed-off-by: Vasant Hegde --- external/opal-prd/hostboot-interface.h | 15 ++++++++++++++- external/opal-prd/opal-prd.c | 23 +++++++++++++++++++++++ external/opal-prd/thunk.S | 1 + 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/external/opal-prd/hostboot-interface.h b/external/opal-prd/hostboot-interface.h index 3e73ef8..3f32c09 100644 --- a/external/opal-prd/hostboot-interface.h +++ b/external/opal-prd/hostboot-interface.h @@ -491,6 +491,19 @@ struct runtime_interfaces { */ int (*run_command)(int argc, const char **argv, char **o_outString); + /** + * @brief SBE message passing + * @details   This is a blocking call that will pass an SBE message + *       with a pass-through command through HBRT to code that + * will process the command and provide a response. + * + * @param[in] i_procChipId Chip ID of the processor whose SBE is passing + * the message and sent the interrupt + * @returns   0 on success, or return code if the command failed + * @platform FSP, OpenPOWER + */ + int (*sbe_message_passing)(uint32_t i_procChipId); + /* Reserve some space for future growth. */ - void (*reserved[29])(void); + void (*reserved[28])(void); }; diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c index 1723924..95b9484 100644 --- a/external/opal-prd/opal-prd.c +++ b/external/opal-prd/opal-prd.c @@ -256,6 +256,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); void hservice_puts(const char *str) { @@ -1207,6 +1208,25 @@ static int handle_msg_occ_reset(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; + + 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; + } + + call_sbe_message_passing(proc); + return 0; +} + static int handle_prd_msg(struct opal_prd_ctx *ctx) { struct opal_prd_msg msg; @@ -1241,6 +1261,9 @@ static int handle_prd_msg(struct opal_prd_ctx *ctx) case OPAL_PRD_MSG_TYPE_OCC_ERROR: rc = handle_msg_occ_error(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); diff --git a/external/opal-prd/thunk.S b/external/opal-prd/thunk.S index f355158..da22ee8 100644 --- a/external/opal-prd/thunk.S +++ b/external/opal-prd/thunk.S @@ -93,6 +93,7 @@ call_##name: ;\ CALL_THUNK(apply_attr_override, 12) CALL_THUNK(mfg_htmgt_pass_thru, 13) CALL_THUNK(run_command, 14) + CALL_THUNK(sbe_message_passing, 15) .globl call_hbrt_init call_hbrt_init: