From patchwork Thu Jul 26 02:18:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 949421 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 41bbPZ0yKsz9ryl for ; Thu, 26 Jul 2018 12:18:58 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tjDkUwdt"; 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 41bbPY6bHDzF0f7 for ; Thu, 26 Jul 2018 12:18:57 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tjDkUwdt"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::243; helo=mail-pl0-x243.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tjDkUwdt"; dkim-atps=neutral Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41bbPS5GvKzDqnG for ; Thu, 26 Jul 2018 12:18:51 +1000 (AEST) Received: by mail-pl0-x243.google.com with SMTP id f6-v6so92942plo.1 for ; Wed, 25 Jul 2018 19:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=TKEIvxyHRZVPDFjfZWJIjp79U+uyT2ga9LIKRBwbcCY=; b=tjDkUwdt5Zknp1u/DManeze5iaJuvTwZgQDP2NV4Baadsj/VEU77vSp5RNajxuklMJ W1V4oC4sw0vWjPmZvxFWRN/ChUg+yb9uE9LtjdR43z5lTuwBzWzyw8SIBWz9do4qSt0I 3zVSK4HrCMSRmj0+MGj2LXvW7kHi/XjiMMJWbW9SjGSe3tBVap6Z6LF+55mddpOPKqYe Di+awyauSxxP8VOtItkpcn/bvGA0Ijz5GYcM5q9+W+PKP0nK8db2MPPOlUHbOt6eeChH SBGIG9Qpy8UW4EyaRjzHxIpb6W3GojyPsejb27YIL5HXF67IsU3MSgtua1zhFO0DlviX sOAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TKEIvxyHRZVPDFjfZWJIjp79U+uyT2ga9LIKRBwbcCY=; b=SPp/3tsmfllMnsLeFpVhwYAw0Eq1PH2JnYDPyLWhl5aBPOkiiOHMsRggVobhwxL/ad sIDG5xB/oER+pUgkm4ezQm2OlpryqYFUxJdeWbe6HpcjuUWefM6cPrha6h4DIDBd5juy pedDutV/y0bWH4gokI0P0+zhq8+P7LlhGMOelfY6SDTGws6WjNKRJfC1uAwzGi8KOPWs I/X2lrtOwjzul5hbh3KgtH0hZ4PLbEKWH4fzJUMw4HHGub1wxvaMYP8ASPyDnV/vg03p HBJiLBSY3LlNmzYuuyT2BJHAch0kLuvu0tcveG61yh5gSM0gvlYlRStj49VJ1ux4GW1Z UQ1A== X-Gm-Message-State: AOUpUlEQh3B7SGUTWkjpP845CxspVJy2oQFmwz+dVGEyMJNWvOUo7xm6 lTCv5lOPcdcKuwJMpkmEPqJnZfSX X-Google-Smtp-Source: AAOMgpd50dgZu5VHnfCZ4l4BqOsLcGO1fByNnDZCngUSePIIhDC93ePgn9oY0ex5kAelt8He9S/Ogw== X-Received: by 2002:a17:902:2f84:: with SMTP id t4-v6mr50300plb.87.1532571529086; Wed, 25 Jul 2018 19:18:49 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id l85-v6sm110914pfk.34.2018.07.25.19.18.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 19:18:48 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Thu, 26 Jul 2018 12:18:36 +1000 Message-Id: <20180726021838.20999-1-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 Subject: [Skiboot] [PATCH 1/3] hw/phb4: Print the PEs in the EEH dump in hex X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Linux always displays the PE number in hexidecimal while skiboot displays the PEST index (PE number) in decimal. This makes correlating errors between Skiboot and Linux more annoying than it should be so this patch makes Skiboot print the PEST number in hex. Signed-off-by: Oliver O'Halloran --- hw/phb4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/phb4.c b/hw/phb4.c index 0478d2dab341..ff0f3f5ad5b2 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -2048,7 +2048,7 @@ static void phb4_eeh_dump_regs(struct phb4 *p) for (i = 0; i < OPAL_PHB4_NUM_PEST_REGS; i++) { if (!s->pestA[i] && !s->pestB[i]) continue; - PHBERR(p, " PEST[%03d] = %016llx %016llx\n", + PHBERR(p, " PEST[%03x] = %016llx %016llx\n", i, s->pestA[i], s->pestB[i]); } free(s); From patchwork Thu Jul 26 02:18:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 949422 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 41bbPx6PHPz9ryl for ; Thu, 26 Jul 2018 12:19:17 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YSoFJ7sH"; 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 41bbPx4x1kzF0hg for ; Thu, 26 Jul 2018 12:19:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YSoFJ7sH"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YSoFJ7sH"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41bbPT2XzBzF0PZ for ; Thu, 26 Jul 2018 12:18:53 +1000 (AEST) Received: by mail-pg1-x541.google.com with SMTP id r5-v6so132982pgv.0 for ; Wed, 25 Jul 2018 19:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bz2MFYY3gbxy7HMlsrPidgozaMLwK17VmK6Vj+luHxQ=; b=YSoFJ7sHz2r3jZn8vGA/7tw4+KwAiRbrTc2VzXbjTZiOpmfzk8s4/BhP1TT4lI5NYK 8TAfsggQP+CsTrHC9bnN1iAqPyj+znjlnOxpplgbq5vSmN0C4L0x8uzabIppabhWQHDx nT05eSh75dLl10FG1nD/OLaUXEfxbB8UtpjvL26MK6sCNjuLnUaw+0BeKlN4LF/KRU7o OWZLH2vP/aRdd/RdFoHfqNXrEdBmoz2gF8TjagyYMkBxxztplLMxfPTfxFy+aqD3cO9o AhUPJqI8TZn6wkiUYfb1NFdwIGJy/lIedHIjEtyQeSb0CI63tErXVfZMJqYTg7JXVwMH o2Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bz2MFYY3gbxy7HMlsrPidgozaMLwK17VmK6Vj+luHxQ=; b=s9wL7W8XgcdclG4TuXOe5qJdvac+8EOdcXvgSg7WIKlIEmpuKqItYNB2607Ejqbfpn QGgb/Nw8cYEkqmrL8RM0wM1Vzf6LNDhCBJBnPdoXE71vSfRf6wfbcxh1z8cnrNV6AQ+p dUc+VmY0Ua9NtvQwM6K/jGBt6+E+tfeuyRakulxAXfxetkDCvoeWrt6xZYv/dVZFlMku lKSlnsUbxrnQMH+qRVES6+31r/mrlFVFCJJeIE/Mw8RFRHBPNCaJckrE+QeKX0aQXMmo z0FImT0m9WE5roPFSyIyS94ZwcOipaQaeKmToXycWoZjiyYAHg8rYGAN9bHTR36jhHel Z4ZQ== X-Gm-Message-State: AOUpUlGUPjMI/+Ja1QDwEsrq9ua84aYyfx/TUKcOH+HC8G4lkHGlboXI fturYcTcaLcelxL//DFBfyNqWgo3 X-Google-Smtp-Source: AAOMgpep2YjMWjbORk/NWjVuBJptzLQM1Gpi4Vjpa9HsK6ca5EvgRPBwkVPCt5C6mJlEiBfKncSpXg== X-Received: by 2002:a63:cf10:: with SMTP id j16-v6mr76076pgg.238.1532571530970; Wed, 25 Jul 2018 19:18:50 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id l85-v6sm110914pfk.34.2018.07.25.19.18.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 19:18:50 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Thu, 26 Jul 2018 12:18:37 +1000 Message-Id: <20180726021838.20999-2-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180726021838.20999-1-oohall@gmail.com> References: <20180726021838.20999-1-oohall@gmail.com> Subject: [Skiboot] [PATCH 2/3] hw/phb4: Add a helper to dump the PELT-V X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The "Partitionable Endpoint Lookup Table (Vector)" is used by the PHB when processing EEH events. The PELT-V defines which PEs should be additionally frozen in the event of an error being flagged on a given PE. Knowing the state of the PELT-V is sometimes useful for debugging PHB issues so this patch adds a helper to dump it. Signed-off-by: Oliver O'Halloran --- hw/phb4.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/hw/phb4.c b/hw/phb4.c index ff0f3f5ad5b2..965f3b5af8af 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -1942,6 +1942,46 @@ static void phb4_read_phb_status(struct phb4 *p, } } +static void __unused phb4_dump_peltv(struct phb4 *p) +{ + int stride = p->max_num_pes / 64; + uint64_t *tbl = (void *) p->tbl_peltv; + unsigned int pe; + + PHBERR(p, "PELT-V: base addr: %p size: %llx (%d PEs, stride = %d)\n", + tbl, p->tbl_peltv_size, p->max_num_pes, stride); + + for (pe = 0; pe < p->max_num_pes; pe++) { + unsigned int i, j; + uint64_t sum = 0; + + i = pe * stride; + + /* + * Only print an entry if there's bits set in the PE's + * PELT-V entry. There's a few hundred possible PEs and + * generally only a handful will be in use. + */ + + for (j = 0; j < stride; j++) + sum |= tbl[i + j]; + if (!sum) + continue; /* unused PE, skip it */ + + if (p->max_num_pes == 512) { + PHBERR(p, "PELT-V[%03x] = " + "%016llx %016llx %016llx %016llx" + "%016llx %016llx %016llx %016llx\n", pe, + tbl[i + 0], tbl[i + 1], tbl[i + 2], tbl[i + 3], + tbl[i + 4], tbl[i + 5], tbl[i + 6], tbl[i + 7]); + } else if (p->max_num_pes == 256) { + PHBERR(p, "PELT-V[%03x] = " + "%016llx %016llx %016llx %016llx\n", pe, + tbl[i + 0], tbl[i + 1], tbl[i + 2], tbl[i + 3]); + } + } +} + static void phb4_eeh_dump_regs(struct phb4 *p) { struct OpalIoPhb4ErrorData *s; From patchwork Thu Jul 26 02:18:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 949423 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 41bbQH098Kz9ryl for ; Thu, 26 Jul 2018 12:19:35 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iyaxTzTY"; 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 41bbQG5bxKzF0PZ for ; Thu, 26 Jul 2018 12:19:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iyaxTzTY"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::241; helo=mail-pl0-x241.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iyaxTzTY"; dkim-atps=neutral Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41bbPW2grHzDqnG for ; Thu, 26 Jul 2018 12:18:55 +1000 (AEST) Received: by mail-pl0-x241.google.com with SMTP id w3-v6so90747plq.2 for ; Wed, 25 Jul 2018 19:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XwrWp/wseOETgVrYivv5Pdp85QRX+b1yc4b2R+Nekqc=; b=iyaxTzTYcZLWkPtyNQ2ivVY5rinL47G+sQiaa+HIZyMWNy14HPJAfnTYfr7d4B0ZaV 7c8VEsd4U2tel40Zgd0G7ZAsQR/nASu4F+dziDVJV0bOi1doxWSy8LhRqB9B+zl6ldlx ormS50deQe8kAgdQdolhMFzaPJZJZaqudWHGd7uYLYXGaYtlU/bnI9TLL/ChM2FwAH9B M9bQG0nJm4u7AukzzENRjuGJ5Ja/dwDgiFIVvGSLHBelcl5PZmBV2bzuHMzAI7XprDWK M8kvfk/p9X4LxGBmVNjp5uSQcc0Hg3g3Xh/F/jbymJzy5fOKDe0+uqYwmaeMwrQ+QOW0 AARg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XwrWp/wseOETgVrYivv5Pdp85QRX+b1yc4b2R+Nekqc=; b=QKwnPHG6XO4YMGyffh8u864Ivw7D0Wrb08FVGiKNbskpPfxeIFzgRKXscoZjvin+AH Z7CGK3lXSZyPCjL47QGFVaaX1oFPqdtDh18A7XHZNhbmuMzYTfDQD64DwGzT0BLEoLpl a7khzDx7Vmcsal0PMBxO+Rsmai6Zujgdp7JHNNSNaEU7d/IV2P0U1X/hRN/qgZKLHJk7 cZgfoeTtaqFJtr0WuV4Kek1Z7a0SIk4fzOUws5sUlue2rXz+CZP/eBIPYzlLTg9NcDRY QOupPgHfmlZDdkUz0EHNnNFT/wsIBJ8Gg5qYokArXKuOJY7VORCbTaOIGN0dtlKrc8x+ wqDQ== X-Gm-Message-State: AOUpUlG32QrMpunuklkP4nKDjkRG+pq0NKz5yqWWdJKAO4izQfU1lcf2 n0VbC+S3RKfcVo4ljvXCcPtrTjtG X-Google-Smtp-Source: AAOMgpdnJaxM23R+42RB76eTRAqiDqkV/NjHSC/5V+iziQcdxRpQNlZR3Cbreiv/jr8uPtcd8OvlJA== X-Received: by 2002:a17:902:900b:: with SMTP id a11-v6mr45310plp.143.1532571532932; Wed, 25 Jul 2018 19:18:52 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id l85-v6sm110914pfk.34.2018.07.25.19.18.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 19:18:52 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Thu, 26 Jul 2018 12:18:38 +1000 Message-Id: <20180726021838.20999-3-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180726021838.20999-1-oohall@gmail.com> References: <20180726021838.20999-1-oohall@gmail.com> Subject: [Skiboot] [PATCH 3/3] hw/phb4: Add helpers to dump the IODA tables X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The IODA tables are stored inside the PHB itself rather than in memory. This makes accessing them slightly tedious, but the process is more or less the same for every table. This patch adds a helper function for dumping the contents of the IODA tables to help with debugging PHB issues. Signed-off-by: Oliver O'Halloran --- hw/phb4.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/hw/phb4.c b/hw/phb4.c index 965f3b5af8af..72c9b529dccc 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -1982,6 +1982,95 @@ static void __unused phb4_dump_peltv(struct phb4 *p) } } +static void __unused phb4_dump_ioda_table(struct phb4 *p, int table) +{ + const char *name; + int entries, i; + + switch (table) { + case IODA3_TBL_LIST: + name = "LIST"; + entries = 8; + break; + case IODA3_TBL_MIST: + name = "MIST"; + entries = 1024; + break; + case IODA3_TBL_RCAM: + name = "RCAM"; + entries = 128; + break; + case IODA3_TBL_MRT: + name = "MRT"; + entries = 16; + break; + case IODA3_TBL_PESTA: + name = "PESTA"; + entries = 512; + break; + case IODA3_TBL_PESTB: + name = "PESTB"; + entries = 512; + break; + case IODA3_TBL_TVT: + name = "TVT"; + entries = 512; + break; + case IODA3_TBL_TCAM: + name = "TCAM"; + entries = 1024; + break; + case IODA3_TBL_TDR: + name = "TDR"; + entries = 1024; + break; + case IODA3_TBL_MBT: /* special case, see below */ + name = "MBT"; + entries = 64; + break; + case IODA3_TBL_MDT: + name = "MDT"; + entries = 512; + break; + case IODA3_TBL_PEEV: + name = "PEEV"; + entries = 8; + break; + default: + PHBERR(p, "Invalid IODA table %d!\n", table); + return; + } + + PHBERR(p, "Start %s dump (only non-zero entries are printed):\n", name); + + phb4_ioda_sel(p, table, 0, true); + + /* + * Each entry in the MBT is 16 bytes. Every other table has 8 byte + * entries so we special case the MDT to keep the output readable. + */ + if (table == IODA3_TBL_MBT) { + for (i = 0; i < 32; i++) { + uint64_t v1 = phb4_read_reg_asb(p, PHB_IODA_DATA0); + uint64_t v2 = phb4_read_reg_asb(p, PHB_IODA_DATA0); + + if (!v1 && !v2) + continue; + PHBERR(p, "MBT[%03x] = %016llx %016llx\n", i, v1, v2); + } + } else { + for (i = 0; i < entries; i++) { + uint64_t v = phb4_read_reg_asb(p, PHB_IODA_DATA0); + + if (!v) + continue; + PHBERR(p, "%s[%03x] = %016llx\n", name, i, v); + } + } + + PHBERR(p, "End %s dump\n", name); +} + static void phb4_eeh_dump_regs(struct phb4 *p) { struct OpalIoPhb4ErrorData *s;