Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp218708rdh; Thu, 23 Nov 2023 01:53:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHj13CpeblORul43Fnt2bcAdPniJiBj6TrICtjcuDDYfvzN+UkNnNrkAIPm6Lo/8sswIZ/P X-Received: by 2002:a05:6a20:72a6:b0:187:804:91fa with SMTP id o38-20020a056a2072a600b00187080491famr5607812pzk.35.1700733229374; Thu, 23 Nov 2023 01:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700733229; cv=none; d=google.com; s=arc-20160816; b=YuY6Sx29VdZCbn7xrFXWuAJdAa0jIHXjrCPd8t/GRLI/y2piv/OuiwjA6U48R0kJr2 w+vg8tsr6HxyMPpWXgdLC/SUNEhNvKUWFfvDwhiTjWi7b6Q0LpSQ5Kq2h16qDgGTsaBh DID+jSMQyxp75de+50Wsisc/xS7I404OI1mfFIb9Z1gcgP7WmNf47p4GmxMnj5CUxbDt chaFMbWAPeds37scLOYdPN9aar3zzv/+zHIVlxC0cAHBsSB+d+jYqgdYx4CfcxGyr+X2 oImOhE0AByDhJJJqsAIPqDKs0Ig3xDtfODpuLoJ4y4ydGoPsJKeD232pGaxuy8eukK3b rRAQ== 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=qdK5Byk6etPA03hp3cyktCWXxAqrATafojPCrHhM+Tg=; fh=IByQ6f+j1q24wLe+hLUwRstV6LjUdNUl6rqCfkS1Xho=; b=gQLiWfpEmPklQeCT67UyWn7gWaajPDVRaxYLXQ1NPboNFAyZuosFioBsEEOU+P8iFF +RrDNE93ywuXiCTqimkt5vtvVtT1A0eP7fDqD1yZGmuqTwHw4SmenG4529Skag42oh71 2aWTWS/AyWrWBVrkT4+LMpRQGKHh8HaQb/VnhWy/UfXo0jQhJcsujmqUKoVLXE/PbDSO W8I4fzndpVkIeUcJcBSL688i32emfdSlz4zTU4hsYv1GDe47Rq9Nq6frC04lQxF8MPwi 0sk5VI07auIhNX4HY4FpHdASDRvLaXvl3T0O0xzEAaLUrHZad8RJvBUiOmnI1UXuIaBx eacA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id a7-20020a63d207000000b005b8f24e6525si979787pgg.81.2023.11.23.01.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 01:53:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 5971E8083487; Thu, 23 Nov 2023 01:53:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233111AbjKWJxN (ORCPT + 99 others); Thu, 23 Nov 2023 04:53:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232617AbjKWJxH (ORCPT ); Thu, 23 Nov 2023 04:53:07 -0500 Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8225D10D8; Thu, 23 Nov 2023 01:45:56 -0800 (PST) X-QQ-mid: bizesmtp68t1700732180t6v5pcfw Received: from HX01040049.powercore.com.cn ( [125.94.202.196]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 23 Nov 2023 17:36:15 +0800 (CST) X-QQ-SSF: 01400000000000508000000A0000000 X-QQ-FEAT: G3NsQplooNEqMvcyjlUA5SXVKY0py3l7/lOMYf/u8L8Rme6STHXbb+/Rj8CbQ 5ZzCJLQxgE8qCMCFU+b3jY4rCh6oCNqfvbsP2qBbMgFp8oRTVxCvTIIFym2Uz5gKpEDdZtO 9QOeSPZkREKQdWEn3xi7vfwak++IirBoAydSSAr580oumVHMj2npiHx6cadQ9U6jaKQM25i MkyFxoQ7lBYpHUpPwu/PzdM3zYslJb0L5PofJIUABPlrqXuuncKOvopRXC8D07JE5NSNeBO Jmv48gnvQDCsGY2UT6mv02JhUgu03xxq929KAoWGV4ydhqq/qDaNa2fYX2wERQrz+t2M/zr ccTDv592x7QuoU/1CpNP5haArNTFgzN+SZTGv8j0Fyu7koNNsljnlYN1ohY0hP3yyKQHehR 7BPeTa8Mvh8= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 2317734377399214772 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 v1] powerpc: Add PVN support for HeXin C2000 processor Date: Thu, 23 Nov 2023 17:36:11 +0800 Message-Id: <20231123093611.98313-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=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 23 Nov 2023 01:53:45 -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 --- 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..367c9f6d9be5 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 = 0xffffffff, + .pvr_value = 0x00660000, + .cpu_name = "POWER8 (raw)", + .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..c38f378e1942 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..58e7331e1e7e 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..9ac2991b29c7 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