Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4409496rdh; Wed, 29 Nov 2023 00:04:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyVBuy8wkb4sCAhyRS3m9cAmE/IyDijAX/AgI9zQ4vncPG8NatR4FGQwBfhouMKRP8gVMb X-Received: by 2002:a17:90b:4d0d:b0:280:4ec6:97e9 with SMTP id mw13-20020a17090b4d0d00b002804ec697e9mr20286174pjb.30.1701245073202; Wed, 29 Nov 2023 00:04:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701245073; cv=none; d=google.com; s=arc-20160816; b=Wx5dvK79Ki1biG0wElR4imU1hoxP82PT23m18OgX2CalSM06gsRE+eOPN/7AUL2kNF 5NJfrU9EL989t8lxGkfBYSufHUJzdMY1YtayYb+iBGsc+EB2perqVM4jXtWq917N9xI4 Yj5r8dkk3A3Xx8/Yk2+cZk3DAiL3eRDzvwR3RmMnpkrohcOa01H+4HIfVgB6QJG+zwGo yFA9r6h6CrzhDQSV5P0sNll+xeFlzB4Y8b2st/haN0Rd2gGx27GUuIayipdzkG6sAWOT fZzBhKbN1Vkpifxxv3R4CROm9DOKwocDFeledFX9/yKm3huQrP6LnXLwZmc2n3IHF6YD StKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=79GsVzHx8ppoKRuLQRsTtWuze4E18gnfjeG0dpcPr30=; fh=IByQ6f+j1q24wLe+hLUwRstV6LjUdNUl6rqCfkS1Xho=; b=bJzN2kImOxgCKNgT9d5bMmLPf4XkB/WwonEz5rsv7vOR7+SXYjEQ4vLTxweAFKx5RQ FlFmuuToZdDkZMGgKm77ueCaePbnmMmssMJGsJfttcxsfLS3WL9+Zliz1f4AR+6ZUWSd 02XjQngD5KmlG7u9fjg1cREV9Fl5UKi2F+FPFHDBXDOaJ3BxIE1ElRmTfPnkoX13eTAa VnbJEas6YP3qeW7bQVHMOGaZ7+1TNc+z8q2Lc5+fcUvgWbr9Zjn8kuBXKu9pzdJkc/35 H+wzcClh40fwAr35BF2y/KeVP2s+MQCnJBA5b54wkzNbQ0+aBPVk7eww5dLY3Ec1eSF8 9NGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id jb1-20020a170903258100b001cfdfa28b70si4211741plb.469.2023.11.29.00.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:04:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E07438040E9E; Wed, 29 Nov 2023 00:04:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbjK2IER (ORCPT + 99 others); Wed, 29 Nov 2023 03:04:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjK2IEO (ORCPT ); Wed, 29 Nov 2023 03:04:14 -0500 X-Greylist: delayed 282 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 29 Nov 2023 00:04:18 PST Received: from bg1.exmail.qq.com (bg1.exmail.qq.com [114.132.233.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E93710F0; Wed, 29 Nov 2023 00:04:17 -0800 (PST) X-QQ-mid: bizesmtp64t1701244736ta8gixpe Received: from HX01040049.powercore.com.cn ( [125.94.202.196]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 29 Nov 2023 15:58:49 +0800 (CST) X-QQ-SSF: 01400000000000708000000A0000000 X-QQ-FEAT: gBprNiU+WNeRCxd1mFC0ek6Tr9pLWM0mTZ8midTMAGSwDIo4FTOPE7P8jVK5u +jS+f0RV5CzN/+0yORbfyySXnusFmiK22mABedLLcYzyGgYY1frZEeKnDSQl8zoRdx90QJy G/zOe6wfeheY/JSBeS+SmYGCxZbkSJiYeEiOkibXu9AaKfnYNSd1J1SqscQdVLaFoTCA9zN 9atgjRdl4GsXTkWfml6gExxq80YpEp/8gdZoGjwNktkdkCZumWt9uN3nEUQR7BV4w2x6Jh/ mf0OcdUJoF4M7awpTHrY26mXg61djVAzY/+1VZVZq0WhonU6SAilF4v3uT/9rDfTcR/FFNy HF+Gvi4Z452yTWE5KoCxtLfp6j8ZTNwd9Qc0tkxi3r0bu7Gwd66E2IHEsFZsHIUX9Dd6g+2 Xiks/CqNkxmvGl6iz5vOGnr6Rlpn7cwC X-QQ-GoodBg: 2 X-BIZMAIL-ID: 3565711899021422489 From: Zhao Ke To: mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, fbarrat@linux.ibm.com, ajd@linux.ibm.com, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, shenghui.qu@shingroup.cn, luming.yu@shingroup.cn, dawei.li@shingroup.cn, Zhao Ke Subject: [PATCH v2] powerpc: Add PVN support for HeXin C2000 processor Date: Wed, 29 Nov 2023 15:58:45 +0800 Message-Id: <20231129075845.57976-1-ke.zhao@shingroup.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrsz:qybglogicsvrsz3a-0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 00:04:32 -0800 (PST) HeXin Tech Co. has applied for a new PVN from the OpenPower Community for its new processor C2000. The OpenPower has assigned a new PVN and this newly assigned PVN is 0x0066, add pvr register related support for this PVN. Signed-off-by: Zhao Ke Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10 --- v1 -> v2: - Fix pvr_mask and cpu_name - Fix alignment pattern to match other lines v0 -> v1: - Fix .cpu_name with the correct description --- --- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++ arch/powerpc/kvm/book3s_pr.c | 1 + arch/powerpc/mm/book3s64/pkeys.c | 3 ++- arch/powerpc/platforms/powernv/subcore.c | 3 ++- drivers/misc/cxl/cxl.h | 3 ++- 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 4ae4ab9090a2..7fd09f25452d 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -1361,6 +1361,7 @@ #define PVR_POWER8E 0x004B #define PVR_POWER8NVL 0x004C #define PVR_POWER8 0x004D +#define PVR_HX_C2000 0x0066 #define PVR_POWER9 0x004E #define PVR_POWER10 0x0080 #define PVR_BE 0x0070 diff --git a/arch/powerpc/kernel/cpu_specs_book3s_64.h b/arch/powerpc/kernel/cpu_specs_book3s_64.h index c370c1b804a9..3ff9757df4c0 100644 --- a/arch/powerpc/kernel/cpu_specs_book3s_64.h +++ b/arch/powerpc/kernel/cpu_specs_book3s_64.h @@ -238,6 +238,21 @@ static struct cpu_spec cpu_specs[] __initdata = { .machine_check_early = __machine_check_early_realmode_p8, .platform = "power8", }, + { /* 2.07-compliant processor, HeXin C2000 processor */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x00660000, + .cpu_name = "HX-C2000", + .cpu_features = CPU_FTRS_POWER8, + .cpu_user_features = COMMON_USER_POWER8, + .cpu_user_features2 = COMMON_USER2_POWER8, + .mmu_features = MMU_FTRS_POWER8, + .icache_bsize = 128, + .dcache_bsize = 128, + .cpu_setup = __setup_cpu_power8, + .cpu_restore = __restore_cpu_power8, + .machine_check_early = __machine_check_early_realmode_p8, + .platform = "power8", + }, { /* 3.00-compliant processor, i.e. Power9 "architected" mode */ .pvr_mask = 0xffffffff, .pvr_value = 0x0f000005, diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 9118242063fb..5b92619a05fd 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c @@ -604,6 +604,7 @@ static void kvmppc_set_pvr_pr(struct kvm_vcpu *vcpu, u32 pvr) case PVR_POWER8: case PVR_POWER8E: case PVR_POWER8NVL: + case PVR_HX_C2000: case PVR_POWER9: vcpu->arch.hflags |= BOOK3S_HFLAG_MULTI_PGSIZE | BOOK3S_HFLAG_NEW_TLBIE; diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 125733962033..a974baf8f327 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++ b/arch/powerpc/mm/book3s64/pkeys.c @@ -89,7 +89,8 @@ static int __init scan_pkey_feature(void) unsigned long pvr = mfspr(SPRN_PVR); if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E || - PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9) + PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9 || + PVR_VER(pvr) == PVR_HX_C2000) pkeys_total = 32; } } diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c index 191424468f10..393e747541fb 100644 --- a/arch/powerpc/platforms/powernv/subcore.c +++ b/arch/powerpc/platforms/powernv/subcore.c @@ -425,7 +425,8 @@ static int subcore_init(void) if (pvr_ver != PVR_POWER8 && pvr_ver != PVR_POWER8E && - pvr_ver != PVR_POWER8NVL) + pvr_ver != PVR_POWER8NVL && + pvr_ver != PVR_HX_C2000) return 0; /* diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h index 0562071cdd4a..6ad0ab892675 100644 --- a/drivers/misc/cxl/cxl.h +++ b/drivers/misc/cxl/cxl.h @@ -836,7 +836,8 @@ static inline bool cxl_is_power8(void) { if ((pvr_version_is(PVR_POWER8E)) || (pvr_version_is(PVR_POWER8NVL)) || - (pvr_version_is(PVR_POWER8))) + (pvr_version_is(PVR_POWER8)) || + (pvr_version_is(PVR_HX_C2000))) return true; return false; } -- 2.34.1