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);