powerpc: Add PVN support for HeXin C2000 processor
authorZhao Ke <ke.zhao@shingroup.cn>
Wed, 29 Nov 2023 07:58:45 +0000 (15:58 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 1 Dec 2023 10:15:33 +0000 (21:15 +1100)
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 <ke.zhao@shingroup.cn>
Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231129075845.57976-1-ke.zhao@shingroup.cn
arch/powerpc/include/asm/reg.h
arch/powerpc/kernel/cpu_specs_book3s_64.h
arch/powerpc/kvm/book3s_pr.c
arch/powerpc/mm/book3s64/pkeys.c
arch/powerpc/platforms/powernv/subcore.c
drivers/misc/cxl/cxl.h

index 4ae4ab9090a2d4e99e605ca68ed1abfde316150e..7fd09f25452d4f697728f7958a9ad5b277f73a50 100644 (file)
 #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
index c370c1b804a9036774530ad8ee2d1a0f1d7591bd..3ff9757df4c0723008b655830fbed89b4e078e57 100644 (file)
@@ -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,
index 9118242063fbbd3a235c825c463058c0d05cc074..5b92619a05fdf29c439c432dfeece8cc0f4444d3 100644 (file)
@@ -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;
index 12573396203381a0d1e400203bc9bdfe35d315b3..a974baf8f3278e6ae8dd66f98c9665813f8f646d 100644 (file)
@@ -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;
                }
        }
index 191424468f10aaf1e57eef7d4bf3d4361776d7e4..393e747541fbeb217bedf48d354099eb75290164 100644 (file)
@@ -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;
 
        /*
index 0562071cdd4aaf176235d8c38fd731743eb33393..6ad0ab89267516fbda167d1c109a298c1ea5ea27 100644 (file)
@@ -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;
 }