]> err.no Git - linux-2.6/blobdiff - arch/powerpc/kernel/cputable.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[linux-2.6] / arch / powerpc / kernel / cputable.c
index dfb84c86ec40fd253537d1b259a3db0be153a04c..25a052c16754349c2e5e91ffc4c3b3dac9c7e2bf 100644 (file)
@@ -23,6 +23,9 @@
 struct cpu_spec* cur_cpu_spec = NULL;
 EXPORT_SYMBOL(cur_cpu_spec);
 
+/* The platform string corresponding to the real PVR */
+const char *powerpc_base_platform;
+
 /* NOTE:
  * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
  * the responsibility of the appropriate CPU save/restore functions to
@@ -36,6 +39,8 @@ extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
@@ -51,6 +56,8 @@ extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
 extern void __restore_cpu_pa6t(void);
 extern void __restore_cpu_ppc970(void);
+extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec);
+extern void __restore_cpu_power7(void);
 #endif /* CONFIG_PPC64 */
 
 /* This table only contains "desktop" CPUs, it need to be filled with embedded
@@ -66,7 +73,12 @@ extern void __restore_cpu_ppc970(void);
                                 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
 #define COMMON_USER_POWER6     (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
                                 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
-                                PPC_FEATURE_TRUE_LE)
+                                PPC_FEATURE_TRUE_LE | \
+                                PPC_FEATURE_PSERIES_PERFMON_COMPAT)
+#define COMMON_USER_POWER7     (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\
+                                PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
+                                PPC_FEATURE_TRUE_LE | \
+                                PPC_FEATURE_PSERIES_PERFMON_COMPAT)
 #define COMMON_USER_PA6T       (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
                                 PPC_FEATURE_TRUE_LE | \
                                 PPC_FEATURE_HAS_ALTIVEC_COMP)
@@ -346,6 +358,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .machine_check          = machine_check_generic,
+               .oprofile_cpu_type      = "ppc64/compat-power5+",
                .platform               = "power5+",
        },
        {       /* Power6 */
@@ -377,8 +390,41 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .machine_check          = machine_check_generic,
+               .oprofile_cpu_type      = "ppc64/compat-power6",
                .platform               = "power6",
        },
+       {       /* 2.06-compliant processor, i.e. Power7 "architected" mode */
+               .pvr_mask               = 0xffffffff,
+               .pvr_value              = 0x0f000003,
+               .cpu_name               = "POWER7 (architected)",
+               .cpu_features           = CPU_FTRS_POWER7,
+               .cpu_user_features      = COMMON_USER_POWER7,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .machine_check          = machine_check_generic,
+               .oprofile_cpu_type      = "ppc64/compat-power7",
+               .platform               = "power7",
+       },
+       {       /* Power7 */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x003f0000,
+               .cpu_name               = "POWER7 (raw)",
+               .cpu_features           = CPU_FTRS_POWER7,
+               .cpu_user_features      = COMMON_USER_POWER7,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .num_pmcs               = 6,
+               .pmc_type               = PPC_PMC_IBM,
+               .cpu_setup              = __setup_cpu_power7,
+               .cpu_restore            = __restore_cpu_power7,
+               .oprofile_cpu_type      = "ppc64/power7",
+               .oprofile_type          = PPC_OPROFILE_POWER4,
+               .oprofile_mmcra_sihv    = POWER6_MMCRA_SIHV,
+               .oprofile_mmcra_sipr    = POWER6_MMCRA_SIPR,
+               .oprofile_mmcra_clear   = POWER6_MMCRA_THRM |
+                       POWER6_MMCRA_OTHER,
+               .platform               = "power7",
+       },
        {       /* Cell Broadband Engine */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x00700000,
@@ -959,6 +1005,9 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .cpu_setup              = __setup_cpu_603,
+               .num_pmcs               = 4,
+               .oprofile_cpu_type      = "ppc/e300",
+               .oprofile_type          = PPC_OPROFILE_FSL_EMB,
                .platform               = "ppc603",
        },
        {       /* e300c4 (e300c1, plus one IU) */
@@ -971,6 +1020,9 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .dcache_bsize           = 32,
                .cpu_setup              = __setup_cpu_603,
                .machine_check          = machine_check_generic,
+               .num_pmcs               = 4,
+               .oprofile_cpu_type      = "ppc/e300",
+               .oprofile_type          = PPC_OPROFILE_FSL_EMB,
                .platform               = "ppc603",
        },
        {       /* default match, we assume split I/D cache & TB (non-601)... */
@@ -1201,6 +1253,18 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .machine_check          = machine_check_4xx,
                .platform               = "ppc405",
        },
