From patchwork Wed Mar 4 06:16:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1248843 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 48XNtn4Zbfz9sSG for ; Wed, 4 Mar 2020 17:16:33 +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=V6CLk0xH; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48XNtn2nntzDqW9 for ; Wed, 4 Mar 2020 17:16:33 +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 48XNtf1gsfzDqVK for ; Wed, 4 Mar 2020 17:16:26 +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=V6CLk0xH; 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 48XNtd3blfz9sQt; Wed, 4 Mar 2020 17:16:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1583302585; bh=qoL9ovQbBVu7zK55ElQfXCp6dWprOBcNXCzevs0XEwU=; h=From:To:Cc:Subject:Date:From; b=V6CLk0xHfoiO2iS1txNDRj4P3RwY94drhJnu1wIUak10xRb3K1TByhSIorkkgsRH1 Vi8wfm5nEwK3NcG21HspN3saiHH4oFFW/nU61V/R0yiN9hSn1kxR39UzpaIF9aLOXw rSgPeN5grQxSuT2Uybl6tgaIEJI0+A7PbHHbgdzuupVbQ/BiMKJCJYsQGZzPMq/DSM 1rO3RwUeYy8QRbmKnUtlbIrdF0DY+VOSb+eNf/yWRiPzbVEcxCW8NVtphrc3kzkaCe z0nzyhHuNcXPD7hIcNDBDlZq+jeExTseckPcbZGnrdjaDKxNPQQo5jxKIQURGbTMVk 6y4MY2hFdWxag== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Wed, 4 Mar 2020 17:16:18 +1100 Message-Id: <20200304061619.202979-1-amitay@ozlabs.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [Pdbg] [PATCH 1/2] libpdbg: Add MPIPL related chip-ops 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 , Dhruvaraj Subhashchandran Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" From: Dhruvaraj Subhashchandran Signed-off-by: Dhruvaraj Subhashchandran Reviewed-by: Amitay Isaacs --- libpdbg/hwunit.h | 2 ++ libpdbg/sbefifo.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/libpdbg/hwunit.h b/libpdbg/hwunit.h index 2de5972..dae6b94 100644 --- a/libpdbg/hwunit.h +++ b/libpdbg/hwunit.h @@ -69,6 +69,8 @@ struct chipop { struct pdbg_target target; uint32_t (*ffdc_get)(struct chipop *, const uint8_t **, uint32_t *); int (*istep)(struct chipop *, uint32_t major, uint32_t minor); + int (*mpipl_enter)(struct chipop *); + int (*mpipl_continue)(struct chipop *); int (*thread_start)(struct chipop *, uint32_t core_id, uint32_t thread_id); int (*thread_stop)(struct chipop *, uint32_t core_id, uint32_t thread_id); int (*thread_step)(struct chipop *, uint32_t core_id, uint32_t thread_id); diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c index 7b9a57a..cb2c6a1 100644 --- a/libpdbg/sbefifo.c +++ b/libpdbg/sbefifo.c @@ -179,6 +179,22 @@ static int sbefifo_op_istep(struct chipop *chipop, return sbefifo_istep_execute(sctx, major & 0xff, minor & 0xff); } +static int sbefifo_op_mpipl_continue(struct chipop *chipop) +{ + struct sbefifo *sbefifo = target_to_sbefifo(chipop->target.parent); + struct sbefifo_context *sctx = sbefifo->get_sbefifo_context(sbefifo); + + return sbefifo_mpipl_continue(sctx); +} + +static int sbefifo_op_mpipl_enter(struct chipop *chipop) +{ + struct sbefifo *sbefifo = target_to_sbefifo(chipop->target.parent); + struct sbefifo_context *sctx = sbefifo->get_sbefifo_context(sbefifo); + + return sbefifo_mpipl_enter(sctx); +} + static int sbefifo_op_control(struct chipop *chipop, uint32_t core_id, uint32_t thread_id, uint32_t oper) @@ -281,6 +297,8 @@ static struct chipop sbefifo_chipop = { }, .ffdc_get = sbefifo_op_ffdc_get, .istep = sbefifo_op_istep, + .mpipl_enter = sbefifo_op_mpipl_enter, + .mpipl_continue = sbefifo_op_mpipl_continue, .thread_start = sbefifo_op_thread_start, .thread_stop = sbefifo_op_thread_stop, .thread_step = sbefifo_op_thread_step, From patchwork Wed Mar 4 06:16:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1248842 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 48XNtk6WBMz9sSG for ; Wed, 4 Mar 2020 17:16:30 +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=XiA3jdzw; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48XNtk5PvlzDqXw for ; Wed, 4 Mar 2020 17:16:30 +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) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48XNtf1cG4zDqQZ for ; Wed, 4 Mar 2020 17:16:26 +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=XiA3jdzw; 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 48XNtd5BKzz9sSG; Wed, 4 Mar 2020 17:16:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1583302585; bh=ZiR1Q0Zl4NsS/N8V2A87bON8W2JWLFsikfkz+cWPjGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XiA3jdzwIgd88mINVDqxzJRTDjrzzl4rBAdnkOQ3vuuAJYphN6zRKKowCND6wJlaa SeYYg5mwd/cgHyFKLOfeKKsfir+fv72t/vTEUme9Ig6TQoschVsDBFverOfmKBjIo0 7mXcRmW8gP4ve4xyEux6xZCeiWrT8foPhnbA0R3AplCypvhPbXxHwfxUmaW157JKH8 VItV9+pyjmmSg2hQ7Nv5gfqaE90Ib9SoZ8lZaAFVqUiC3+jyzsv6LLNkXGOQvddtkU nquLPp18sh31cP+XecYXQsOzCJjg7wm6MhqsZN/tdTG6D5bQ5Dyx7bsgQAHcep8TBm PcKQobHx42VVA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Wed, 4 Mar 2020 17:16:19 +1100 Message-Id: <20200304061619.202979-2-amitay@ozlabs.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200304061619.202979-1-amitay@ozlabs.org> References: <20200304061619.202979-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 2/2] libpdbg: Add apis for mpipl related chip-ops 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 , Dhruvaraj Subhashchandran Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" From: Dhruvaraj Subhashchandran Signed-off-by: Dhruvaraj Subhashchandran Reviewed-by: Amitay Isaacs --- libpdbg/libpdbg.h | 18 ++++++++++++++++++ libpdbg/target.c | 22 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h index 1fc7ef4..fbc32b6 100644 --- a/libpdbg/libpdbg.h +++ b/libpdbg/libpdbg.h @@ -1161,6 +1161,24 @@ int sbe_istep(struct pdbg_target *target, uint32_t major, uint32_t minor); */ uint32_t sbe_ffdc_get(struct pdbg_target *target, const uint8_t **ffdc, uint32_t *ffdc_len); +/** + * @brief Execute enter mpipl on the pib + * + * @param[in] target pib target to operate on + * + * @return 0 on success, -1 on failure + */ +int sbe_mpipl_enter(struct pdbg_target *target); + +/** + * @brief Execute continue mpipl on the pib + * + * @param[in] target pib target to operate on + * + * @return 0 on success, -1 on failure + */ +int sbe_mpipl_continue(struct pdbg_target *target); + /** * @brief Type for specifying a progress callback for long running * operations diff --git a/libpdbg/target.c b/libpdbg/target.c index 5906ce7..1b54660 100644 --- a/libpdbg/target.c +++ b/libpdbg/target.c @@ -308,6 +308,28 @@ int sbe_istep(struct pdbg_target *target, uint32_t major, uint32_t minor) return chipop->istep(chipop, major, minor); } +int sbe_mpipl_enter(struct pdbg_target *target) +{ + struct chipop *chipop; + + chipop = pib_to_chipop(target); + if (!chipop) + return -1; + + return chipop->mpipl_enter(chipop); +} + +int sbe_mpipl_continue(struct pdbg_target *target) +{ + struct chipop *chipop; + + chipop = pib_to_chipop(target); + if (!chipop) + return -1; + + return chipop->mpipl_continue(chipop); +} + uint32_t sbe_ffdc_get(struct pdbg_target *target, const uint8_t **ffdc, uint32_t *ffdc_len) { struct chipop *chipop;