Lines Matching refs:c
87 static int set_ftlb_enable(struct cpuinfo_mips *c, enum ftlb_flags flags);
144 static inline void cpu_set_mt_per_tc_perf(struct cpuinfo_mips *c) in cpu_set_mt_per_tc_perf() argument
147 c->options |= MIPS_CPU_MT_PER_TC_PERF_COUNTERS; in cpu_set_mt_per_tc_perf()
152 struct cpuinfo_mips *c = ¤t_cpu_data; in check_errata() local
161 if ((c->processor_id & PRID_REV_MASK) <= PRID_REV_34K_V1_0_2) in check_errata()
209 static inline void cpu_probe_vmbits(struct cpuinfo_mips *c) in cpu_probe_vmbits() argument
214 c->vmbits = fls64(read_c0_entryhi() & 0x3fffffffffffe000ULL); in cpu_probe_vmbits()
218 static void set_isa(struct cpuinfo_mips *c, unsigned int isa) in set_isa() argument
222 c->isa_level |= MIPS_CPU_ISA_M32R5 | MIPS_CPU_ISA_M64R5; in set_isa()
226 c->isa_level |= MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2; in set_isa()
230 c->isa_level |= MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1; in set_isa()
234 c->isa_level |= MIPS_CPU_ISA_V; in set_isa()
238 c->isa_level |= MIPS_CPU_ISA_IV; in set_isa()
242 c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III; in set_isa()
248 c->isa_level |= MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6; in set_isa()
252 c->isa_level |= MIPS_CPU_ISA_M32R6; in set_isa()
257 c->isa_level |= MIPS_CPU_ISA_M32R5; in set_isa()
261 c->isa_level |= MIPS_CPU_ISA_M32R2; in set_isa()
265 c->isa_level |= MIPS_CPU_ISA_M32R1; in set_isa()
269 c->isa_level |= MIPS_CPU_ISA_II; in set_isa()
278 static unsigned int calculate_ftlb_probability(struct cpuinfo_mips *c) in calculate_ftlb_probability() argument
281 unsigned int probability = c->tlbsize / c->tlbsizevtlb; in calculate_ftlb_probability()
304 static int set_ftlb_enable(struct cpuinfo_mips *c, enum ftlb_flags flags) in set_ftlb_enable() argument
309 switch (c->cputype) { in set_ftlb_enable()
323 config |= calculate_ftlb_probability(c) in set_ftlb_enable()
356 static int mm_config(struct cpuinfo_mips *c) in mm_config() argument
370 switch (c->cputype) { in mm_config()
376 c->options |= MIPS_CPU_MM_FULL; in mm_config()
394 c->options |= MIPS_CPU_MM_SYSAD; in mm_config()
396 c->options |= MIPS_CPU_MM_FULL; in mm_config()
402 static inline unsigned int decode_config0(struct cpuinfo_mips *c) in decode_config0() argument
414 c->options |= MIPS_CPU_TLB; in decode_config0()
416 c->options |= MIPS_CPU_TLB | MIPS_CPU_FTLB; in decode_config0()
423 set_isa(c, MIPS_CPU_ISA_M32R1); in decode_config0()
426 set_isa(c, MIPS_CPU_ISA_M32R2); in decode_config0()
429 set_isa(c, MIPS_CPU_ISA_M32R6); in decode_config0()
438 set_isa(c, MIPS_CPU_ISA_M64R1); in decode_config0()
441 set_isa(c, MIPS_CPU_ISA_M64R2); in decode_config0()
444 set_isa(c, MIPS_CPU_ISA_M64R6); in decode_config0()
460 static inline unsigned int decode_config1(struct cpuinfo_mips *c) in decode_config1() argument
467 c->ases |= MIPS_ASE_MDMX; in decode_config1()
469 c->options |= MIPS_CPU_PERF; in decode_config1()
471 c->options |= MIPS_CPU_WATCH; in decode_config1()
473 c->ases |= MIPS_ASE_MIPS16; in decode_config1()
475 c->options |= MIPS_CPU_EJTAG; in decode_config1()
477 c->options |= MIPS_CPU_FPU; in decode_config1()
478 c->options |= MIPS_CPU_32FPR; in decode_config1()
481 c->tlbsize = ((config1 & MIPS_CONF1_TLBS) >> 25) + 1; in decode_config1()
482 c->tlbsizevtlb = c->tlbsize; in decode_config1()
483 c->tlbsizeftlbsets = 0; in decode_config1()
489 static inline unsigned int decode_config2(struct cpuinfo_mips *c) in decode_config2() argument
496 c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; in decode_config2()
501 static inline unsigned int decode_config3(struct cpuinfo_mips *c) in decode_config3() argument
508 c->ases |= MIPS_ASE_SMARTMIPS; in decode_config3()
509 c->options |= MIPS_CPU_RIXI | MIPS_CPU_CTXTC; in decode_config3()
512 c->options |= MIPS_CPU_RIXI; in decode_config3()
514 c->options |= MIPS_CPU_CTXTC; in decode_config3()
516 c->ases |= MIPS_ASE_DSP; in decode_config3()
518 c->ases |= MIPS_ASE_DSP2P; in decode_config3()
520 c->ases |= MIPS_ASE_DSP3; in decode_config3()
523 c->options |= MIPS_CPU_VINT; in decode_config3()
525 c->options |= MIPS_CPU_VEIC; in decode_config3()
527 c->options |= MIPS_CPU_LPA; in decode_config3()
529 c->ases |= MIPS_ASE_MIPSMT; in decode_config3()
531 c->options |= MIPS_CPU_ULRI; in decode_config3()
533 c->options |= MIPS_CPU_MICROMIPS; in decode_config3()
535 c->ases |= MIPS_ASE_VZ; in decode_config3()
537 c->options |= MIPS_CPU_SEGMENTS; in decode_config3()
539 c->options |= MIPS_CPU_BADINSTR; in decode_config3()
541 c->options |= MIPS_CPU_BADINSTRP; in decode_config3()
543 c->ases |= MIPS_ASE_MSA; in decode_config3()
545 c->htw_seq = 0; in decode_config3()
546 c->options |= MIPS_CPU_HTW; in decode_config3()
549 c->options |= MIPS_CPU_CDMM; in decode_config3()
551 c->options |= MIPS_CPU_SP; in decode_config3()
556 static inline unsigned int decode_config4(struct cpuinfo_mips *c) in decode_config4() argument
568 c->options |= MIPS_CPU_TLBINV; in decode_config4()
584 c->tlbsize += (config4 & MIPS_CONF4_MMUSIZEEXT) * 0x40; in decode_config4()
585 c->tlbsizevtlb = c->tlbsize; in decode_config4()
588 c->tlbsizevtlb += in decode_config4()
591 c->tlbsize = c->tlbsizevtlb; in decode_config4()
607 set_ftlb_enable(c, 0); in decode_config4()
611 c->tlbsizeftlbsets = 1 << in decode_config4()
614 c->tlbsizeftlbways = ((config4 & MIPS_CONF4_FTLBWAYS) >> in decode_config4()
616 c->tlbsize += c->tlbsizeftlbways * c->tlbsizeftlbsets; in decode_config4()
622 c->kscratch_mask = (config4 & MIPS_CONF4_KSCREXIST) in decode_config4()
628 set_cpu_asid_mask(c, asid_mask); in decode_config4()
635 WARN_ON(asid_mask != cpu_asid_mask(c)); in decode_config4()
640 static inline unsigned int decode_config5(struct cpuinfo_mips *c) in decode_config5() argument
658 c->options |= MIPS_CPU_EVA; in decode_config5()
660 c->options |= MIPS_CPU_MAAR; in decode_config5()
662 c->options |= MIPS_CPU_RW_LLB; in decode_config5()
664 c->options |= MIPS_CPU_MVH; in decode_config5()
666 c->options |= MIPS_CPU_VP; in decode_config5()
668 c->ases |= MIPS_ASE_MIPS16E2; in decode_config5()
680 c->options |= MIPS_CPU_MMID; in decode_config5()
713 set_cpu_asid_mask(c, asid_mask); in decode_config5()
720 static void decode_configs(struct cpuinfo_mips *c) in decode_configs() argument
725 c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER | in decode_configs()
728 c->scache.flags = MIPS_CACHE_NOT_PRESENT; in decode_configs()
731 set_ftlb_enable(c, mips_ftlb_disabled ? 0 : FTLB_EN); in decode_configs()
733 ok = decode_config0(c); /* Read Config registers. */ in decode_configs()
736 ok = decode_config1(c); in decode_configs()
738 ok = decode_config2(c); in decode_configs()
740 ok = decode_config3(c); in decode_configs()
742 ok = decode_config4(c); in decode_configs()
744 ok = decode_config5(c); in decode_configs()
756 c->options |= MIPS_CPU_EBASE_WG; in decode_configs()
775 c->options |= MIPS_CPU_EBASE_WG; in decode_configs()
782 set_ftlb_enable(c, (mips_ftlb_disabled ? 0 : FTLB_EN) | FTLB_SET_PROB); in decode_configs()
784 mips_probe_watch_registers(c); in decode_configs()
793 cpu_set_core(c, core); in decode_configs()
826 static inline unsigned int decode_guest_config0(struct cpuinfo_mips *c) in decode_guest_config0() argument
833 c->guest.conf |= BIT(1); in decode_guest_config0()
837 static inline unsigned int decode_guest_config1(struct cpuinfo_mips *c) in decode_guest_config1() argument
846 c->guest.options |= MIPS_CPU_FPU; in decode_guest_config1()
848 c->guest.options_dyn |= MIPS_CPU_FPU; in decode_guest_config1()
851 c->guest.options |= MIPS_CPU_WATCH; in decode_guest_config1()
853 c->guest.options_dyn |= MIPS_CPU_WATCH; in decode_guest_config1()
856 c->guest.options |= MIPS_CPU_PERF; in decode_guest_config1()
858 c->guest.options_dyn |= MIPS_CPU_PERF; in decode_guest_config1()
861 c->guest.conf |= BIT(2); in decode_guest_config1()
865 static inline unsigned int decode_guest_config2(struct cpuinfo_mips *c) in decode_guest_config2() argument
872 c->guest.conf |= BIT(3); in decode_guest_config2()
876 static inline unsigned int decode_guest_config3(struct cpuinfo_mips *c) in decode_guest_config3() argument
885 c->guest.options |= MIPS_CPU_CTXTC; in decode_guest_config3()
887 c->guest.options_dyn |= MIPS_CPU_CTXTC; in decode_guest_config3()
890 c->guest.options |= MIPS_CPU_HTW; in decode_guest_config3()
893 c->guest.options |= MIPS_CPU_ULRI; in decode_guest_config3()
896 c->guest.options |= MIPS_CPU_SEGMENTS; in decode_guest_config3()
899 c->guest.options |= MIPS_CPU_BADINSTR; in decode_guest_config3()
901 c->guest.options |= MIPS_CPU_BADINSTRP; in decode_guest_config3()
904 c->guest.ases |= MIPS_ASE_MSA; in decode_guest_config3()
906 c->guest.ases_dyn |= MIPS_ASE_MSA; in decode_guest_config3()
909 c->guest.conf |= BIT(4); in decode_guest_config3()
913 static inline unsigned int decode_guest_config4(struct cpuinfo_mips *c) in decode_guest_config4() argument
920 c->guest.kscratch_mask = (config4 & MIPS_CONF4_KSCREXIST) in decode_guest_config4()
924 c->guest.conf |= BIT(5); in decode_guest_config4()
928 static inline unsigned int decode_guest_config5(struct cpuinfo_mips *c) in decode_guest_config5() argument
936 c->guest.options |= MIPS_CPU_MAAR; in decode_guest_config5()
938 c->guest.options_dyn |= MIPS_CPU_MAAR; in decode_guest_config5()
941 c->guest.options |= MIPS_CPU_RW_LLB; in decode_guest_config5()
944 c->guest.options |= MIPS_CPU_MVH; in decode_guest_config5()
947 c->guest.conf |= BIT(6); in decode_guest_config5()
951 static inline void decode_guest_configs(struct cpuinfo_mips *c) in decode_guest_configs() argument
955 ok = decode_guest_config0(c); in decode_guest_configs()
957 ok = decode_guest_config1(c); in decode_guest_configs()
959 ok = decode_guest_config2(c); in decode_guest_configs()
961 ok = decode_guest_config3(c); in decode_guest_configs()
963 ok = decode_guest_config4(c); in decode_guest_configs()
965 decode_guest_config5(c); in decode_guest_configs()
968 static inline void cpu_probe_guestctl0(struct cpuinfo_mips *c) in cpu_probe_guestctl0() argument
975 c->options |= MIPS_CPU_GUESTCTL0EXT; in cpu_probe_guestctl0()
977 c->options |= MIPS_CPU_GUESTCTL1; in cpu_probe_guestctl0()
979 c->options |= MIPS_CPU_GUESTCTL2; in cpu_probe_guestctl0()
981 c->options |= MIPS_CPU_GUESTID; in cpu_probe_guestctl0()
997 c->options |= MIPS_CPU_DRG; in cpu_probe_guestctl0()
1002 static inline void cpu_probe_guestctl1(struct cpuinfo_mips *c) in cpu_probe_guestctl1() argument
1008 c->guestid_mask = (read_c0_guestctl1() & MIPS_GCTL1_ID) in cpu_probe_guestctl1()
1014 static inline void cpu_probe_gtoffset(struct cpuinfo_mips *c) in cpu_probe_gtoffset() argument
1019 c->gtoffset_mask = read_c0_gtoffset(); in cpu_probe_gtoffset()
1023 static inline void cpu_probe_vz(struct cpuinfo_mips *c) in cpu_probe_vz() argument
1025 cpu_probe_guestctl0(c); in cpu_probe_vz()
1027 cpu_probe_guestctl1(c); in cpu_probe_vz()
1029 cpu_probe_gtoffset(c); in cpu_probe_vz()
1031 decode_guest_configs(c); in cpu_probe_vz()
1037 static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_legacy() argument
1039 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_legacy()
1041 c->cputype = CPU_R2000; in cpu_probe_legacy()
1043 c->fpu_msk31 |= FPU_CSR_CONDX | FPU_CSR_FS; in cpu_probe_legacy()
1044 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | in cpu_probe_legacy()
1047 c->options |= MIPS_CPU_FPU; in cpu_probe_legacy()
1048 c->tlbsize = 64; in cpu_probe_legacy()
1051 if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) { in cpu_probe_legacy()
1053 c->cputype = CPU_R3081E; in cpu_probe_legacy()
1056 c->cputype = CPU_R3000A; in cpu_probe_legacy()
1060 c->cputype = CPU_R3000; in cpu_probe_legacy()
1063 c->fpu_msk31 |= FPU_CSR_CONDX | FPU_CSR_FS; in cpu_probe_legacy()
1064 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | in cpu_probe_legacy()
1067 c->options |= MIPS_CPU_FPU; in cpu_probe_legacy()
1068 c->tlbsize = 64; in cpu_probe_legacy()
1072 if ((c->processor_id & PRID_REV_MASK) >= in cpu_probe_legacy()
1074 c->cputype = CPU_R4400PC; in cpu_probe_legacy()
1077 c->cputype = CPU_R4000PC; in cpu_probe_legacy()
1101 if ((c->processor_id & PRID_REV_MASK) >= in cpu_probe_legacy()
1103 c->cputype = mc ? CPU_R4400MC : CPU_R4400SC; in cpu_probe_legacy()
1106 c->cputype = mc ? CPU_R4000MC : CPU_R4000SC; in cpu_probe_legacy()
1111 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1112 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1113 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1116 c->tlbsize = 48; in cpu_probe_legacy()
1119 c->cputype = CPU_R4300; in cpu_probe_legacy()
1121 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1122 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1123 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1125 c->tlbsize = 32; in cpu_probe_legacy()
1128 c->cputype = CPU_R4600; in cpu_probe_legacy()
1130 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1131 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1132 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1134 c->tlbsize = 48; in cpu_probe_legacy()
1144 c->cputype = CPU_R4650; in cpu_probe_legacy()
1146 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1147 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1148 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC; in cpu_probe_legacy()
1149 c->tlbsize = 48; in cpu_probe_legacy()
1153 c->cputype = CPU_R4700; in cpu_probe_legacy()
1155 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1156 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1157 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1159 c->tlbsize = 48; in cpu_probe_legacy()
1162 c->cputype = CPU_TX49XX; in cpu_probe_legacy()
1164 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1165 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1166 c->options = R4K_OPTS | MIPS_CPU_LLSC; in cpu_probe_legacy()
1167 if (!(c->processor_id & 0x08)) in cpu_probe_legacy()
1168 c->options |= MIPS_CPU_FPU | MIPS_CPU_32FPR; in cpu_probe_legacy()
1169 c->tlbsize = 48; in cpu_probe_legacy()
1172 c->cputype = CPU_R5000; in cpu_probe_legacy()
1174 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1175 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1177 c->tlbsize = 48; in cpu_probe_legacy()
1180 c->cputype = CPU_R5500; in cpu_probe_legacy()
1182 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1183 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1185 c->tlbsize = 48; in cpu_probe_legacy()
1188 c->cputype = CPU_NEVADA; in cpu_probe_legacy()
1190 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1191 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1193 c->tlbsize = 48; in cpu_probe_legacy()
1196 c->cputype = CPU_RM7000; in cpu_probe_legacy()
1198 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1199 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1209 c->tlbsize = (read_c0_info() & (1 << 29)) ? 64 : 48; in cpu_probe_legacy()
1212 c->cputype = CPU_R10000; in cpu_probe_legacy()
1214 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1215 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | in cpu_probe_legacy()
1219 c->tlbsize = 64; in cpu_probe_legacy()
1222 c->cputype = CPU_R12000; in cpu_probe_legacy()
1224 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1225 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | in cpu_probe_legacy()
1229 c->tlbsize = 64; in cpu_probe_legacy()
1233 if (((c->processor_id >> 4) & 0x0f) > 2) { in cpu_probe_legacy()
1234 c->cputype = CPU_R16000; in cpu_probe_legacy()
1237 c->cputype = CPU_R14000; in cpu_probe_legacy()
1240 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1241 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | in cpu_probe_legacy()
1245 c->tlbsize = 64; in cpu_probe_legacy()
1249 switch (c->processor_id & PRID_REV_MASK) { in cpu_probe_legacy()
1251 c->cputype = CPU_LOONGSON2EF; in cpu_probe_legacy()
1254 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1255 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1258 c->cputype = CPU_LOONGSON2EF; in cpu_probe_legacy()
1261 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1262 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1265 c->cputype = CPU_LOONGSON64; in cpu_probe_legacy()
1268 set_isa(c, MIPS_CPU_ISA_M64R1); in cpu_probe_legacy()
1269 c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM | in cpu_probe_legacy()
1274 c->cputype = CPU_LOONGSON64; in cpu_probe_legacy()
1277 set_isa(c, MIPS_CPU_ISA_M64R1); in cpu_probe_legacy()
1278 c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM | in cpu_probe_legacy()
1283 c->options = R4K_OPTS | in cpu_probe_legacy()
1286 c->tlbsize = 64; in cpu_probe_legacy()
1287 set_cpu_asid_mask(c, MIPS_ENTRYHI_ASID); in cpu_probe_legacy()
1288 c->writecombine = _CACHE_UNCACHED_ACCELERATED; in cpu_probe_legacy()
1291 decode_configs(c); in cpu_probe_legacy()
1293 c->cputype = CPU_LOONGSON32; in cpu_probe_legacy()
1295 switch (c->processor_id & PRID_REV_MASK) { in cpu_probe_legacy()
1305 static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_mips() argument
1307 c->writecombine = _CACHE_UNCACHED_ACCELERATED; in cpu_probe_mips()
1308 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_mips()
1310 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1311 c->cputype = CPU_QEMU_GENERIC; in cpu_probe_mips()
1315 c->cputype = CPU_4KC; in cpu_probe_mips()
1316 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1321 c->cputype = CPU_4KEC; in cpu_probe_mips()
1322 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1327 c->cputype = CPU_4KSC; in cpu_probe_mips()
1328 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1332 c->cputype = CPU_5KC; in cpu_probe_mips()
1333 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1337 c->cputype = CPU_5KE; in cpu_probe_mips()
1338 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1342 c->cputype = CPU_20KC; in cpu_probe_mips()
1343 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1347 c->cputype = CPU_24K; in cpu_probe_mips()
1348 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1352 c->cputype = CPU_24K; in cpu_probe_mips()
1353 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1357 c->cputype = CPU_25KF; in cpu_probe_mips()
1358 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1362 c->cputype = CPU_34K; in cpu_probe_mips()
1363 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1365 cpu_set_mt_per_tc_perf(c); in cpu_probe_mips()
1368 c->cputype = CPU_74K; in cpu_probe_mips()
1369 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1373 c->cputype = CPU_M14KC; in cpu_probe_mips()
1374 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1378 c->cputype = CPU_M14KEC; in cpu_probe_mips()
1379 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1383 c->cputype = CPU_1004K; in cpu_probe_mips()
1384 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1386 cpu_set_mt_per_tc_perf(c); in cpu_probe_mips()
1389 c->cputype = CPU_1074K; in cpu_probe_mips()
1390 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1394 c->cputype = CPU_INTERAPTIV; in cpu_probe_mips()
1396 cpu_set_mt_per_tc_perf(c); in cpu_probe_mips()
1399 c->cputype = CPU_INTERAPTIV; in cpu_probe_mips()
1401 cpu_set_mt_per_tc_perf(c); in cpu_probe_mips()
1404 c->cputype = CPU_PROAPTIV; in cpu_probe_mips()
1408 c->cputype = CPU_PROAPTIV; in cpu_probe_mips()
1412 c->cputype = CPU_P5600; in cpu_probe_mips()
1416 c->cputype = CPU_P6600; in cpu_probe_mips()
1420 c->cputype = CPU_I6400; in cpu_probe_mips()
1424 c->cputype = CPU_I6500; in cpu_probe_mips()
1428 c->cputype = CPU_M5150; in cpu_probe_mips()
1432 c->cputype = CPU_M6250; in cpu_probe_mips()
1437 decode_configs(c); in cpu_probe_mips()
1441 mm_config(c); in cpu_probe_mips()
1443 switch (__get_cpu_type(c->cputype)) { in cpu_probe_mips()
1446 set_isa(c, MIPS_CPU_ISA_M32R5); in cpu_probe_mips()
1449 c->options |= MIPS_CPU_SHARED_FTLB_ENTRIES; in cpu_probe_mips()
1452 c->options |= MIPS_CPU_SHARED_FTLB_RAM; in cpu_probe_mips()
1461 switch (__get_cpu_type(c->cputype)) { in cpu_probe_mips()
1467 c->options |= MIPS_CPU_FTLBPAREX; in cpu_probe_mips()
1472 static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_alchemy() argument
1474 decode_configs(c); in cpu_probe_alchemy()
1475 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_alchemy()
1478 c->cputype = CPU_ALCHEMY; in cpu_probe_alchemy()
1479 switch ((c->processor_id >> 24) & 0xff) { in cpu_probe_alchemy()
1494 if ((c->processor_id & PRID_REV_MASK) == 2) in cpu_probe_alchemy()
1506 c->cputype = CPU_ALCHEMY; in cpu_probe_alchemy()
1512 static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_sibyte() argument
1514 decode_configs(c); in cpu_probe_sibyte()
1516 c->writecombine = _CACHE_UNCACHED_ACCELERATED; in cpu_probe_sibyte()
1517 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_sibyte()
1519 c->cputype = CPU_SB1; in cpu_probe_sibyte()
1522 if ((c->processor_id & PRID_REV_MASK) < 0x02) in cpu_probe_sibyte()
1523 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); in cpu_probe_sibyte()
1526 c->cputype = CPU_SB1A; in cpu_probe_sibyte()
1532 static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_sandcraft() argument
1534 decode_configs(c); in cpu_probe_sandcraft()
1535 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_sandcraft()
1537 c->cputype = CPU_SR71000; in cpu_probe_sandcraft()
1539 c->scache.ways = 8; in cpu_probe_sandcraft()
1540 c->tlbsize = 64; in cpu_probe_sandcraft()
1545 static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_nxp() argument
1547 decode_configs(c); in cpu_probe_nxp()
1548 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_nxp()
1550 c->cputype = CPU_PR4450; in cpu_probe_nxp()
1552 set_isa(c, MIPS_CPU_ISA_M32R1); in cpu_probe_nxp()
1557 static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_broadcom() argument
1559 decode_configs(c); in cpu_probe_broadcom()
1560 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_broadcom()
1563 c->cputype = CPU_BMIPS32; in cpu_probe_broadcom()
1570 c->cputype = CPU_BMIPS3300; in cpu_probe_broadcom()
1576 int rev = c->processor_id & PRID_REV_MASK; in cpu_probe_broadcom()
1580 c->cputype = CPU_BMIPS4380; in cpu_probe_broadcom()
1583 c->options |= MIPS_CPU_RIXI; in cpu_probe_broadcom()
1586 c->cputype = CPU_BMIPS4350; in cpu_probe_broadcom()
1594 c->cputype = CPU_BMIPS5000; in cpu_probe_broadcom()
1595 if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_BMIPS5200) in cpu_probe_broadcom()
1600 c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; in cpu_probe_broadcom()
1606 static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_cavium() argument
1608 decode_configs(c); in cpu_probe_cavium()
1610 c->options &= ~MIPS_CPU_4K_CACHE; in cpu_probe_cavium()
1611 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_cavium()
1615 c->cputype = CPU_CAVIUM_OCTEON; in cpu_probe_cavium()
1622 c->cputype = CPU_CAVIUM_OCTEON_PLUS; in cpu_probe_cavium()
1632 c->cputype = CPU_CAVIUM_OCTEON2; in cpu_probe_cavium()
1640 c->cputype = CPU_CAVIUM_OCTEON3; in cpu_probe_cavium()
1646 c->cputype = CPU_UNKNOWN; in cpu_probe_cavium()
1654 static inline void decode_cpucfg(struct cpuinfo_mips *c) in decode_cpucfg() argument
1661 c->ases |= MIPS_ASE_LOONGSON_MMI; in decode_cpucfg()
1664 c->ases |= MIPS_ASE_LOONGSON_EXT; in decode_cpucfg()
1667 c->ases |= MIPS_ASE_LOONGSON_EXT2; in decode_cpucfg()
1670 c->options |= MIPS_CPU_LDPTE; in decode_cpucfg()
1671 c->guest.options |= MIPS_CPU_LDPTE; in decode_cpucfg()
1675 c->ases |= MIPS_ASE_LOONGSON_CAM; in decode_cpucfg()
1678 static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_loongson() argument
1680 c->cputype = CPU_LOONGSON64; in cpu_probe_loongson()
1683 decode_configs(c); in cpu_probe_loongson()
1684 c->options |= MIPS_CPU_GSEXCEX; in cpu_probe_loongson()
1686 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_loongson()
1688 switch (c->processor_id & PRID_REV_MASK) { in cpu_probe_loongson()
1695 set_isa(c, MIPS_CPU_ISA_M64R2); in cpu_probe_loongson()
1698 c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_EXT | in cpu_probe_loongson()
1702 switch (c->processor_id & PRID_REV_MASK) { in cpu_probe_loongson()
1707 set_isa(c, MIPS_CPU_ISA_M64R2); in cpu_probe_loongson()
1713 set_isa(c, MIPS_CPU_ISA_M64R2); in cpu_probe_loongson()
1724 c->options |= MIPS_CPU_FTLB | MIPS_CPU_TLBINV | MIPS_CPU_LDPTE; in cpu_probe_loongson()
1725 c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM | in cpu_probe_loongson()
1727 c->ases &= ~MIPS_ASE_VZ; /* VZ of Loongson-3A2000/3000 is incomplete */ in cpu_probe_loongson()
1732 set_isa(c, MIPS_CPU_ISA_M64R2); in cpu_probe_loongson()
1733 decode_cpucfg(c); in cpu_probe_loongson()
1741 static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) { } in cpu_probe_loongson() argument
1744 static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_ingenic() argument
1746 decode_configs(c); in cpu_probe_ingenic()
1752 decode_config3(c); in cpu_probe_ingenic()
1755 c->options &= ~MIPS_CPU_COUNTER; in cpu_probe_ingenic()
1759 c->icache.flags |= MIPS_CACHE_VTAG; in cpu_probe_ingenic()
1761 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_ingenic()
1774 switch (c->processor_id & PRID_COMP_MASK) { in cpu_probe_ingenic()
1782 c->isa_level &= ~MIPS_CPU_ISA_M32R2; in cpu_probe_ingenic()
1785 if (c->processor_id == 0x2ed0024f) in cpu_probe_ingenic()
1786 c->options |= MIPS_CPU_FPU; in cpu_probe_ingenic()
1812 c->writecombine = _CACHE_CACHABLE_WA; in cpu_probe_ingenic()
1813 c->cputype = CPU_XBURST; in cpu_probe_ingenic()
1819 c->cputype = CPU_XBURST; in cpu_probe_ingenic()
1841 struct cpuinfo_mips *c = ¤t_cpu_data; in cpu_probe() local
1850 c->processor_id = PRID_IMP_UNKNOWN; in cpu_probe()
1851 c->fpu_id = FPIR_IMP_NONE; in cpu_probe()
1852 c->cputype = CPU_UNKNOWN; in cpu_probe()
1853 c->writecombine = _CACHE_UNCACHED; in cpu_probe()
1855 c->fpu_csr31 = FPU_CSR_RN; in cpu_probe()
1856 c->fpu_msk31 = FPU_CSR_RSVD | FPU_CSR_ABS2008 | FPU_CSR_NAN2008; in cpu_probe()
1858 c->processor_id = read_c0_prid(); in cpu_probe()
1859 switch (c->processor_id & PRID_COMP_MASK) { in cpu_probe()
1861 cpu_probe_legacy(c, cpu); in cpu_probe()
1864 cpu_probe_mips(c, cpu); in cpu_probe()
1868 cpu_probe_alchemy(c, cpu); in cpu_probe()
1871 cpu_probe_sibyte(c, cpu); in cpu_probe()
1874 cpu_probe_broadcom(c, cpu); in cpu_probe()
1877 cpu_probe_sandcraft(c, cpu); in cpu_probe()
1880 cpu_probe_nxp(c, cpu); in cpu_probe()
1883 cpu_probe_cavium(c, cpu); in cpu_probe()
1886 cpu_probe_loongson(c, cpu); in cpu_probe()
1892 cpu_probe_ingenic(c, cpu); in cpu_probe()
1897 BUG_ON(c->cputype == CPU_UNKNOWN); in cpu_probe()
1904 BUG_ON(current_cpu_type() != c->cputype); in cpu_probe()
1912 c->options |= MIPS_CPU_RIXIEX; in cpu_probe()
1916 c->options &= ~MIPS_CPU_FPU; in cpu_probe()
1919 c->ases &= ~(MIPS_ASE_DSP | MIPS_ASE_DSP2P); in cpu_probe()
1922 c->options &= ~MIPS_CPU_HTW; in cpu_probe()
1927 if (c->options & MIPS_CPU_FPU) in cpu_probe()
1928 cpu_set_fpu_opts(c); in cpu_probe()
1930 cpu_set_nofpu_opts(c); in cpu_probe()
1933 c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1; in cpu_probe()
1935 c->options |= MIPS_CPU_PCI; in cpu_probe()
1938 c->srsets = 1; in cpu_probe()
1944 c->msa_id = cpu_get_msa_id(); in cpu_probe()
1945 WARN(c->msa_id & MSA_IR_WRPF, in cpu_probe()
1984 cpu_probe_vz(c); in cpu_probe()
1986 cpu_probe_vmbits(c); in cpu_probe()
1993 loongson3_cpucfg_synthesize_data(c); in cpu_probe()
2005 struct cpuinfo_mips *c = ¤t_cpu_data; in cpu_report() local
2008 smp_processor_id(), c->processor_id, cpu_name_string()); in cpu_report()
2009 if (c->options & MIPS_CPU_FPU) in cpu_report()
2010 printk(KERN_INFO "FPU revision is: %08x\n", c->fpu_id); in cpu_report()
2012 pr_info("MSA revision is: %08x\n", c->msa_id); in cpu_report()