+       {       /* default match */
+               .pvr_mask               = 0x00000000,
+               .pvr_value              = 0x00000000,
+               .cpu_name               = "(generic 40x PPC)",
+               .cpu_features           = CPU_FTRS_40X,
+               .cpu_user_features      = PPC_FEATURE_32 |
+                       PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .machine_check          = machine_check_4xx,
+               .platform               = "ppc405",
+       }
 
 #endif /* CONFIG_40x */
 #ifdef CONFIG_44x
@@ -1238,6 +1302,18 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .machine_check          = machine_check_4xx,
                .platform               = "ppc440",
        },
+       { /* Matches both physical and logical PVR for 440EP (logical pvr = pvr | 0x8) */
+               .pvr_mask               = 0xf0000ff7,
+               .pvr_value              = 0x400008d4,
+               .cpu_name               = "440EP Rev. C",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_440ep,
+               .machine_check          = machine_check_4xx,
+               .platform               = "ppc440",
+       },
        { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
                .pvr_mask               = 0xf0000fff,
                .pvr_value              = 0x400008db,
@@ -1379,8 +1455,52 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .machine_check          = machine_check_440A,
                .platform               = "ppc440",
        },
+       { /* 440 in Xilinx Virtex-5 FXT */
+               .pvr_mask               = 0xfffffff0,
+               .pvr_value              = 0x7ff21910,
+               .cpu_name               = "440 in Virtex-5 FXT",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .platform               = "ppc440",
+       },
+       { /* 460EX */
+               .pvr_mask               = 0xffff0002,
+               .pvr_value              = 0x13020002,
+               .cpu_name               = "460EX",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_460ex,
+               .machine_check          = machine_check_440A,
+               .platform               = "ppc440",
+       },
+       { /* 460GT */
+               .pvr_mask               = 0xffff0002,
+               .pvr_value              = 0x13020000,
+               .cpu_name               = "460GT",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_460gt,
+               .machine_check          = machine_check_440A,
+               .platform               = "ppc440",
+       },
+       {       /* default match */
+               .pvr_mask               = 0x00000000,
+               .pvr_value              = 0x00000000,
+               .cpu_name               = "(generic 44x PPC)",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .machine_check          = machine_check_4xx,
+               .platform               = "ppc440",
+       }
 #endif /* CONFIG_44x */
-#ifdef CONFIG_FSL_BOOKE
 #ifdef CONFIG_E200
        {       /* e200z5 */
                .pvr_mask               = 0xfff00000,
@@ -1409,12 +1529,24 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .machine_check          = machine_check_e200,
                .platform               = "ppc5554",
        },
-#elif defined(CONFIG_E500)
+       {       /* default match */
+               .pvr_mask               = 0x00000000,
+               .pvr_value              = 0x00000000,
+               .cpu_name               = "(generic E200 PPC)",
+               .cpu_features           = CPU_FTRS_E200,
+               .cpu_user_features      = COMMON_USER_BOOKE |
+                       PPC_FEATURE_HAS_EFP_SINGLE |
+                       PPC_FEATURE_UNIFIED_CACHE,
+               .dcache_bsize           = 32,
+               .machine_check          = machine_check_e200,
+               .platform               = "ppc5554",
+       }
+#endif /* CONFIG_E200 */
+#ifdef CONFIG_E500
        {       /* e500 */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x80200000,
                .cpu_name               = "e500",
-               /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
                .cpu_features           = CPU_FTRS_E500,
                .cpu_user_features      = COMMON_USER_BOOKE |
                        PPC_FEATURE_HAS_SPE_COMP |
@@ -1423,7 +1555,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
                .oprofile_cpu_type      = "ppc/e500",
-               .oprofile_type          = PPC_OPROFILE_BOOKE,
+               .oprofile_type          = PPC_OPROFILE_FSL_EMB,
                .machine_check          = machine_check_e500,
                .platform               = "ppc8540",
        },
