all-archs: consolidate .text section definition in asm-generic
[safe/jmp/linux-2.6] / arch / powerpc / kernel / cputable.c
index cf1eea1..6ef87fb 100644 (file)
@@ -10,7 +10,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/sched.h>
 #include <linux/threads.h>
@@ -19,6 +18,7 @@
 
 #include <asm/oprofile_impl.h>
 #include <asm/cputable.h>
+#include <asm/prom.h>          /* for PTRRELOC on ARCH=ppc */
 
 struct cpu_spec* cur_cpu_spec = NULL;
 EXPORT_SYMBOL(cur_cpu_spec);
@@ -30,11 +30,7 @@ EXPORT_SYMBOL(cur_cpu_spec);
  * part of the cputable though. That has to be fixed for both ppc32
  * and ppc64
  */
-#ifdef CONFIG_PPC64
-extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
-extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
-extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
-#else
+#ifdef CONFIG_PPC32
 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);
@@ -44,7 +40,13 @@ extern void __setup_cpu_7400(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_7410(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec);
 #endif /* CONFIG_PPC32 */
+#ifdef CONFIG_PPC64
 extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
+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);
+#endif /* CONFIG_PPC64 */
 
 /* This table only contains "desktop" CPUs, it need to be filled with embedded
  * ones as well...
@@ -53,8 +55,16 @@ extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
                                 PPC_FEATURE_HAS_MMU)
 #define COMMON_USER_PPC64      (COMMON_USER | PPC_FEATURE_64)
 #define COMMON_USER_POWER4     (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
-#define COMMON_USER_POWER5     (COMMON_USER_PPC64 | PPC_FEATURE_POWER5)
-#define COMMON_USER_POWER5_PLUS        (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS)
+#define COMMON_USER_POWER5     (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
+                                PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
+#define COMMON_USER_POWER5_PLUS        (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
+                                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)
+#define COMMON_USER_PA6T       (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
+                                PPC_FEATURE_TRUE_LE | \
+                                PPC_FEATURE_HAS_ALTIVEC_COMP)
 #define COMMON_USER_BOOKE      (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
                                 PPC_FEATURE_BOOKE)
 
@@ -67,20 +77,20 @@ extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
 #define PPC_FEATURE_SPE_COMP   0
 #endif
 
-struct cpu_spec        cpu_specs[] = {
+static struct cpu_spec cpu_specs[] = {
 #ifdef CONFIG_PPC64
        {       /* Power3 */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x00400000,
                .cpu_name               = "POWER3 (630)",
                .cpu_features           = CPU_FTRS_POWER3,
