From patchwork Mon Jul 19 13:19:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 1507024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=DgJt6uLK; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 4GT2YW124Wz9sXG for ; Mon, 19 Jul 2021 23:21:35 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GT2YW01R8z3bTr for ; Mon, 19 Jul 2021 23:21:35 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=DgJt6uLK; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=DgJt6uLK; dkim-atps=neutral Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GT2Xr3KJtz30FK for ; Mon, 19 Jul 2021 23:21:00 +1000 (AEST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16JD4pVI142473 for ; Mon, 19 Jul 2021 09:20:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=WI00/kH4o1OMtLhaLu/SuBrydWrurO/x8BggBVd0who=; b=DgJt6uLK/JVs5AWlAwMe2dv/5R9v9AkTVXu1eK9j85SRRfkpSZ20b+HGG/SFmhOO7WSt +e2I9eMT8hGHIQuJoYriMODMSzMMS6Bg63Rw6FHTLvBNpySQoX0eEFcS9gJYNOsLfKSm VYzUUKl+NmB+aiPF5JbuCx55X9KF+LBEKOoc/axKk6jxzYjxWq7+XGoKKaHkS+9iBkms INAMFZFnO/Zq6qRJgeKvKz12ocdjU4RHg8puK7rmX5TGnTiA5JltCeJkuCjeStHKTxQn aqlET1raEKtRlRute+xLYYfnj510F1j7k5+YhCPlSFR9L/H+NuSNLCY/Jtp0pGbGhFLD ng== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 39w5x20pd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 19 Jul 2021 09:20:58 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16JDDIkV017543 for ; Mon, 19 Jul 2021 13:20:56 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma06ams.nl.ibm.com with ESMTP id 39vng70bpu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 19 Jul 2021 13:20:56 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16JDKrkD20513108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jul 2021 13:20:54 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D592FA4051; Mon, 19 Jul 2021 13:20:53 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7BEA9A4059; Mon, 19 Jul 2021 13:20:52 +0000 (GMT) Received: from hegdevasant.in.ibm.com (unknown [9.85.86.230]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 19 Jul 2021 13:20:52 +0000 (GMT) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Mon, 19 Jul 2021 18:49:21 +0530 Message-Id: <20210719132012.150948-11-hegdevasant@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210719132012.150948-1-hegdevasant@linux.vnet.ibm.com> References: <20210719132012.150948-1-hegdevasant@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: eGA2QyF-iGPEZuBwUnriToVFoVBNvM61 X-Proofpoint-GUID: eGA2QyF-iGPEZuBwUnriToVFoVBNvM61 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-19_05:2021-07-19, 2021-07-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107190076 Subject: [Skiboot] [PATCH 10/61] external/gard: Enable Power10 X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Klaus Heinrich Kiwi Add Power10 support for opal-gard utility. Signed-off-by: Klaus Heinrich Kiwi [Folded test case fix and updated commit message - Vasant] Signed-off-by: Vasant Hegde --- external/gard/gard.c | 15 ++++- external/gard/gard.h | 1 + external/gard/test/results/02-usage.err | 1 + external/gard/units.c | 89 +++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 3 deletions(-) diff --git a/external/gard/gard.c b/external/gard/gard.c index b012cf9b7..53a26d0e9 100644 --- a/external/gard/gard.c +++ b/external/gard/gard.c @@ -157,8 +157,12 @@ static void guess_chip_gen(void) set_chip_gen(p9_chip_units); return; + case 0x0080: /* power10 */ + set_chip_gen(p10_chip_units); + return; + default: - fprintf(stderr, "Unsupported processor (pvr %#x)! Set the processor generation manually with -8 or -9\n", pvr); + fprintf(stderr, "Unsupported processor (pvr %#x)! Set the processor generation manually with -8, -9 or -0\n", pvr); exit(1); } } @@ -773,7 +777,8 @@ static void usage(const char *progname) fprintf(stderr, "Usage: %s [-a -e -f -p] []\n\n", progname); fprintf(stderr, "-8 --p8\n"); - fprintf(stderr, "-9 --p9\n\tSet the processor generation\n\n"); + fprintf(stderr, "-9 --p9\n"); + fprintf(stderr, "-0 --p10\n\tSet the processor generation\n\n"); fprintf(stderr, "-e --ecc\n\tForce reading/writing with ECC bytes.\n\n"); fprintf(stderr, "-f --file \n\tDon't search for MTD device," " read from .\n\n"); @@ -802,9 +807,10 @@ static struct option global_options[] = { { "ecc", no_argument, 0, 'e' }, { "p8", no_argument, 0, '8' }, { "p9", no_argument, 0, '9' }, + { "p10", no_argument, 0, '0' }, { 0 }, }; -static const char *global_optstring = "+ef:p89"; +static const char *global_optstring = "+ef:p890"; int main(int argc, char **argv) { @@ -853,6 +859,9 @@ int main(int argc, char **argv) case '9': set_chip_gen(p9_chip_units); break; + case '0': + set_chip_gen(p10_chip_units); + break; case '?': usage(progname); rc = EXIT_FAILURE; diff --git a/external/gard/gard.h b/external/gard/gard.h index 329772a74..d59c2a0de 100644 --- a/external/gard/gard.h +++ b/external/gard/gard.h @@ -71,3 +71,4 @@ struct chip_unit_desc { extern const struct chip_unit_desc *chip_units; extern const struct chip_unit_desc p8_chip_units[]; extern const struct chip_unit_desc p9_chip_units[]; +extern const struct chip_unit_desc p10_chip_units[]; diff --git a/external/gard/test/results/02-usage.err b/external/gard/test/results/02-usage.err index 0e0782628..453fcf52f 100644 --- a/external/gard/test/results/02-usage.err +++ b/external/gard/test/results/02-usage.err @@ -2,6 +2,7 @@ Usage: ./opal-gard [-a -e -f -p] [] -8 --p8 -9 --p9 +-0 --p10 Set the processor generation -e --ecc diff --git a/external/gard/units.c b/external/gard/units.c index 35d46e443..f3b435a3a 100644 --- a/external/gard/units.c +++ b/external/gard/units.c @@ -151,3 +151,92 @@ const struct chip_unit_desc p9_chip_units[] = { {0x4F, "LAST_IN_RANGE"}, }; +const struct chip_unit_desc p10_chip_units[] = { + {0x00, "NA"}, + {0x01, "Sys"}, + {0x02, "Node"}, + {0x03, "DIMM"}, + {0x04, "Membuf"}, + {0x05, "Proc"}, + {0x06, "EX"}, + {0x07, "Core"}, + {0x08, "L2"}, + {0x09, "L3"}, + {0x0A, "L4"}, + {0x0B, "MCS"}, + /* a hole! */ + {0x0D, "MBA"}, + {0x0E, "XBUS"}, + {0x0F, "ABUS"}, + {0x10, "PCI"}, + {0x11, "DPSS"}, + {0x12, "APSS"}, + {0x13, "OCC"}, + {0x14, "PSI"}, + {0x15, "FSP"}, + {0x16, "PNOR"}, + {0x17, "OSC"}, + {0x18, "TODCLK"}, + {0x19, "CONTROL_NODE"}, + {0x1A, "OSCREFCLK"}, + {0x1B, "OSCPCICLK"}, + {0x1C, "REFCLKENDPT"}, + {0x1D, "PCICLKENDPT"}, + {0x1E, "NX"}, + {0x1F, "PORE"}, + {0x20, "PCIESWITCH"}, + {0x21, "CAPP"}, + {0x22, "FSI"}, + {0x23, "EQ"}, + {0x24, "MCA"}, + {0x25, "MCBIST"}, + {0x26, "MI"}, + {0x27, "DMI"}, + {0x28, "OBUS"}, + {0x2A, "SBE"}, + {0x2B, "PPE"}, + {0x2C, "PERV"}, + {0x2D, "PEC"}, + {0x2E, "PHB"}, + {0x2F, "SYSREFCLKENDPT"}, + {0x30, "MFREFCLKENDPT"}, + {0x31, "TPM"}, + {0x32, "SP"}, + {0x33, "UART"}, + {0x34, "PS"}, + {0x35, "FAN"}, + {0x36, "VRM"}, + {0x37, "USB"}, + {0x38, "ETH"}, + {0x39, "PANEL"}, + {0x3A, "BMC"}, + {0x3B, "FLASH"}, + {0x3C, "SEEPROM"}, + {0x3D, "TMP"}, + {0x3E, "GPIO_EXPANDER"}, + {0x3F, "POWER_SEQUENCER"}, + {0x40, "RTC"}, + {0x41, "FANCTLR"}, + {0x42, "OBUS_BRICK"}, + {0x43, "NPU"}, + {0x44, "MC"}, + {0x45, "TEST_FAIL"}, + {0x46, "MFREFCLK"}, + {0x47, "SMPGROUP"}, + {0x48, "OMI"}, + {0x49, "MCC"}, + {0x4A, "OMIC"}, + {0x4B, "OCMB_CHIP"}, + {0x4C, "MEM_PORT"}, + {0x4D, "I2C_MUX"}, + {0x4E, "PMIC"}, + {0x4F, "NMMU"}, + {0x50, "PAU"}, + {0x51, "IOHS"}, + {0x52, "PAUC"}, + {0x53, "FC"}, + {0x54, "LPCREFCLKENDPT"}, + {0x55, "GENERIC_I2C_DEVICE"}, + {0x56, "LAST_IN_RANGE"}, +}; +