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;