Delete old junk.
[safe/jmp/linux-2.6] / arch / mips / kernel / cpu-probe.c
index ba2dbc2..5d71eca 100644 (file)
@@ -53,14 +53,13 @@ static void r4k_wait(void)
 /* The Au1xxx wait is available only if using 32khz counter or
  * external timer source, but specifically not CP0 Counter. */
 int allow_au1k_wait;
+
 static void au1k_wait(void)
 {
-       unsigned long addr = 0;
        /* using the wait instruction makes CP0 counter unusable */
-       __asm__("la %0,au1k_wait\n\t"
-               ".set mips3\n\t"
-               "cache 0x14,0(%0)\n\t"
-               "cache 0x14,32(%0)\n\t"
+       __asm__(".set mips3\n\t"
+               "cache 0x14, 0(%0)\n\t"
+               "cache 0x14, 32(%0)\n\t"
                "sync\n\t"
                "nop\n\t"
                "wait\n\t"
@@ -69,14 +68,30 @@ static void au1k_wait(void)
                "nop\n\t"
                "nop\n\t"
                ".set mips0\n\t"
-               : : "r" (addr));
+               : : "r" (au1k_wait));
 }
 
+static int __initdata nowait = 0;
+
+int __init wait_disable(char *s)
+{
+       nowait = 1;
+
+       return 1;
+}
+
+__setup("nowait", wait_disable);
+
 static inline void check_wait(void)
 {
        struct cpuinfo_mips *c = &current_cpu_data;
 
        printk("Checking for 'wait' instruction... ");
+       if (nowait) {
+               printk (" disabled.\n");
+               return;
+       }
+
        switch (c->cputype) {
        case CPU_R3081:
        case CPU_R3081E:
@@ -105,6 +120,8 @@ static inline void check_wait(void)
 /*     case CPU_20KC:*/
        case CPU_24K:
        case CPU_25KF:
+       case CPU_34K:
+       case CPU_PR4450:
                cpu_wait = r4k_wait;
                printk(" available.\n");
                break;
@@ -260,7 +277,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
        case PRID_IMP_R4600:
                c->cputype = CPU_R4600;
                c->isa_level = MIPS_CPU_ISA_III;
-               c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC;
+               c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
+                            MIPS_CPU_LLSC;
                c->tlbsize = 48;
                break;
        #if 0
@@ -423,7 +441,7 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c)
        config0 = read_c0_config();
 
        if (((config0 & MIPS_CONF_MT) >> 7) == 1)
-               c->options |= MIPS_CPU_TLB;
+               c->options |= MIPS_CPU_TLB | MIPS_CPU_4KTLB;
        isa = (config0 & MIPS_CONF_AT) >> 13;
        switch (isa) {
        case 0:
@@ -483,6 +501,14 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
 
        if (config3 & MIPS_CONF3_SM)
                c->ases |= MIPS_ASE_SMARTMIPS;
+       if (config3 & MIPS_CONF3_DSP)
+               c->ases |= MIPS_ASE_DSP;
+       if (config3 & MIPS_CONF3_VINT)
+               c->options |= MIPS_CPU_VINT;
+       if (config3 & MIPS_CONF3_VEIC)
+               c->options |= MIPS_CPU_VEIC;
+       if (config3 & MIPS_CONF3_MT)
+                c->ases |= MIPS_ASE_MIPSMT;
 
        return config3 & MIPS_CONF_M;
 }
@@ -509,8 +535,6 @@ static inline void decode_configs(struct cpuinfo_mips *c)
 static inline void cpu_probe_mips(struct cpuinfo_mips *c)
 {
        decode_configs(c);
-       if (cpu_has_tlb)
-               c->options |= MIPS_CPU_4KTLB;
        switch (c->processor_id & 0xff00) {
        case PRID_IMP_4KC:
                c->cputype = CPU_4KC;
@@ -531,6 +555,7 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c)
                c->cputype = CPU_20KC;
                break;
        case PRID_IMP_24K:
+       case PRID_IMP_24KE:
                c->cputype = CPU_24K;
                break;
        case PRID_IMP_25KF:
@@ -538,6 +563,10 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c)
                /* Probe for L2 cache */
                c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
                break;
+       case PRID_IMP_34K:
+               c->cputype = CPU_34K;
+               c->isa_level = MIPS_CPU_ISA_M32;
+               break;
        }
 }
 
@@ -588,8 +617,6 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
 static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c)
 {
        decode_configs(c);
-       if (cpu_has_tlb)
-               c->options |= MIPS_CPU_4KTLB;
        switch (c->processor_id & 0xff00) {
        case PRID_IMP_SR71000:
                c->cputype = CPU_SR71000;
@@ -599,6 +626,21 @@ static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c)
        }
 }
 
+static inline void cpu_probe_philips(struct cpuinfo_mips *c)
+{
+       decode_configs(c);
+       switch (c->processor_id & 0xff00) {
+       case PRID_IMP_PR4450:
+               c->cputype = CPU_PR4450;
+               c->isa_level = MIPS_CPU_ISA_M32;
+               break;
+       default:
+               panic("Unknown Philips Core!"); /* REVISIT: die? */
+               break;
+       }
+}
+
+
 __init void cpu_probe(void)
 {
        struct cpuinfo_mips *c = &current_cpu_data;
@@ -624,6 +666,9 @@ __init void cpu_probe(void)
        case PRID_COMP_SANDCRAFT:
                cpu_probe_sandcraft(c);
                break;
+       case PRID_COMP_PHILIPS:
+               cpu_probe_philips(c);
+               break;
        default:
                c->cputype = CPU_UNKNOWN;
        }