-               .cpu_user_features      = COMMON_USER_PPC64,
+               .cpu_user_features      = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
-               .cpu_setup              = __setup_cpu_power3,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power3",
-               .oprofile_type          = RS64,
+               .oprofile_type          = PPC_OPROFILE_RS64,
                .platform               = "power3",
        },
        {       /* Power3+ */
@@ -88,13 +98,13 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00410000,
                .cpu_name               = "POWER3 (630+)",
                .cpu_features           = CPU_FTRS_POWER3,
-               .cpu_user_features      = COMMON_USER_PPC64,
+               .cpu_user_features      = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
-               .cpu_setup              = __setup_cpu_power3,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power3",
-               .oprofile_type          = RS64,
+               .oprofile_type          = PPC_OPROFILE_RS64,
                .platform               = "power3",
        },
        {       /* Northstar */
@@ -106,9 +116,9 @@ struct cpu_spec     cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
-               .cpu_setup              = __setup_cpu_power3,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/rs64",
-               .oprofile_type          = RS64,
+               .oprofile_type          = PPC_OPROFILE_RS64,
                .platform               = "rs64",
        },
        {       /* Pulsar */
@@ -120,9 +130,9 @@ struct cpu_spec     cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
-               .cpu_setup              = __setup_cpu_power3,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/rs64",
-               .oprofile_type          = RS64,
+               .oprofile_type          = PPC_OPROFILE_RS64,
                .platform               = "rs64",
        },
        {       /* I-star */
@@ -134,9 +144,9 @@ struct cpu_spec     cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
-               .cpu_setup              = __setup_cpu_power3,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/rs64",
-               .oprofile_type          = RS64,
+               .oprofile_type          = PPC_OPROFILE_RS64,
                .platform               = "rs64",
        },
        {       /* S-star */
@@ -148,9 +158,9 @@ struct cpu_spec     cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
-               .cpu_setup              = __setup_cpu_power3,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/rs64",
-               .oprofile_type          = RS64,
+               .oprofile_type          = PPC_OPROFILE_RS64,
                .platform               = "rs64",
        },
        {       /* Power4 */
@@ -162,9 +172,9 @@ struct cpu_spec     cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
-               .cpu_setup              = __setup_cpu_power4,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power4",
-               .oprofile_type          = POWER4,
+               .oprofile_type          = PPC_OPROFILE_POWER4,
                .platform               = "power4",
        },
        {       /* Power4+ */
@@ -176,9 +186,9 @@ struct cpu_spec     cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
-               .cpu_setup              = __setup_cpu_power4,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power4",
-               .oprofile_type          = POWER4,
+               .oprofile_type          = PPC_OPROFILE_POWER4,
                .platform               = "power4",
        },
        {       /* PPC970 */
@@ -191,34 +201,46 @@ struct cpu_spec   cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
+               .pmc_type               = PPC_PMC_IBM,
                .cpu_setup              = __setup_cpu_ppc970,
+               .cpu_restore            = __restore_cpu_ppc970,
                .oprofile_cpu_type      = "ppc64/970",
-               .oprofile_type          = POWER4,
+               .oprofile_type          = PPC_OPROFILE_POWER4,
                .platform               = "ppc970",
        },
-#endif /* CONFIG_PPC64 */
-#if defined(CONFIG_PPC64) || defined(CONFIG_POWER4)
        {       /* PPC970FX */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x003c0000,
                .cpu_name               = "PPC970FX",
-#ifdef CONFIG_PPC32
-               .cpu_features           = CPU_FTRS_970_32,
-#else
                .cpu_features           = CPU_FTRS_PPC970,
-#endif
                .cpu_user_features      = COMMON_USER_POWER4 |
                        PPC_FEATURE_HAS_ALTIVEC_COMP,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 8,
+               .pmc_type               = PPC_PMC_IBM,
                .cpu_setup              = __setup_cpu_ppc970,
+               .cpu_restore            = __restore_cpu_ppc970,
                .oprofile_cpu_type      = "ppc64/970",
-               .oprofile_type          = POWER4,
+               .oprofile_type          = PPC_OPROFILE_POWER4,
+               .platform               = "ppc970",
+       },
+       {       /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
+               .pvr_mask               = 0xffffffff,
+               .pvr_value              = 0x00440100,
+               .cpu_name               = "PPC970MP",
+               .cpu_features           = CPU_FTRS_PPC970,
+               .cpu_user_features      = COMMON_USER_POWER4 |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .num_pmcs               = 8,
+               .cpu_setup              = __setup_cpu_ppc970,
+               .cpu_restore            = __restore_cpu_ppc970,
+               .oprofile_cpu_type      = "ppc64/970MP",
+               .oprofile_type          = PPC_OPROFILE_POWER4,
                .platform               = "ppc970",
        },
