From patchwork Wed Apr 22 05:04:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaidyanathan Srinivasan X-Patchwork-Id: 1274702 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.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 496T2y1mMgz9sSh for ; Wed, 22 Apr 2020 15:07:54 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 496T2y0wBTzDqyn for ; Wed, 22 Apr 2020 15:07:54 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=svaidy@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 496SzM3yTKzDqf9 for ; Wed, 22 Apr 2020 15:04:47 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03M51ne0141327 for ; Wed, 22 Apr 2020 01:04:46 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 30gmvhn3ux-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 22 Apr 2020 01:04:45 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Apr 2020 06:03:50 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 22 Apr 2020 06:03:48 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03M54e1Q49872958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Apr 2020 05:04:40 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D56142056; Wed, 22 Apr 2020 05:04:40 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D45C4204F; Wed, 22 Apr 2020 05:04:39 +0000 (GMT) Received: from drishya.in.ibm.com (unknown [9.85.85.117]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 22 Apr 2020 05:04:38 +0000 (GMT) From: Vaidyanathan Srinivasan To: "Oliver O'Halloran" Date: Wed, 22 Apr 2020 10:34:18 +0530 X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200422050419.72957-1-svaidy@linux.ibm.com> References: <20200422050419.72957-1-svaidy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 20042205-0020-0000-0000-000003CC4CA5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20042205-0021-0000-0000-0000222546A6 Message-Id: <20200422050419.72957-10-svaidy@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-21_10:2020-04-21, 2020-04-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 malwarescore=0 impostorscore=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=856 clxscore=1015 mlxscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004220036 Subject: [Skiboot] [PATCH v5 09/10] Add POWER9 Cumulus processor PVR type 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: , Cc: skiboot@lists.ozlabs.org, Michael Neuling , Vaidyanathan Srinivasan , Alistair Popple Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Vaidyanathan Srinivasan Add PVR checks and feature mapping for POWER9 Cumulus chip. Signed-off-by: Vaidyanathan Srinivasan Signed-off-by: Vasant Hegde --- core/cpufeatures.c | 19 +++++++++++++++++++ include/processor.h | 14 ++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/core/cpufeatures.c b/core/cpufeatures.c index c6754abb..7bc72e24 100644 --- a/core/cpufeatures.c +++ b/core/cpufeatures.c @@ -943,6 +943,25 @@ void dt_add_cpufeatures(struct dt_node *root) default: assert(0); } + } else if (is_power9c(version) && + (PVR_VERS_MAJ(version) == 1)) { + /* P9C DD1.x */ + switch (PVR_VERS_MIN(version)) { + case 1: + /* Cumulus DD1.1 => Nimbus DD2.1 */ + cpu_feature_cpu = CPU_P9_DD2_0_1; + break; + case 2: + /* Cumulus DD1.2 */ + cpu_feature_cpu = CPU_P9_DD2_2; + break; + case 3: + /* Cumulus DD1.3 */ + cpu_feature_cpu = CPU_P9_DD2_3; + break; + default: + assert(0); + } } else { assert(0); } diff --git a/include/processor.h b/include/processor.h index 57c2ee13..8977dfec 100644 --- a/include/processor.h +++ b/include/processor.h @@ -228,6 +228,20 @@ static inline bool is_power9n(uint32_t version) return true; } +static inline bool is_power9c(uint32_t version) { + + if (PVR_TYPE(version) != PVR_TYPE_P9) + return false; + /* + * Bit 13 tells us: + * 0 = Scale out (aka Nimbus) + * 1 = Scale up (aka Cumulus) + */ + if (!((version >> 13) & 1)) + return false; + return true; +} + #ifndef __TEST__ /*