From patchwork Wed Apr 19 04:33:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 752085 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 3w78LG6Tdnz9ryZ for ; Wed, 19 Apr 2017 14:35:02 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3w78LG5lG7zDqG4 for ; Wed, 19 Apr 2017 14:35:02 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3w78Kt6bY5zDq8M for ; Wed, 19 Apr 2017 14:34:42 +1000 (AEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3J4YDoO079914 for ; Wed, 19 Apr 2017 00:34:37 -0400 Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) by mx0a-001b2d01.pphosted.com with ESMTP id 29x0wxr327-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 19 Apr 2017 00:34:36 -0400 Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Apr 2017 14:34:32 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 19 Apr 2017 14:34:30 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3J4YMdc50528406 for ; Wed, 19 Apr 2017 14:34:30 +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 v3J4Xvpb009336 for ; Wed, 19 Apr 2017 14:33:57 +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 v3J4XtEU009032; Wed, 19 Apr 2017 14:33:55 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Wed, 19 Apr 2017 10:03:36 +0530 X-Mailer: git-send-email 2.9.3 X-TM-AS-MML: disable x-cbid: 17041904-0052-0000-0000-0000022F08A4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17041904-0053-0000-0000-0000080935FD Message-Id: <20170419043337.14669-1-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 1/2] SBE: Add passthrough command support 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 MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" SBE sends passthrough command. We have to capture this interrupt and send event HBRT via opal-prd. This patch enables OPAL to capture interrupt and send event to kernel. Next patch will add opal-prd (user space) support. Signed-off-by: Vasant Hegde Reviewed-by: Mahesh Salgaonkar --- This patch works on top of my SBE patchset [1]. [1] https://lists.ozlabs.org/pipermail/skiboot/2017-April/006984.html -Vasant hw/prd.c | 13 +++++++++++++ hw/sbe-p9.c | 5 +++++ include/opal-api.h | 4 ++++ include/sbe-p9.h | 1 + include/skiboot.h | 1 + 5 files changed, 24 insertions(+) diff --git a/hw/prd.c b/hw/prd.c index a44faa9..e19074e 100644 --- a/hw/prd.c +++ b/hw/prd.c @@ -27,6 +27,7 @@ enum events { EVENT_ATTN = 1 << 0, EVENT_OCC_ERROR = 1 << 1, EVENT_OCC_RESET = 1 << 2, + EVENT_SBE_PASSTHROUGH = 1 << 3, }; static uint8_t events[MAX_CHIPS]; @@ -112,6 +113,10 @@ static void prd_msg_consumed(void *data) proc = msg->occ_reset.chip; event = EVENT_OCC_RESET; break; + case OPAL_PRD_MSG_TYPE_SBE_PASSTHROUGH: + proc = msg->sbe_passthrough.chip; + event = EVENT_SBE_PASSTHROUGH; + break; default: prlog(PR_ERR, "PRD: invalid msg consumed, type: 0x%x\n", msg->hdr.type); @@ -183,6 +188,9 @@ static void send_next_pending_event(void) prd_msg.hdr.type = OPAL_PRD_MSG_TYPE_OCC_RESET; prd_msg.occ_reset.chip = proc; occ_msg_queue_occ_reset(); + } else if (event & EVENT_SBE_PASSTHROUGH) { + prd_msg.hdr.type = OPAL_PRD_MSG_TYPE_SBE_PASSTHROUGH; + prd_msg.sbe_passthrough.chip = proc; } queue_prd_msg(&prd_msg, prd_msg_consumed); @@ -263,6 +271,11 @@ void prd_occ_reset(uint32_t proc) prd_event(proc, EVENT_OCC_RESET); } +void prd_sbe_passthrough(uint32_t proc) +{ + prd_event(proc, EVENT_SBE_PASSTHROUGH); +} + /* incoming message handlers */ static int prd_msg_handle_attn_ack(struct opal_prd_msg *msg) { diff --git a/hw/sbe-p9.c b/hw/sbe-p9.c index 527e8ca..31bc885 100644 --- a/hw/sbe-p9.c +++ b/hw/sbe-p9.c @@ -546,6 +546,11 @@ void sbe_interrupt(uint32_t chip_id) goto clr_interrupt; } + /* SBE passtrhough command, call prd handler */ + if (data & SBE_HOST_PASSTHROUGH) { + prd_sbe_passthrough(sbe->chip_id); + } + /* Handle SBE response */ if (data & SBE_HOST_RESPONSE_WAITING) { lock(&sbe->lock); diff --git a/include/opal-api.h b/include/opal-api.h index 7966200..80915ac 100644 --- a/include/opal-api.h +++ b/include/opal-api.h @@ -962,6 +962,7 @@ enum opal_prd_msg_type { OPAL_PRD_MSG_TYPE_OCC_ERROR, /* HBRT <-- OPAL */ OPAL_PRD_MSG_TYPE_OCC_RESET, /* HBRT <-- OPAL */ OPAL_PRD_MSG_TYPE_OCC_RESET_NOTIFY, /* HBRT --> OPAL */ + OPAL_PRD_MSG_TYPE_SBE_PASSTHROUGH, /* HBRT <-- OPAL */ }; struct opal_prd_msg_header { @@ -993,6 +994,9 @@ struct opal_prd_msg { struct { __be64 chip; } occ_reset; + struct { + __be64 chip; + } sbe_passthrough; }; }; diff --git a/include/sbe-p9.h b/include/sbe-p9.h index 3017003..2bc28f4 100644 --- a/include/sbe-p9.h +++ b/include/sbe-p9.h @@ -92,6 +92,7 @@ #define SBE_HOST_MSG_READ PPC_BIT(1) #define SBE_HOST_STOP15_EXIT PPC_BIT(2) #define SBE_HOST_RESET PPC_BIT(3) +#define SBE_HOST_PASSTHROUGH PPC_BIT(4) #define SBE_HOST_TIMER_EXPIRY PPC_BIT(14) #define SBE_HOST_RESPONSE_CLEAR 0x00 diff --git a/include/skiboot.h b/include/skiboot.h index eb05951..f966549 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -275,6 +275,7 @@ extern void occ_pnor_set_owner(enum pnor_owner owner); extern void prd_psi_interrupt(uint32_t proc); extern void prd_tmgt_interrupt(uint32_t proc); extern void prd_occ_reset(uint32_t proc); +extern void prd_sbe_passthrough(uint32_t proc); extern void prd_init(void); extern void prd_register_reserved_memory(void);