From patchwork Fri Dec 11 02:13:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1414688 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CsZ945kZBz9sWQ for ; Fri, 11 Dec 2020 13:14:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=vlhJFDRp; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CsZ943sBhzDqlV for ; Fri, 11 Dec 2020 13:14:16 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CsZ8x35PTzDqCG for ; Fri, 11 Dec 2020 13:14:09 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=vlhJFDRp; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4CsZ8w69Bsz9sWQ; Fri, 11 Dec 2020 13:14:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1607652849; bh=QsPzCir+MWBx6SfC7bdgMpd1Da2froRbfP59xwT5iSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vlhJFDRppCDD8MaUboJm2mCF2I33sdk5NfewqZqo4ddRnxFKufCL7w/hnVZPdKXHg sVmE7svsGLgso+dqnDPaGHIlOy+HXO/GEvrNhid6xkwM8yHOqB8Keeg6JBPepXInBQ ud+9q4HbafYDSr4klqTikJMCnhAj8VoEVzncLug0A7MctNU6WOLdZkVkrNhKgK1+XZ uj906rTMXajqKoQWR/e9CgUXFaecqqfJF0w5vbmgWxL/L86xuZXG06iojGk0Nlt9MR wMI4WiOKMcCTH5J4Tya0NjQYj2P3VGesD3CkUNfn1P0DuJCH1CUciZjwTMLtJJq0w3 /0l1gwTm5WfXA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 11 Dec 2020 13:13:52 +1100 Message-Id: <20201211021356.414095-2-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201211021356.414095-1-amitay@ozlabs.org> References: <20201211021356.414095-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 1/5] libsbefifo: Fix indentation for mpipl commands X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- libsbefifo/sbefifo_private.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libsbefifo/sbefifo_private.h b/libsbefifo/sbefifo_private.h index e49f673..4dd1c25 100644 --- a/libsbefifo/sbefifo_private.h +++ b/libsbefifo/sbefifo_private.h @@ -61,10 +61,10 @@ #define SBEFIFO_CMD_QUIESCE 0x03 #define SBEFIFO_CMD_CLASS_MPIPL 0xA900 -#define SBEFIFO_CMD_ENTER_MPIPL 0x01 -#define SBEFIFO_CMD_CONTINUE_MPIPL 0x02 -#define SBEFIFO_CMD_STOP_CLOCKS 0x03 -#define SBEFIFO_CMD_GET_TI_INFO 0x04 +#define SBEFIFO_CMD_ENTER_MPIPL 0x01 +#define SBEFIFO_CMD_CONTINUE_MPIPL 0x02 +#define SBEFIFO_CMD_STOP_CLOCKS 0x03 +#define SBEFIFO_CMD_GET_TI_INFO 0x04 struct sbefifo_context { int fd; From patchwork Fri Dec 11 02:13:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1414690 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CsZ9J5Pcyz9sWQ for ; Fri, 11 Dec 2020 13:14:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=fi/Vpbkn; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CsZ9G5KG6zDqnl for ; Fri, 11 Dec 2020 13:14:26 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CsZ8y5g6KzDqCG for ; Fri, 11 Dec 2020 13:14:10 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=fi/Vpbkn; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4CsZ8x3SJjz9sWV; Fri, 11 Dec 2020 13:14:09 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1607652849; bh=1/YEK7MbmGfVoRUGQl6bheXbpmNWXcGR6sDMXNeLwS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fi/VpbknzNxKskrjzbXWgQOX6BIMztT7cq6wduPUCHg5RXz9BGtH76zjQ0XdZNHjs Dtm4txyBD/Uk2Euw36fdh/SwRWSr0lX37cldOAfSyGIfYQY48ndgVPc77NQFtFT6m9 SneGTCatmrTjxWj7rrvhtunCPctc+jwonFKE3JQiOrCR07oHGNPOmsxGEFT5uMbyFz QnzdnvLZIn5YtL4GxZRp0Da+9upzKR0NHXLZybBC+EdpJPIcKrW1DRM/OaRdAKB90e ttHD+5EYL5rhdX1VbS1AXtS7YzPF5TsZ6xnEiyN/ASrrtbwvRn7/rPSxCH8UWk2BYq jsQv/SuJ7VXgA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 11 Dec 2020 13:13:53 +1100 Message-Id: <20201211021356.414095-3-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201211021356.414095-1-amitay@ozlabs.org> References: <20201211021356.414095-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 2/5] libsbefifo: Add new secondary error codes X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- libsbefifo/libsbefifo.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libsbefifo/libsbefifo.h b/libsbefifo/libsbefifo.h index 4d6b016..763051a 100644 --- a/libsbefifo/libsbefifo.h +++ b/libsbefifo/libsbefifo.h @@ -87,6 +87,12 @@ #define SBEFIFO_SEC_SUSPEND_IO_FAIL 0x0035 #define SBEFIFO_SEC_ENTER_MPIPL_FAIL2 0x0036 #define SBEFIFO_SEC_STOP_CLOCK_FAIL2 0x0037 +#define SBEFIFO_SEC_OCMB_SCOM_FAIL 0x0038 +#define SBEFIFO_SEC_GET_DUMP_FAIL 0x0039 +#define SBEFIFO_SEC_INVALID_DUMP_TYPE 0x0040 +#define SBEFIFO_SEC_INVALID_OCMB_INST 0x0041 +#define SBEFIFO_SEC_CHECKSTOP_FAIL 0x0042 +#define SBEFIFO_SEC_GET_DUMP_STREAM_FAIL 0x0043 #define SBEFIFO_TARGET_TYPE_PROC 0x0000 #define SBEFIFO_TARGET_TYPE_PERV 0x0001 From patchwork Fri Dec 11 02:13:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1414691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CsZ9N172Dz9sWQ for ; Fri, 11 Dec 2020 13:14:32 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=PR4BvD4l; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CsZ9M6z39zDqCG for ; Fri, 11 Dec 2020 13:14:31 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CsZ8y5g5xzDq8v for ; Fri, 11 Dec 2020 13:14:10 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=PR4BvD4l; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4CsZ8y1X5Nz9sWY; Fri, 11 Dec 2020 13:14:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1607652850; bh=eL5dn0WFffVi7fB7UR7wmS9DDTZTjzY72tMF8FmsiXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PR4BvD4lDWVaOVIgNBOOzhduy+63+7aPvKo3KsaPeaCpSrs+R1C5Qr2Or8FjTXVFS BCXnPmsux0gJoahnsb1jw+VEgUWG1HwxIPVZHnsZVkDuZ3N9L9NhdnW+f+wValhbNS ejgk2lBHkvpSUEcAFE87idNO+/+Im8GPsBciAY0EgCKOmaM/0dLeuJAVN5Gpg3Q0GQ CLWmd6lC+o/s4kFUv4rbDlcAYvQUDT8WY9MJrObhOi6SDmWYw+xZ0ctSDZ2wTNiMeb myKpSstWw04i4mJgsZMJS9bvpCXOvviuhqkswpI2bEJ2Ug5iKCWE5YITefkFYcecDs cCDBRvyIe1TiQ== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 11 Dec 2020 13:13:54 +1100 Message-Id: <20201211021356.414095-4-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201211021356.414095-1-amitay@ozlabs.org> References: <20201211021356.414095-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 3/5] libsbefifo: Implement get dump chip-op X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- Makefile.am | 1 + libsbefifo/cmd_dump.c | 90 ++++++++++++++++++++++++++++++++++++ libsbefifo/libsbefifo.h | 11 +++++ libsbefifo/sbefifo_private.h | 3 ++ 4 files changed, 105 insertions(+) create mode 100644 libsbefifo/cmd_dump.c diff --git a/Makefile.am b/Makefile.am index fc7e2f6..5ae4cba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -142,6 +142,7 @@ libcronus_la_SOURCES = \ libsbefifo_la_SOURCES = \ libsbefifo/cmd_array.c \ libsbefifo/cmd_control.c \ + libsbefifo/cmd_dump.c \ libsbefifo/cmd_generic.c \ libsbefifo/cmd_instruction.c \ libsbefifo/cmd_memory.c \ diff --git a/libsbefifo/cmd_dump.c b/libsbefifo/cmd_dump.c new file mode 100644 index 0000000..b4e880c --- /dev/null +++ b/libsbefifo/cmd_dump.c @@ -0,0 +1,90 @@ +/* Copyright 2020 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +#include "libsbefifo.h" +#include "sbefifo_private.h" + +static int sbefifo_get_dump_push(uint8_t type, uint8_t clock, uint8_t **buf, uint32_t *buflen) +{ + uint32_t *msg; + uint32_t nwords, cmd; + uint32_t flags; + + nwords = 3; + *buflen = nwords * sizeof(uint32_t); + msg = malloc(*buflen); + if (!msg) + return ENOMEM; + + cmd = SBEFIFO_CMD_CLASS_DUMP | SBEFIFO_CMD_GET_DUMP; + + flags = ((uint32_t)(clock & 0x3) << 8) | + ((uint32_t)(type & 0xf)); + + msg[0] = htobe32(nwords); + msg[1] = htobe32(cmd); + msg[2] = htobe32(flags); + + *buf = (uint8_t *)msg; + return 0; +} + +static int sbefifo_get_dump_pull(uint8_t *buf, uint32_t buflen, uint8_t **data, uint32_t *data_len) +{ + if (buflen > 0) { + *data = malloc(buflen); + if (! *data) + return ENOMEM; + + memcpy(*data, buf, buflen); + *data_len = buflen; + } else { + *data = NULL; + *data_len = 0; + } + + return 0; +} + +int sbefifo_get_dump(struct sbefifo_context *sctx, uint8_t type, uint8_t clock, uint8_t **data, uint32_t *data_len) +{ + uint8_t *msg, *out; + uint32_t msg_len, out_len; + int rc; + + rc = sbefifo_get_dump_push(type, clock, &msg, &msg_len); + if (rc) + return rc; + + /* dump size can be as large as 64MB */ + out_len = 64 * 1024 * 1024; + rc = sbefifo_operation(sctx, msg, msg_len, &out, &out_len); + free(msg); + if (rc) + return rc; + + rc = sbefifo_get_dump_pull(out, out_len, data, data_len); + if (out) + free(out); + + return rc; +} diff --git a/libsbefifo/libsbefifo.h b/libsbefifo/libsbefifo.h index 763051a..a039eea 100644 --- a/libsbefifo/libsbefifo.h +++ b/libsbefifo/libsbefifo.h @@ -191,4 +191,15 @@ int sbefifo_mpipl_continue(struct sbefifo_context *sctx); int sbefifo_mpipl_stopclocks(struct sbefifo_context *sctx, uint16_t target_type, uint8_t chiplet_id); int sbefifo_mpipl_get_ti_info(struct sbefifo_context *sctx, uint8_t **data, uint32_t *data_len); +#define SBEFIFO_DUMP_TYPE_SCS 0x01 +#define SBEFIFO_DUMP_TYPE_MPIPL 0x02 +#define SBEFIFO_DUMP_TYPE_PERF 0x03 +#define SBEFIFO_DUMP_TYPE_CCS 0x04 +#define SBEFIFO_DUMP_TYPE_HB 0x05 + +#define SBEFIFO_DUMP_CLOCK_ON 0x01 +#define SBEFIFO_DUMP_CLOCK_OFF 0x02 + +int sbefifo_get_dump(struct sbefifo_context *sctx, uint8_t type, uint8_t clock, uint8_t **data, uint32_t *data_len); + #endif /* __LIBSBEFIFO_H__ */ diff --git a/libsbefifo/sbefifo_private.h b/libsbefifo/sbefifo_private.h index 4dd1c25..e9c487a 100644 --- a/libsbefifo/sbefifo_private.h +++ b/libsbefifo/sbefifo_private.h @@ -66,6 +66,9 @@ #define SBEFIFO_CMD_STOP_CLOCKS 0x03 #define SBEFIFO_CMD_GET_TI_INFO 0x04 +#define SBEFIFO_CMD_CLASS_DUMP 0xAA00 +#define SBEFIFO_CMD_GET_DUMP 0x01 + struct sbefifo_context { int fd; int proc; From patchwork Fri Dec 11 02:13:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1414692 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CsZ9R1Yshz9sWQ for ; Fri, 11 Dec 2020 13:14:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=CeVhpCbx; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CsZ9Q3QlmzDqnp for ; Fri, 11 Dec 2020 13:14:34 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CsZ8z1H9WzDqCG for ; Fri, 11 Dec 2020 13:14:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=CeVhpCbx; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4CsZ8y5kKfz9sVs; Fri, 11 Dec 2020 13:14:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1607652850; bh=QEEtwdqCf59btmegyvz9XoWSnobVoXcfTD6LC9XSP8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CeVhpCbx0vq49j5UrYDvxKInxdUPxLZajJwPa0mvRK6JgpdK92T5PoHWefJfns3D1 NXUJ/uF244Vuk21kpN6B4vhkiLmH0tm5nKdLfSNWYCLb0hNBI1zublTh2TpsxqeA2p cs4eTPxtHUOaHd8uRogIjC57PWT+MA+kkueI6PZcjPOjOiOp5R+pogEWlFyxJYUpKW AmNjXUxeN574Wh7DTYAkSAYW06nkpvgNsxGmpOGcjatxCTDbwOmDpJAoYTBA1gMKf9 ekhUoX/N1DtBoxQdH8/XeaYEmF64Neu0ICFHIqoC53SsSA0oWUXWRTdPZ40ltod2py DhPfz+q1uICug== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 11 Dec 2020 13:13:55 +1100 Message-Id: <20201211021356.414095-5-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201211021356.414095-1-amitay@ozlabs.org> References: <20201211021356.414095-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 4/5] libpdbg: Add dump() method to chipop target X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- libpdbg/hwunit.h | 1 + libpdbg/sbefifo.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/libpdbg/hwunit.h b/libpdbg/hwunit.h index 22b3b58..a3e3a41 100644 --- a/libpdbg/hwunit.h +++ b/libpdbg/hwunit.h @@ -77,6 +77,7 @@ struct chipop { int (*mpipl_enter)(struct chipop *); int (*mpipl_continue)(struct chipop *); int (*mpipl_get_ti_info)(struct chipop *, uint8_t **, uint32_t *); + int (*dump)(struct chipop *, uint8_t, uint8_t, uint8_t **, uint32_t *); }; #define target_to_chipop(x) container_of(x, struct chipop, target) diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c index cfc8488..e2a98cf 100644 --- a/libpdbg/sbefifo.c +++ b/libpdbg/sbefifo.c @@ -205,6 +205,14 @@ static int sbefifo_op_mpipl_get_ti_info(struct chipop *chipop, uint8_t **data, u return sbefifo_mpipl_get_ti_info(sctx, data, data_len); } +static int sbefifo_op_dump(struct chipop *chipop, uint8_t type, uint8_t clock, uint8_t **data, uint32_t *data_len) +{ + struct sbefifo *sbefifo = target_to_sbefifo(chipop->target.parent); + struct sbefifo_context *sctx = sbefifo->get_sbefifo_context(sbefifo); + + return sbefifo_get_dump(sctx, type, clock, data, data_len); +} + static struct sbefifo *pib_to_sbefifo(struct pdbg_target *pib) { struct pdbg_target *target; @@ -800,6 +808,7 @@ static struct chipop sbefifo_chipop = { .mpipl_enter = sbefifo_op_mpipl_enter, .mpipl_continue = sbefifo_op_mpipl_continue, .mpipl_get_ti_info = sbefifo_op_mpipl_get_ti_info, + .dump = sbefifo_op_dump, }; DECLARE_HW_UNIT(sbefifo_chipop); From patchwork Fri Dec 11 02:13:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1414693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CsZ9W4QXNz9sVs for ; Fri, 11 Dec 2020 13:14:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=kBuix9Bu; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CsZ9W3GbgzDqmC for ; Fri, 11 Dec 2020 13:14:39 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CsZ8z5jMDzDq8v for ; Fri, 11 Dec 2020 13:14:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=kBuix9Bu; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4CsZ8z1kCpz9sWQ; Fri, 11 Dec 2020 13:14:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1607652851; bh=Y+0mQmouu35mdVemU2Sb9gz4FGqpO4reh3YlGJvfvtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kBuix9BuRNJrRei04ce2dZq5F1YwV7+twmBbNtkooyq+kUHI3waNLkXRspMctrLZu hA5lzOzjgWdQBQqA+t8CStxlzzttcQ33OyIDlJzPAtxOZOkrcDrgV9PhUl1Xal2Q+e duPhpNx5Fu+9Lw/xG40XcT24aIM/secdZ+LHsXBjxwwRJpe2rq/i5NYUoBvd/vf6vs R+mdWKAHbDi0HwbTbRwoJBZ5yufuxiTAm7A737WCLk432u9vxweuhaLNVtqcMwVcvq VJYDs4PfAbewLUWrVCl0D/AVqrwTneZkzpIs7R5yqGRZuO0dnY//fsxK2yywSuk8pB ScTR32SzI8SsA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 11 Dec 2020 13:13:56 +1100 Message-Id: <20201211021356.414095-6-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201211021356.414095-1-amitay@ozlabs.org> References: <20201211021356.414095-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 5/5] libpdbg: Add sbe_dump() api to collect sbe dump data X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- libpdbg/libpdbg.h | 16 ++++++++++++++++ libpdbg/target.c | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h index 7b3b760..93c9e8b 100644 --- a/libpdbg/libpdbg.h +++ b/libpdbg/libpdbg.h @@ -1347,6 +1347,22 @@ int sbe_mpipl_continue(struct pdbg_target *target); */ int sbe_mpipl_get_ti_info(struct pdbg_target *target, uint8_t **data, uint32_t *data_len); +/** + * @brief Get sbe dump + * + * The dump data must be freed by caller. It is allocated using malloc() and + * must be freed using free(). + * + * @param[in] target pib target to operate on + * @param[in] type Type of dump + * @param[in] clock Clock on or off + * @param[out] data Dump information + * @param[out] data_len length of the data + * + * @return 0 on success, -1 on failure + */ +int sbe_dump(struct pdbg_target *target, uint8_t type, uint8_t clock, uint8_t **data, uint32_t *data_len); + /** * @brief Read a OCMB SCOM register * diff --git a/libpdbg/target.c b/libpdbg/target.c index 89006d0..f0cf3dc 100644 --- a/libpdbg/target.c +++ b/libpdbg/target.c @@ -455,6 +455,22 @@ int sbe_mpipl_get_ti_info(struct pdbg_target *target, uint8_t **data, uint32_t * return chipop->mpipl_get_ti_info(chipop, data, data_len); } +int sbe_dump(struct pdbg_target *target, uint8_t type, uint8_t clock, uint8_t **data, uint32_t *data_len) +{ + struct chipop *chipop; + + chipop = pib_to_chipop(target); + if (!chipop) + return -1; + + if (!chipop->dump) { + PR_ERROR("dump() not implemented for the target\n"); + return -1; + } + + return chipop->dump(chipop, type, clock, data, data_len); +} + int ocmb_getscom(struct pdbg_target *target, uint64_t addr, uint64_t *val) { struct ocmb *ocmb;