@@ -1431,7 +1563,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x80210000,
                .cpu_name               = "e500v2",
-               /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
                .cpu_features           = CPU_FTRS_E500_2,
                .cpu_user_features      = COMMON_USER_BOOKE |
                        PPC_FEATURE_HAS_SPE_COMP |
@@ -1441,24 +1572,38 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
                .oprofile_cpu_type      = "ppc/e500",
-               .oprofile_type          = PPC_OPROFILE_BOOKE,
+               .oprofile_type          = PPC_OPROFILE_FSL_EMB,
                .machine_check          = machine_check_e500,
                .platform               = "ppc8548",
        },
-#endif
-#endif
-#if !CLASSIC_PPC
+       {       /* 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,
+               .icache_bsize           = 64,
+               .dcache_bsize           = 64,
+               .num_pmcs               = 4,
+               .oprofile_cpu_type      = "ppc/e500", /* xxx - galak, e500mc? */
+               .oprofile_type          = PPC_OPROFILE_FSL_EMB,
+               .machine_check          = machine_check_e500,
+               .platform               = "ppce500mc",
+       },
        {       /* default match */
                .pvr_mask               = 0x00000000,
                .pvr_value              = 0x00000000,
-               .cpu_name               = "(generic PPC)",
-               .cpu_features           = CPU_FTRS_GENERIC_32,
-               .cpu_user_features      = PPC_FEATURE_32,
+               .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,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
+               .machine_check          = machine_check_e500,
                .platform               = "powerpc",
        }
-#endif /* !CLASSIC_PPC */
+#endif /* CONFIG_E500 */
 #endif /* CONFIG_PPC32 */
 };
 
@@ -1490,11 +1635,36 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
                                t->cpu_setup = s->cpu_setup;
                                t->cpu_restore = s->cpu_restore;
                                t->platform = s->platform;
+                               /*
+                                * If we have passed through this logic once
+                                * before and have pulled the default case
+                                * because the real PVR was not found inside
+                                * cpu_specs[], then we are possibly running in
+                                * compatibility mode. In that case, let the
+                                * oprofiler know which set of compatibility
+                                * counters to pull from by making sure the
+                                * oprofile_cpu_type string is set to that of
+                                * compatibility mode. If the oprofile_cpu_type
+                                * already has a value, then we are possibly
+                                * overriding a real PVR with a logical one, and,
+                                * in that case, keep the current value for
+                                * oprofile_cpu_type.
+                                */
+                               if (t->oprofile_cpu_type == NULL)
+                                       t->oprofile_cpu_type = s->oprofile_cpu_type;
                        } else
                                *t = *s;
                        *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
+
+                       /*
+                        * Set the base platform string once; assumes
+                        * we're called with real pvr first.
+                        */
+                       if (powerpc_base_platform == NULL)
+                               powerpc_base_platform = t->platform;
+
 #if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
-                       /* ppc64 and booke expect identify_cpu to also call 
+                       /* ppc64 and booke expect identify_cpu to also call
                         * setup_cpu for that processor. I will consolidate
                         * that at a later time, for now, just use #ifdef.
                         * we also don't need to PTRRELOC the function pointer
@@ -1510,38 +1680,3 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
        BUG();
        return NULL;
 }
-
-void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
-{
-       struct fixup_entry {
-               unsigned long   mask;
-               unsigned long   value;
-               long            start_off;
-               long            end_off;
-       } *fcur, *fend;
-
-       fcur = fixup_start;
-       fend = fixup_end;
-
-       for (; fcur < fend; fcur++) {
-               unsigned int *pstart, *pend, *p;
-
-               if ((value & fcur->mask) == fcur->value)
-                       continue;
-
-               /* These PTRRELOCs will disappear once the new scheme for
-                * modules and vdso is implemented
-                */
-               pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
-               pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
-
-               for (p = pstart; p < pend; p++) {
-                       *p = 0x60000000u;
-                       asm volatile ("dcbst 0, %0" : : "r" (p));
-               }
-               asm volatile ("sync" : : : "memory");
-               for (p = pstart; p < pend; p++)
-                       asm volatile ("icbi 0,%0" : : "r" (p));
-               asm volatile ("sync; isync" : : : "memory");
-       }
-}