From patchwork Tue Sep 12 05:30:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 812701 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 3xrtjB2ZfWz9s7M for ; Tue, 12 Sep 2017 15:32:30 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xrtjB1JLjzDr5G for ; Tue, 12 Sep 2017 15:32:30 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) 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 3xrtj55TpczDr3H for ; Tue, 12 Sep 2017 15:32:25 +1000 (AEST) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8C5ShlX027214 for ; Tue, 12 Sep 2017 01:32:23 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cx41vqrgk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 12 Sep 2017 01:32:23 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 12 Sep 2017 15:32:20 +1000 Received: from d23relay09.au.ibm.com (202.81.31.228) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 12 Sep 2017 15:32:18 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8C5V3en22151422 for ; Tue, 12 Sep 2017 15:31:03 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v8C5UsBJ027528 for ; Tue, 12 Sep 2017 15:30:54 +1000 Received: from hegdevasant.in.ibm.com ([9.109.222.138]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v8C5UpXu027390; Tue, 12 Sep 2017 15:30:53 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Tue, 12 Sep 2017 11:00:59 +0530 X-Mailer: git-send-email 2.9.3 X-TM-AS-MML: disable x-cbid: 17091205-0040-0000-0000-00000355C6C5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091205-0041-0000-0000-00000CD5F991 Message-Id: <20170912053059.18702-1-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-12_02:, , 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-1707230000 definitions=main-1709120078 Subject: [Skiboot] [PATCH v2] prd: Enable error logging via firmware_request interface 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: Daniel M Crowell MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" In P9 HBRT sends error logs to FSP via firmware_request interface. This patch adds support to parse error log and send it to FSP. CC: Jeremy Kerr CC: Daniel M Crowell Signed-off-by: Vasant Hegde Acked-by: Jeremy Kerr --- Changes in v2: Changes PRD_FW_MSG_TYPE_ERROR_LOG from 4 to 5 - Thanks Dan -Vasant core/hostservices.c | 2 +- hw/prd.c | 13 +++++++++++++ include/hostservices.h | 1 + include/prd-fw-msg.h | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/core/hostservices.c b/core/hostservices.c index d1f6fda..dd8cae2 100644 --- a/core/hostservices.c +++ b/core/hostservices.c @@ -329,7 +329,7 @@ static void hservice_start_elog_send(void) goto again; } -static int hservice_send_error_log(uint32_t plid, uint32_t dsize, void *data) +int hservice_send_error_log(uint32_t plid, uint32_t dsize, void *data) { struct hbrt_elog_ent *ent; void *abuf; diff --git a/hw/prd.c b/hw/prd.c index d076c19..4db92eb 100644 --- a/hw/prd.c +++ b/hw/prd.c @@ -23,6 +23,7 @@ #include #include #include +#include enum events { EVENT_ATTN = 1 << 0, @@ -375,6 +376,18 @@ static int prd_msg_handle_firmware_req(struct opal_prd_msg *msg) prd_msg->hdr.size = cpu_to_be16(sizeof(*prd_msg)); rc = 0; break; + case PRD_FW_MSG_TYPE_ERROR_LOG: + rc = hservice_send_error_log(fw_req->errorlog.plid, + fw_req->errorlog.size, + fw_req->errorlog.data); + /* Return generic response to HBRT */ + fw_resp->type = cpu_to_be64(PRD_FW_MSG_TYPE_RESP_GENERIC); + fw_resp->generic_resp.status = cpu_to_be64(rc); + prd_msg->fw_resp.len = cpu_to_be64(PRD_FW_MSG_BASE_SIZE + + sizeof(fw_resp->generic_resp)); + prd_msg->hdr.size = cpu_to_be16(sizeof(*prd_msg)); + rc = 0; + break; default: rc = -ENOSYS; } diff --git a/include/hostservices.h b/include/hostservices.h index d6bb3e3..62ef04b 100644 --- a/include/hostservices.h +++ b/include/hostservices.h @@ -38,5 +38,6 @@ void host_services_occ_base_setup(void); int find_master_and_slave_occ(uint64_t **master, uint64_t **slave, int *nr_masters, int *nr_slaves); +int hservice_send_error_log(uint32_t plid, uint32_t dsize, void *data); #endif /* __HOSTSERVICES_H */ diff --git a/include/prd-fw-msg.h b/include/prd-fw-msg.h index c00405d..19f355a 100644 --- a/include/prd-fw-msg.h +++ b/include/prd-fw-msg.h @@ -26,10 +26,24 @@ enum { PRD_FW_MSG_TYPE_REQ_NOP = 0, PRD_FW_MSG_TYPE_RESP_NOP = 1, + PRD_FW_MSG_TYPE_RESP_GENERIC = 2, + PRD_FW_MSG_TYPE_REQ_HCODE_UPDATE = 3, + PRD_FW_MSG_TYPE_HBRT_FSP = 4, + PRD_FW_MSG_TYPE_ERROR_LOG = 5, }; struct prd_fw_msg { __be64 type; + union { + struct { + __be64 status; + } generic_resp; + struct { + __be32 plid; + __be32 size; + char data[]; + } __packed errorlog; + }; }; #define PRD_FW_MSG_BASE_SIZE sizeof(__be64)