-#endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */
-#ifdef CONFIG_PPC64
        {       /* PPC970MP */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x00440000,
@@ -228,9 +250,27 @@ struct cpu_spec    cpu_specs[] = {
                        PPC_FEATURE_HAS_ALTIVEC_COMP,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
+               .num_pmcs               = 8,
+               .cpu_setup              = __setup_cpu_ppc970MP,
+               .cpu_restore            = __restore_cpu_ppc970,
+               .oprofile_cpu_type      = "ppc64/970MP",
+               .oprofile_type          = PPC_OPROFILE_POWER4,
+               .platform               = "ppc970",
+       },
+       {       /* PPC970GX */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x00450000,
+               .cpu_name               = "PPC970GX",
+               .cpu_features           = CPU_FTRS_PPC970,
+               .cpu_user_features      = COMMON_USER_POWER4 |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .num_pmcs               = 8,
+               .pmc_type               = PPC_PMC_IBM,
                .cpu_setup              = __setup_cpu_ppc970,
                .oprofile_cpu_type      = "ppc64/970",
-               .oprofile_type          = POWER4,
+               .oprofile_type          = PPC_OPROFILE_POWER4,
                .platform               = "ppc970",
        },
        {       /* Power5 GR */
@@ -242,9 +282,14 @@ struct cpu_spec    cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 6,
-               .cpu_setup              = __setup_cpu_power4,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power5",
-               .oprofile_type          = POWER4,
+               .oprofile_type          = PPC_OPROFILE_POWER4,
+               /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
+                * and above but only works on POWER5 and above
+                */
+               .oprofile_mmcra_sihv    = MMCRA_SIHV,
+               .oprofile_mmcra_sipr    = MMCRA_SIPR,
                .platform               = "power5",
        },
        {       /* Power5 GS */
@@ -256,23 +301,98 @@ struct cpu_spec   cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 6,
-               .cpu_setup              = __setup_cpu_power4,
+               .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power5+",
-               .oprofile_type          = POWER4,
+               .oprofile_type          = PPC_OPROFILE_POWER4,
+               .oprofile_mmcra_sihv    = MMCRA_SIHV,
+               .oprofile_mmcra_sipr    = MMCRA_SIPR,
                .platform               = "power5+",
        },
+       {       /* POWER6 in P5+ mode; 2.04-compliant processor */
+               .pvr_mask               = 0xffffffff,
+               .pvr_value              = 0x0f000001,
+               .cpu_name               = "POWER5+",
+               .cpu_features           = CPU_FTRS_POWER5,
+               .cpu_user_features      = COMMON_USER_POWER5_PLUS,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .num_pmcs               = 6,
+               .oprofile_cpu_type      = "ppc64/power6",
+               .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               = "power5+",
+       },
+       {       /* Power6 */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x003e0000,
+               .cpu_name               = "POWER6 (raw)",
+               .cpu_features           = CPU_FTRS_POWER6,
+               .cpu_user_features      = COMMON_USER_POWER6 |
+                       PPC_FEATURE_POWER6_EXT,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .num_pmcs               = 6,
+               .oprofile_cpu_type      = "ppc64/power6",
+               .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               = "power6x",
+       },
+       {       /* 2.05-compliant processor, i.e. Power6 "architected" mode */
+               .pvr_mask               = 0xffffffff,
+               .pvr_value              = 0x0f000002,
+               .cpu_name               = "POWER6 (architected)",
+               .cpu_features           = CPU_FTRS_POWER6,
+               .cpu_user_features      = COMMON_USER_POWER6,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .num_pmcs               = 6,
+               .pmc_type               = PPC_PMC_IBM,
+               .oprofile_cpu_type      = "ppc64/power6",
+               .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               = "power6",
+       },
        {       /* Cell Broadband Engine */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x00700000,
                .cpu_name               = "Cell Broadband Engine",
                .cpu_features           = CPU_FTRS_CELL,
                .cpu_user_features      = COMMON_USER_PPC64 |
-                       PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP,
+                       PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
+                       PPC_FEATURE_SMT,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
-               .cpu_setup              = __setup_cpu_be,
+               .num_pmcs               = 4,
+               .pmc_type               = PPC_PMC_IBM,
+               .oprofile_cpu_type      = "ppc64/cell-be",
+               .oprofile_type          = PPC_OPROFILE_CELL,
                .platform               = "ppc-cell-be",
        },
+       {       /* PA Semi PA6T */
+               .pvr_mask               = 0x7fff0000,
+               .pvr_value              = 0x00900000,
+               .cpu_name               = "PA6T",
+               .cpu_features           = CPU_FTRS_PA6T,
+               .cpu_user_features      = COMMON_USER_PA6T,
+               .icache_bsize           = 64,
+               .dcache_bsize           = 64,
+               .num_pmcs               = 6,
+               .pmc_type               = PPC_PMC_PA6T,
+               .cpu_setup              = __setup_cpu_pa6t,
+               .cpu_restore            = __restore_cpu_pa6t,
+               .oprofile_cpu_type      = "ppc64/pa6t",
+               .oprofile_type          = PPC_OPROFILE_PA6T,
+               .platform               = "pa6t",
+       },
        {       /* default match */
                .pvr_mask               = 0x00000000,
                .pvr_value              = 0x00000000,
@@ -282,7 +402,7 @@ struct cpu_spec     cpu_specs[] = {
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .num_pmcs               = 6,
-               .cpu_setup              = __setup_cpu_power4,
+               .pmc_type               = PPC_PMC_IBM,
                .platform               = "power4",
        }
 #endif /* CONFIG_PPC64 */
@@ -304,7 +424,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00030000,
                .cpu_name               = "603",
                .cpu_features           = CPU_FTRS_603,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .cpu_setup              = __setup_cpu_603,
@@ -315,7 +435,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00060000,
                .cpu_name               = "603e",
                .cpu_features           = CPU_FTRS_603,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .cpu_setup              = __setup_cpu_603,
@@ -326,7 +446,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00070000,
                .cpu_name               = "603ev",
                .cpu_features           = CPU_FTRS_603,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .cpu_setup              = __setup_cpu_603,
@@ -337,7 +457,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00040000,
                .cpu_name               = "604",
                .cpu_features           = CPU_FTRS_604,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 2,
@@ -349,7 +469,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00090000,
                .cpu_name               = "604e",
                .cpu_features           = CPU_FTRS_604,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -361,7 +481,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00090000,
                .cpu_name               = "604r",
                .cpu_features           = CPU_FTRS_604,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -373,7 +493,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x000a0000,
                .cpu_name               = "604ev",
                .cpu_features           = CPU_FTRS_604,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -385,7 +505,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00084202,
                .cpu_name               = "740/750",
                .cpu_features           = CPU_FTRS_740_NOTAU,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -397,7 +517,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00080100,
                .cpu_name               = "750CX",
                .cpu_features           = CPU_FTRS_750,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -409,7 +529,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00082200,
                .cpu_name               = "750CX",
                .cpu_features           = CPU_FTRS_750,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -421,7 +541,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00082210,
                .cpu_name               = "750CXe",
                .cpu_features           = CPU_FTRS_750,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -433,19 +553,31 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x00083214,
                .cpu_name               = "750CXe",
                .cpu_features           = CPU_FTRS_750,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
                .cpu_setup              = __setup_cpu_750cx,
                .platform               = "ppc750",
        },
+       {       /* 750CL */
+               .pvr_mask               = 0xfffff0f0,
+               .pvr_value              = 0x00087010,
+               .cpu_name               = "750CL",
+               .cpu_features           = CPU_FTRS_750CL,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .num_pmcs               = 4,
+               .cpu_setup              = __setup_cpu_750,
+               .platform               = "ppc750",
+       },
        {       /* 745/755 */
                .pvr_mask               = 0xfffff000,
                .pvr_value              = 0x00083000,
                .cpu_name               = "745/755",
                .cpu_features           = CPU_FTRS_750,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -457,7 +589,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x70000100,
                .cpu_name               = "750FX",
                .cpu_features           = CPU_FTRS_750FX1,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -469,7 +601,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x70000200,
                .cpu_name               = "750FX",
                .cpu_features           = CPU_FTRS_750FX2,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -481,7 +613,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x70000000,
                .cpu_name               = "750FX",
                .cpu_features           = CPU_FTRS_750FX,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -493,7 +625,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x70020000,
                .cpu_name               = "750GX",
                .cpu_features           = CPU_FTRS_750GX,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -505,7 +637,7 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x00080000,
                .cpu_name               = "740/750",
                .cpu_features           = CPU_FTRS_740,
-               .cpu_user_features      = COMMON_USER,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -517,7 +649,8 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x000c1101,
                .cpu_name               = "7400 (1.1)",
                .cpu_features           = CPU_FTRS_7400_NOTAU,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -529,7 +662,8 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x000c0000,
                .cpu_name               = "7400",
                .cpu_features           = CPU_FTRS_7400,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -541,7 +675,8 @@ struct cpu_spec     cpu_specs[] = {
                .pvr_value              = 0x800c0000,
                .cpu_name               = "7410",
                .cpu_features           = CPU_FTRS_7400,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
@@ -553,13 +688,14 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80000200,
                .cpu_name               = "7450",
                .cpu_features           = CPU_FTRS_7450_20,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7450 2.1 */
@@ -567,13 +703,14 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80000201,
                .cpu_name               = "7450",
                .cpu_features           = CPU_FTRS_7450_21,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7450 2.3 and newer */
@@ -581,13 +718,14 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80000000,
                .cpu_name               = "7450",
                .cpu_features           = CPU_FTRS_7450_23,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7455 rev 1.x */
@@ -595,13 +733,14 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80010100,
                .cpu_name               = "7455",
                .cpu_features           = CPU_FTRS_7455_1,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7455 rev 2.0 */
@@ -609,13 +748,14 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80010200,
                .cpu_name               = "7455",
                .cpu_features           = CPU_FTRS_7455_20,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7455 others */
@@ -623,13 +763,14 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80010000,
                .cpu_name               = "7455",
                .cpu_features           = CPU_FTRS_7455,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7447/7457 Rev 1.0 */
@@ -637,13 +778,14 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80020100,
                .cpu_name               = "7447/7457",
                .cpu_features           = CPU_FTRS_7447_10,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7447/7457 Rev 1.1 */
@@ -651,13 +793,14 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80020101,
                .cpu_name               = "7447/7457",
                .cpu_features           = CPU_FTRS_7447_10,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7447/7457 Rev 1.2 and later */
@@ -665,13 +808,13 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80020000,
                .cpu_name               = "7447/7457",
                .cpu_features           = CPU_FTRS_7447,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7447A */
@@ -679,27 +822,29 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_value              = 0x80030000,
                .cpu_name               = "7447A",
                .cpu_features           = CPU_FTRS_7447A,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 7448 */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x80040000,
                .cpu_name               = "7448",
-               .cpu_features           = CPU_FTRS_7447A,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .cpu_features           = CPU_FTRS_7448,
+               .cpu_user_features      = COMMON_USER |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
                .num_pmcs               = 6,
                .cpu_setup              = __setup_cpu_745x,
                .oprofile_cpu_type      = "ppc/7450",
-               .oprofile_type          = G4,
+               .oprofile_type          = PPC_OPROFILE_G4,
                .platform               = "ppc7450",
        },
        {       /* 82xx (8240, 8245, 8260 are all 603e cores) */
@@ -724,10 +869,32 @@ struct cpu_spec   cpu_specs[] = {
                .cpu_setup              = __setup_cpu_603,
                .platform               = "ppc603",
        },
-       {       /* e300 (a 603e core, plus some) on 83xx */
+       {       /* e300c1 (a 603e core, plus some) on 83xx */
                .pvr_mask               = 0x7fff0000,
                .pvr_value              = 0x00830000,
-               .cpu_name               = "e300",
+               .cpu_name               = "e300c1",
+               .cpu_features           = CPU_FTRS_E300,
+               .cpu_user_features      = COMMON_USER,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_603,
+               .platform               = "ppc603",
+       },
+       {       /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
+               .pvr_mask               = 0x7fff0000,
+               .pvr_value              = 0x00840000,
+               .cpu_name               = "e300c2",
+               .cpu_features           = CPU_FTRS_E300C2,
+               .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_603,
+               .platform               = "ppc603",
+       },
+       {       /* e300c3 on 83xx  */
+               .pvr_mask               = 0x7fff0000,
+               .pvr_value              = 0x00850000,
+               .cpu_name               = "e300c3",
                .cpu_features           = CPU_FTRS_E300,
                .cpu_user_features      = COMMON_USER,
                .icache_bsize           = 32,
@@ -891,7 +1058,7 @@ struct cpu_spec    cpu_specs[] = {
                .platform               = "ppc405",
        },
        {       /* Xilinx Virtex-II Pro  */
-               .pvr_mask               = 0xffff0000,
+               .pvr_mask               = 0xfffff000,
                .pvr_value              = 0x20010000,
                .cpu_name               = "Virtex-II Pro",
                .cpu_features           = CPU_FTRS_40X,
@@ -901,6 +1068,17 @@ struct cpu_spec   cpu_specs[] = {
                .dcache_bsize           = 32,
                .platform               = "ppc405",
        },
+       {       /* Xilinx Virtex-4 FX */
+               .pvr_mask               = 0xfffff000,
+               .pvr_value              = 0x20011000,
+               .cpu_name               = "Virtex-4 FX",
+               .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,
+               .platform               = "ppc405",
+       },
        {       /* 405EP */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x51210000,
@@ -1009,8 +1187,7 @@ struct cpu_spec   cpu_specs[] = {
                .pvr_mask               = 0xff000fff,
                .pvr_value              = 0x53000890,
                .cpu_name               = "440SPe Rev. A",
-               .cpu_features           = CPU_FTR_SPLIT_ID_CACHE |
-                       CPU_FTR_USE_TB,
+               .cpu_features           = CPU_FTRS_44X,
                .cpu_user_features      = COMMON_USER_BOOKE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
@@ -1056,7 +1233,7 @@ struct cpu_spec   cpu_specs[] = {
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
                .oprofile_cpu_type      = "ppc/e500",
-               .oprofile_type          = BOOKE,
+               .oprofile_type          = PPC_OPROFILE_BOOKE,
                .platform               = "ppc8540",
        },
        {       /* e500v2 */
@@ -1073,7 +1250,7 @@ struct cpu_spec   cpu_specs[] = {
                .dcache_bsize           = 32,
                .num_pmcs               = 4,
                .oprofile_cpu_type      = "ppc/e500",
-               .oprofile_type          = BOOKE,
+               .oprofile_type          = PPC_OPROFILE_BOOKE,
                .platform               = "ppc8548",
        },
 #endif
@@ -1091,3 +1268,67 @@ struct cpu_spec  cpu_specs[] = {
 #endif /* !CLASSIC_PPC */
 #endif /* CONFIG_PPC32 */
 };
+
+struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
+{
+       struct cpu_spec *s = cpu_specs;
+       struct cpu_spec **cur = &cur_cpu_spec;
+       int i;
+
+       s = PTRRELOC(s);
+       cur = PTRRELOC(cur);
+
+       for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
+               if ((pvr & s->pvr_mask) == s->pvr_value) {
+                       *cur = cpu_specs + i;
+#ifdef CONFIG_PPC64
+                       /* ppc64 expects identify_cpu to also call setup_cpu
+                        * for that processor. I will consolidate that at a
+                        * later time, for now, just use our friend #ifdef.
+                        * we also don't need to PTRRELOC the function pointer
+                        * on ppc64 as we are running at 0 in real mode.
+                        */
+                       if (s->cpu_setup) {
+                               s->cpu_setup(offset, s);
+                       }
+#endif /* CONFIG_PPC64 */
+                       return s;
+               }
+       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");
+       }
+}