powerpc/cputable: Split cpu_specs[] for mpc85xx and e500mc
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 19 Sep 2022 17:01:32 +0000 (19:01 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 26 Sep 2022 13:00:05 +0000 (23:00 +1000)
e500v1/v2 and e500mc are said to be mutually exclusive in Kconfig.

Split e500 cpu_specs[] and then restrict the non e500mc to PPC32
which is then 85xx.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Tweak formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/553b901ea91e393df231103da4b018e9b251b0e9.1663606876.git.christophe.leroy@csgroup.eu
arch/powerpc/kernel/cpu_specs.h
arch/powerpc/kernel/cpu_specs_85xx.h [new file with mode: 0644]
arch/powerpc/kernel/cpu_specs_e500.h [deleted file]
arch/powerpc/kernel/cpu_specs_e500mc.h [new file with mode: 0644]

index 658c68acf96e703d755b01cad4c5864cbf54b7d3..85ded3f77204cfdb0301ef2c94bebc9e973913be 100644 (file)
 #include "cpu_specs_8xx.h"
 #endif
 
-#ifdef CONFIG_E500
-#include "cpu_specs_e500.h"
+#ifdef CONFIG_PPC_E500MC
+#include "cpu_specs_e500mc.h"
+#elif defined(CONFIG_PPC_85xx)
+#include "cpu_specs_85xx.h"
 #endif
 
 #ifdef CONFIG_PPC_BOOK3S_32
diff --git a/arch/powerpc/kernel/cpu_specs_85xx.h b/arch/powerpc/kernel/cpu_specs_85xx.h
new file mode 100644 (file)
index 0000000..aaae202
--- /dev/null
@@ -0,0 +1,57 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ *  Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
+ */
+
+#define COMMON_USER_BOOKE      (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
+                                PPC_FEATURE_BOOKE)
+
+static struct cpu_spec cpu_specs[] __initdata = {
+       {       /* e500 */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x80200000,
+               .cpu_name               = "e500",
+               .cpu_features           = CPU_FTRS_E500,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_SPE_COMP |
+                                         PPC_FEATURE_HAS_EFP_SINGLE_COMP,
+               .cpu_user_features2     = PPC_FEATURE2_ISEL,
+               .mmu_features           = MMU_FTR_TYPE_FSL_E,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .num_pmcs               = 4,
+               .cpu_setup              = __setup_cpu_e500v1,
+               .machine_check          = machine_check_e500,
+               .platform               = "ppc8540",
+       },
+       {       /* e500v2 */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x80210000,
+               .cpu_name               = "e500v2",
+               .cpu_features           = CPU_FTRS_E500_2,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_SPE_COMP |
+                                         PPC_FEATURE_HAS_EFP_SINGLE_COMP |
+                                         PPC_FEATURE_HAS_EFP_DOUBLE_COMP,
+               .cpu_user_features2     = PPC_FEATURE2_ISEL,
+               .mmu_features           = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .num_pmcs               = 4,
+               .cpu_setup              = __setup_cpu_e500v2,
+               .machine_check          = machine_check_e500,
+               .platform               = "ppc8548",
+               .cpu_down_flush         = cpu_down_flush_e500v2,
+       },
+       {       /* default match */
+               .pvr_mask               = 0x00000000,
+               .pvr_value              = 0x00000000,
+               .cpu_name               = "(generic E500 PPC)",
+               .cpu_features           = CPU_FTRS_E500,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_SPE_COMP |
+                                         PPC_FEATURE_HAS_EFP_SINGLE_COMP,
+               .mmu_features           = MMU_FTR_TYPE_FSL_E,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .machine_check          = machine_check_e500,
+               .platform               = "powerpc",
+       }
+};
diff --git a/arch/powerpc/kernel/cpu_specs_e500.h b/arch/powerpc/kernel/cpu_specs_e500.h
deleted file mode 100644 (file)
index 1f366f2..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- *  Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
- *
- *  Modifications for ppc64:
- *      Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
- */
-
-#ifdef CONFIG_PPC64
-#define COMMON_USER_BOOKE      (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
-                                PPC_FEATURE_HAS_FPU | PPC_FEATURE_64)
-#else
-#define COMMON_USER_BOOKE      (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
-                                PPC_FEATURE_BOOKE)
-#endif
-
-static struct cpu_spec cpu_specs[] __initdata = {
-#ifdef CONFIG_PPC32
-#ifndef CONFIG_PPC_E500MC
-       {       /* e500 */
-               .pvr_mask               = 0xffff0000,
-               .pvr_value              = 0x80200000,
-               .cpu_name               = "e500",
-               .cpu_features           = CPU_FTRS_E500,
-               .cpu_user_features      = COMMON_USER_BOOKE |
-                       PPC_FEATURE_HAS_SPE_COMP |
-                       PPC_FEATURE_HAS_EFP_SINGLE_COMP,
-               .cpu_user_features2     = PPC_FEATURE2_ISEL,
-               .mmu_features           = MMU_FTR_TYPE_FSL_E,
-               .icache_bsize           = 32,
-               .dcache_bsize           = 32,
-               .num_pmcs               = 4,
-               .cpu_setup              = __setup_cpu_e500v1,
-               .machine_check          = machine_check_e500,
-               .platform               = "ppc8540",
-       },
-       {       /* e500v2 */
-               .pvr_mask               = 0xffff0000,
-               .pvr_value              = 0x80210000,
-               .cpu_name               = "e500v2",
-               .cpu_features           = CPU_FTRS_E500_2,
-               .cpu_user_features      = COMMON_USER_BOOKE |
-                       PPC_FEATURE_HAS_SPE_COMP |
-                       PPC_FEATURE_HAS_EFP_SINGLE_COMP |
-                       PPC_FEATURE_HAS_EFP_DOUBLE_COMP,
-               .cpu_user_features2     = PPC_FEATURE2_ISEL,
-               .mmu_features           = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS,
-               .icache_bsize           = 32,
-               .dcache_bsize           = 32,
-               .num_pmcs               = 4,
-               .cpu_setup              = __setup_cpu_e500v2,
-               .machine_check          = machine_check_e500,
-               .platform               = "ppc8548",
-               .cpu_down_flush         = cpu_down_flush_e500v2,
-       },
-#else
-       {       /* e500mc */
-               .pvr_mask               = 0xffff0000,
-               .pvr_value              = 0x80230000,
-               .cpu_name               = "e500mc",
-               .cpu_features           = CPU_FTRS_E500MC,
-               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
-               .cpu_user_features2     = PPC_FEATURE2_ISEL,
-               .mmu_features           = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS |
-                       MMU_FTR_USE_TLBILX,
-               .icache_bsize           = 64,
-               .dcache_bsize           = 64,
-               .num_pmcs               = 4,
-               .cpu_setup              = __setup_cpu_e500mc,
-               .machine_check          = machine_check_e500mc,
-               .platform               = "ppce500mc",
-               .cpu_down_flush         = cpu_down_flush_e500mc,
-       },
-#endif /* CONFIG_PPC_E500MC */
-#endif /* CONFIG_PPC32 */
-#ifdef CONFIG_PPC_E500MC
-       {       /* e5500 */
-               .pvr_mask               = 0xffff0000,
-               .pvr_value              = 0x80240000,
-               .cpu_name               = "e5500",
-               .cpu_features           = CPU_FTRS_E5500,
-               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
-               .cpu_user_features2     = PPC_FEATURE2_ISEL,
-               .mmu_features           = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS |
-                       MMU_FTR_USE_TLBILX,
-               .icache_bsize           = 64,
-               .dcache_bsize           = 64,
-               .num_pmcs               = 4,
-               .cpu_setup              = __setup_cpu_e5500,
-#ifndef CONFIG_PPC32
-               .cpu_restore            = __restore_cpu_e5500,
-#endif
-               .machine_check          = machine_check_e500mc,
-               .platform               = "ppce5500",
-               .cpu_down_flush         = cpu_down_flush_e5500,
-       },
-       {       /* e6500 */
-               .pvr_mask               = 0xffff0000,
-               .pvr_value              = 0x80400000,
-               .cpu_name               = "e6500",
-               .cpu_features           = CPU_FTRS_E6500,
-               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU |
-                       PPC_FEATURE_HAS_ALTIVEC_COMP,
-               .cpu_user_features2     = PPC_FEATURE2_ISEL,
-               .mmu_features           = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS |
-                       MMU_FTR_USE_TLBILX,
-               .icache_bsize           = 64,
-               .dcache_bsize           = 64,
-               .num_pmcs               = 6,
-               .cpu_setup              = __setup_cpu_e6500,
-#ifndef CONFIG_PPC32
-               .cpu_restore            = __restore_cpu_e6500,
-#endif
-               .machine_check          = machine_check_e500mc,
-               .platform               = "ppce6500",
-               .cpu_down_flush         = cpu_down_flush_e6500,
-       },
-#endif /* CONFIG_PPC_E500MC */
-#ifdef CONFIG_PPC32
-       {       /* default match */
-               .pvr_mask               = 0x00000000,
-               .pvr_value              = 0x00000000,
-               .cpu_name               = "(generic E500 PPC)",
-               .cpu_features           = CPU_FTRS_E500,
-               .cpu_user_features      = COMMON_USER_BOOKE |
-                       PPC_FEATURE_HAS_SPE_COMP |
-                       PPC_FEATURE_HAS_EFP_SINGLE_COMP,
-               .mmu_features           = MMU_FTR_TYPE_FSL_E,
-               .icache_bsize           = 32,
-               .dcache_bsize           = 32,
-               .machine_check          = machine_check_e500,
-               .platform               = "powerpc",
-       }
-#endif /* CONFIG_PPC32 */
-};
diff --git a/arch/powerpc/kernel/cpu_specs_e500mc.h b/arch/powerpc/kernel/cpu_specs_e500mc.h
new file mode 100644 (file)
index 0000000..ceb06b1
--- /dev/null
@@ -0,0 +1,75 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ *  Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
+ *
+ *  Modifications for ppc64:
+ *      Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
+ */
+
+#ifdef CONFIG_PPC64
+#define COMMON_USER_BOOKE      (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
+                                PPC_FEATURE_HAS_FPU | PPC_FEATURE_64)
+#else
+#define COMMON_USER_BOOKE      (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
+                                PPC_FEATURE_BOOKE)
+#endif
+
+static struct cpu_spec cpu_specs[] __initdata = {
+#ifdef CONFIG_PPC32
+       {       /* e500mc */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x80230000,
+               .cpu_name               = "e500mc",
+               .cpu_features           = CPU_FTRS_E500MC,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+               .cpu_user_features2     = PPC_FEATURE2_ISEL,
+               .mmu_features           = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | MMU_FTR_USE_TLBILX,
+               .icache_bsize           = 64,
+               .dcache_bsize           = 64,
+               .num_pmcs               = 4,
+               .cpu_setup              = __setup_cpu_e500mc,
+               .machine_check          = machine_check_e500mc,
+               .platform               = "ppce500mc",
+               .cpu_down_flush         = cpu_down_flush_e500mc,
+       },
+#endif /* CONFIG_PPC32 */
+       {       /* e5500 */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x80240000,
+               .cpu_name               = "e5500",
+               .cpu_features           = CPU_FTRS_E5500,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+               .cpu_user_features2     = PPC_FEATURE2_ISEL,
+               .mmu_features           = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | MMU_FTR_USE_TLBILX,
+               .icache_bsize           = 64,
+               .dcache_bsize           = 64,
+               .num_pmcs               = 4,
+               .cpu_setup              = __setup_cpu_e5500,
+#ifndef CONFIG_PPC32
+               .cpu_restore            = __restore_cpu_e5500,
+#endif
+               .machine_check          = machine_check_e500mc,
+               .platform               = "ppce5500",
+               .cpu_down_flush         = cpu_down_flush_e5500,
+       },
+       {       /* e6500 */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x80400000,
+               .cpu_name               = "e6500",
+               .cpu_features           = CPU_FTRS_E6500,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU |
+                                         PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features2     = PPC_FEATURE2_ISEL,
+               .mmu_features           = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | MMU_FTR_USE_TLBILX,
+               .icache_bsize           = 64,
+               .dcache_bsize           = 64,
+               .num_pmcs               = 6,
+               .cpu_setup              = __setup_cpu_e6500,
+#ifndef CONFIG_PPC32
+               .cpu_restore            = __restore_cpu_e6500,
+#endif
+               .machine_check          = machine_check_e500mc,
+               .platform               = "ppce6500",
+               .cpu_down_flush         = cpu_down_flush_e6500,
+       },
+};