• Home
  • Raw
  • Download

Lines Matching refs:c

76 static inline void cpu_set_fpu_fcsr_mask(struct cpuinfo_mips *c)  in cpu_set_fpu_fcsr_mask()  argument
80 fcsr = c->fpu_csr31; in cpu_set_fpu_fcsr_mask()
98 c->fpu_msk31 = ~(fcsr0 ^ fcsr1) & ~mask; in cpu_set_fpu_fcsr_mask()
105 static void cpu_set_fpu_2008(struct cpuinfo_mips *c) in cpu_set_fpu_2008() argument
107 if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | in cpu_set_fpu_2008()
130 c->options |= MIPS_CPU_NAN_LEGACY; in cpu_set_fpu_2008()
132 c->options |= MIPS_CPU_NAN_2008; in cpu_set_fpu_2008()
135 c->fpu_msk31 &= ~FPU_CSR_ABS2008; in cpu_set_fpu_2008()
137 c->fpu_csr31 |= fcsr & FPU_CSR_ABS2008; in cpu_set_fpu_2008()
140 c->fpu_msk31 &= ~FPU_CSR_NAN2008; in cpu_set_fpu_2008()
142 c->fpu_csr31 |= fcsr & FPU_CSR_NAN2008; in cpu_set_fpu_2008()
144 c->options |= MIPS_CPU_NAN_LEGACY; in cpu_set_fpu_2008()
149 c->options |= MIPS_CPU_NAN_LEGACY; in cpu_set_fpu_2008()
165 static void cpu_set_nofpu_2008(struct cpuinfo_mips *c) in cpu_set_nofpu_2008() argument
167 c->options &= ~(MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY); in cpu_set_nofpu_2008()
168 c->fpu_csr31 &= ~(FPU_CSR_ABS2008 | FPU_CSR_NAN2008); in cpu_set_nofpu_2008()
169 c->fpu_msk31 &= ~(FPU_CSR_ABS2008 | FPU_CSR_NAN2008); in cpu_set_nofpu_2008()
173 if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | in cpu_set_nofpu_2008()
176 c->options |= MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY; in cpu_set_nofpu_2008()
178 c->options |= MIPS_CPU_NAN_LEGACY; in cpu_set_nofpu_2008()
179 c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; in cpu_set_nofpu_2008()
183 c->options |= MIPS_CPU_NAN_LEGACY; in cpu_set_nofpu_2008()
184 c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; in cpu_set_nofpu_2008()
187 c->options |= MIPS_CPU_NAN_2008; in cpu_set_nofpu_2008()
188 c->fpu_csr31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; in cpu_set_nofpu_2008()
189 c->fpu_msk31 |= FPU_CSR_ABS2008 | FPU_CSR_NAN2008; in cpu_set_nofpu_2008()
192 c->options |= MIPS_CPU_NAN_2008 | MIPS_CPU_NAN_LEGACY; in cpu_set_nofpu_2008()
201 static void cpu_set_nan_2008(struct cpuinfo_mips *c) in cpu_set_nan_2008() argument
259 static void cpu_set_nofpu_id(struct cpuinfo_mips *c) in cpu_set_nofpu_id() argument
264 if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | in cpu_set_nofpu_id()
268 if (c->isa_level & (MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 | in cpu_set_nofpu_id()
271 if (c->options & MIPS_CPU_NAN_2008) in cpu_set_nofpu_id()
273 c->fpu_id = value; in cpu_set_nofpu_id()
282 static void cpu_set_fpu_opts(struct cpuinfo_mips *c) in cpu_set_fpu_opts() argument
284 c->fpu_id = cpu_get_fpu_id(); in cpu_set_fpu_opts()
285 mips_nofpu_msk31 = c->fpu_msk31; in cpu_set_fpu_opts()
287 if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 | in cpu_set_fpu_opts()
290 if (c->fpu_id & MIPS_FPIR_3D) in cpu_set_fpu_opts()
291 c->ases |= MIPS_ASE_MIPS3D; in cpu_set_fpu_opts()
292 if (c->fpu_id & MIPS_FPIR_FREP) in cpu_set_fpu_opts()
293 c->options |= MIPS_CPU_FRE; in cpu_set_fpu_opts()
296 cpu_set_fpu_fcsr_mask(c); in cpu_set_fpu_opts()
297 cpu_set_fpu_2008(c); in cpu_set_fpu_opts()
298 cpu_set_nan_2008(c); in cpu_set_fpu_opts()
304 static void cpu_set_nofpu_opts(struct cpuinfo_mips *c) in cpu_set_nofpu_opts() argument
306 c->options &= ~MIPS_CPU_FPU; in cpu_set_nofpu_opts()
307 c->fpu_msk31 = mips_nofpu_msk31; in cpu_set_nofpu_opts()
309 cpu_set_nofpu_2008(c); in cpu_set_nofpu_opts()
310 cpu_set_nan_2008(c); in cpu_set_nofpu_opts()
311 cpu_set_nofpu_id(c); in cpu_set_nofpu_opts()
360 static int set_ftlb_enable(struct cpuinfo_mips *c, enum ftlb_flags flags);
417 struct cpuinfo_mips *c = &current_cpu_data; in check_errata() local
426 if ((c->processor_id & PRID_REV_MASK) <= PRID_REV_34K_V1_0_2) in check_errata()
467 static inline void cpu_probe_vmbits(struct cpuinfo_mips *c) in cpu_probe_vmbits() argument
472 c->vmbits = fls64(read_c0_entryhi() & 0x3fffffffffffe000ULL); in cpu_probe_vmbits()
476 static void set_isa(struct cpuinfo_mips *c, unsigned int isa) in set_isa() argument
480 c->isa_level |= MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2; in set_isa()
482 c->isa_level |= MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1; in set_isa()
484 c->isa_level |= MIPS_CPU_ISA_V; in set_isa()
486 c->isa_level |= MIPS_CPU_ISA_IV; in set_isa()
488 c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III; in set_isa()
493 c->isa_level |= MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6; in set_isa()
495 c->isa_level |= MIPS_CPU_ISA_M32R6; in set_isa()
499 c->isa_level |= MIPS_CPU_ISA_M32R2; in set_isa()
501 c->isa_level |= MIPS_CPU_ISA_M32R1; in set_isa()
503 c->isa_level |= MIPS_CPU_ISA_II; in set_isa()
511 static unsigned int calculate_ftlb_probability(struct cpuinfo_mips *c) in calculate_ftlb_probability() argument
514 unsigned int probability = c->tlbsize / c->tlbsizevtlb; in calculate_ftlb_probability()
537 static int set_ftlb_enable(struct cpuinfo_mips *c, enum ftlb_flags flags) in set_ftlb_enable() argument
542 switch (c->cputype) { in set_ftlb_enable()
556 config |= calculate_ftlb_probability(c) in set_ftlb_enable()
588 static inline unsigned int decode_config0(struct cpuinfo_mips *c) in decode_config0() argument
600 c->options |= MIPS_CPU_TLB; in decode_config0()
602 c->options |= MIPS_CPU_TLB | MIPS_CPU_FTLB; in decode_config0()
609 set_isa(c, MIPS_CPU_ISA_M32R1); in decode_config0()
612 set_isa(c, MIPS_CPU_ISA_M32R2); in decode_config0()
615 set_isa(c, MIPS_CPU_ISA_M32R6); in decode_config0()
624 set_isa(c, MIPS_CPU_ISA_M64R1); in decode_config0()
627 set_isa(c, MIPS_CPU_ISA_M64R2); in decode_config0()
630 set_isa(c, MIPS_CPU_ISA_M64R6); in decode_config0()
646 static inline unsigned int decode_config1(struct cpuinfo_mips *c) in decode_config1() argument
653 c->ases |= MIPS_ASE_MDMX; in decode_config1()
655 c->options |= MIPS_CPU_PERF; in decode_config1()
657 c->options |= MIPS_CPU_WATCH; in decode_config1()
659 c->ases |= MIPS_ASE_MIPS16; in decode_config1()
661 c->options |= MIPS_CPU_EJTAG; in decode_config1()
663 c->options |= MIPS_CPU_FPU; in decode_config1()
664 c->options |= MIPS_CPU_32FPR; in decode_config1()
667 c->tlbsize = ((config1 & MIPS_CONF1_TLBS) >> 25) + 1; in decode_config1()
668 c->tlbsizevtlb = c->tlbsize; in decode_config1()
669 c->tlbsizeftlbsets = 0; in decode_config1()
675 static inline unsigned int decode_config2(struct cpuinfo_mips *c) in decode_config2() argument
682 c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; in decode_config2()
687 static inline unsigned int decode_config3(struct cpuinfo_mips *c) in decode_config3() argument
694 c->ases |= MIPS_ASE_SMARTMIPS; in decode_config3()
695 c->options |= MIPS_CPU_RIXI | MIPS_CPU_CTXTC; in decode_config3()
698 c->options |= MIPS_CPU_RIXI; in decode_config3()
700 c->options |= MIPS_CPU_CTXTC; in decode_config3()
702 c->ases |= MIPS_ASE_DSP; in decode_config3()
704 c->ases |= MIPS_ASE_DSP2P; in decode_config3()
706 c->ases |= MIPS_ASE_DSP3; in decode_config3()
709 c->options |= MIPS_CPU_VINT; in decode_config3()
711 c->options |= MIPS_CPU_VEIC; in decode_config3()
713 c->options |= MIPS_CPU_LPA; in decode_config3()
715 c->ases |= MIPS_ASE_MIPSMT; in decode_config3()
717 c->options |= MIPS_CPU_ULRI; in decode_config3()
719 c->options |= MIPS_CPU_MICROMIPS; in decode_config3()
721 c->ases |= MIPS_ASE_VZ; in decode_config3()
723 c->options |= MIPS_CPU_SEGMENTS; in decode_config3()
725 c->options |= MIPS_CPU_BADINSTR; in decode_config3()
727 c->options |= MIPS_CPU_BADINSTRP; in decode_config3()
729 c->ases |= MIPS_ASE_MSA; in decode_config3()
731 c->htw_seq = 0; in decode_config3()
732 c->options |= MIPS_CPU_HTW; in decode_config3()
735 c->options |= MIPS_CPU_CDMM; in decode_config3()
737 c->options |= MIPS_CPU_SP; in decode_config3()
742 static inline unsigned int decode_config4(struct cpuinfo_mips *c) in decode_config4() argument
754 c->options |= MIPS_CPU_TLBINV; in decode_config4()
770 c->tlbsize += (config4 & MIPS_CONF4_MMUSIZEEXT) * 0x40; in decode_config4()
771 c->tlbsizevtlb = c->tlbsize; in decode_config4()
774 c->tlbsizevtlb += in decode_config4()
777 c->tlbsize = c->tlbsizevtlb; in decode_config4()
793 set_ftlb_enable(c, 0); in decode_config4()
797 c->tlbsizeftlbsets = 1 << in decode_config4()
800 c->tlbsizeftlbways = ((config4 & MIPS_CONF4_FTLBWAYS) >> in decode_config4()
802 c->tlbsize += c->tlbsizeftlbways * c->tlbsizeftlbsets; in decode_config4()
808 c->kscratch_mask = (config4 & MIPS_CONF4_KSCREXIST) in decode_config4()
814 set_cpu_asid_mask(c, asid_mask); in decode_config4()
821 WARN_ON(asid_mask != cpu_asid_mask(c)); in decode_config4()
826 static inline unsigned int decode_config5(struct cpuinfo_mips *c) in decode_config5() argument
835 c->options |= MIPS_CPU_EVA; in decode_config5()
837 c->options |= MIPS_CPU_MAAR; in decode_config5()
839 c->options |= MIPS_CPU_RW_LLB; in decode_config5()
841 c->options |= MIPS_CPU_MVH; in decode_config5()
843 c->options |= MIPS_CPU_VP; in decode_config5()
848 static void decode_configs(struct cpuinfo_mips *c) in decode_configs() argument
853 c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER | in decode_configs()
856 c->scache.flags = MIPS_CACHE_NOT_PRESENT; in decode_configs()
859 set_ftlb_enable(c, mips_ftlb_disabled ? 0 : FTLB_EN); in decode_configs()
861 ok = decode_config0(c); /* Read Config registers. */ in decode_configs()
864 ok = decode_config1(c); in decode_configs()
866 ok = decode_config2(c); in decode_configs()
868 ok = decode_config3(c); in decode_configs()
870 ok = decode_config4(c); in decode_configs()
872 ok = decode_config5(c); in decode_configs()
884 c->options |= MIPS_CPU_EBASE_WG; in decode_configs()
903 c->options |= MIPS_CPU_EBASE_WG; in decode_configs()
910 set_ftlb_enable(c, (mips_ftlb_disabled ? 0 : FTLB_EN) | FTLB_SET_PROB); in decode_configs()
912 mips_probe_watch_registers(c); in decode_configs()
916 c->core = get_ebase_cpunum(); in decode_configs()
918 c->core >>= fls(core_nvpes()) - 1; in decode_configs()
951 static inline unsigned int decode_guest_config0(struct cpuinfo_mips *c) in decode_guest_config0() argument
958 c->guest.conf |= BIT(1); in decode_guest_config0()
962 static inline unsigned int decode_guest_config1(struct cpuinfo_mips *c) in decode_guest_config1() argument
971 c->guest.options |= MIPS_CPU_FPU; in decode_guest_config1()
973 c->guest.options_dyn |= MIPS_CPU_FPU; in decode_guest_config1()
976 c->guest.options |= MIPS_CPU_WATCH; in decode_guest_config1()
978 c->guest.options_dyn |= MIPS_CPU_WATCH; in decode_guest_config1()
981 c->guest.options |= MIPS_CPU_PERF; in decode_guest_config1()
983 c->guest.options_dyn |= MIPS_CPU_PERF; in decode_guest_config1()
986 c->guest.conf |= BIT(2); in decode_guest_config1()
990 static inline unsigned int decode_guest_config2(struct cpuinfo_mips *c) in decode_guest_config2() argument
997 c->guest.conf |= BIT(3); in decode_guest_config2()
1001 static inline unsigned int decode_guest_config3(struct cpuinfo_mips *c) in decode_guest_config3() argument
1009 c->guest.options |= MIPS_CPU_CTXTC; in decode_guest_config3()
1011 c->guest.options_dyn |= MIPS_CPU_CTXTC; in decode_guest_config3()
1014 c->guest.options |= MIPS_CPU_HTW; in decode_guest_config3()
1017 c->guest.options |= MIPS_CPU_SEGMENTS; in decode_guest_config3()
1020 c->guest.options |= MIPS_CPU_BADINSTR; in decode_guest_config3()
1022 c->guest.options |= MIPS_CPU_BADINSTRP; in decode_guest_config3()
1025 c->guest.ases |= MIPS_ASE_MSA; in decode_guest_config3()
1027 c->guest.ases_dyn |= MIPS_ASE_MSA; in decode_guest_config3()
1030 c->guest.conf |= BIT(4); in decode_guest_config3()
1034 static inline unsigned int decode_guest_config4(struct cpuinfo_mips *c) in decode_guest_config4() argument
1041 c->guest.kscratch_mask = (config4 & MIPS_CONF4_KSCREXIST) in decode_guest_config4()
1045 c->guest.conf |= BIT(5); in decode_guest_config4()
1049 static inline unsigned int decode_guest_config5(struct cpuinfo_mips *c) in decode_guest_config5() argument
1057 c->guest.options |= MIPS_CPU_MAAR; in decode_guest_config5()
1059 c->guest.options_dyn |= MIPS_CPU_MAAR; in decode_guest_config5()
1062 c->guest.options |= MIPS_CPU_RW_LLB; in decode_guest_config5()
1065 c->guest.conf |= BIT(6); in decode_guest_config5()
1069 static inline void decode_guest_configs(struct cpuinfo_mips *c) in decode_guest_configs() argument
1073 ok = decode_guest_config0(c); in decode_guest_configs()
1075 ok = decode_guest_config1(c); in decode_guest_configs()
1077 ok = decode_guest_config2(c); in decode_guest_configs()
1079 ok = decode_guest_config3(c); in decode_guest_configs()
1081 ok = decode_guest_config4(c); in decode_guest_configs()
1083 decode_guest_config5(c); in decode_guest_configs()
1086 static inline void cpu_probe_guestctl0(struct cpuinfo_mips *c) in cpu_probe_guestctl0() argument
1093 c->options |= MIPS_CPU_GUESTCTL0EXT; in cpu_probe_guestctl0()
1095 c->options |= MIPS_CPU_GUESTCTL1; in cpu_probe_guestctl0()
1097 c->options |= MIPS_CPU_GUESTCTL2; in cpu_probe_guestctl0()
1099 c->options |= MIPS_CPU_GUESTID; in cpu_probe_guestctl0()
1115 c->options |= MIPS_CPU_DRG; in cpu_probe_guestctl0()
1120 static inline void cpu_probe_guestctl1(struct cpuinfo_mips *c) in cpu_probe_guestctl1() argument
1126 c->guestid_mask = (read_c0_guestctl1() & MIPS_GCTL1_ID) in cpu_probe_guestctl1()
1132 static inline void cpu_probe_gtoffset(struct cpuinfo_mips *c) in cpu_probe_gtoffset() argument
1137 c->gtoffset_mask = read_c0_gtoffset(); in cpu_probe_gtoffset()
1141 static inline void cpu_probe_vz(struct cpuinfo_mips *c) in cpu_probe_vz() argument
1143 cpu_probe_guestctl0(c); in cpu_probe_vz()
1145 cpu_probe_guestctl1(c); in cpu_probe_vz()
1147 cpu_probe_gtoffset(c); in cpu_probe_vz()
1149 decode_guest_configs(c); in cpu_probe_vz()
1155 static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_legacy() argument
1157 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_legacy()
1159 c->cputype = CPU_R2000; in cpu_probe_legacy()
1161 c->fpu_msk31 |= FPU_CSR_CONDX | FPU_CSR_FS; in cpu_probe_legacy()
1162 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | in cpu_probe_legacy()
1165 c->options |= MIPS_CPU_FPU; in cpu_probe_legacy()
1166 c->tlbsize = 64; in cpu_probe_legacy()
1169 if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) { in cpu_probe_legacy()
1171 c->cputype = CPU_R3081E; in cpu_probe_legacy()
1174 c->cputype = CPU_R3000A; in cpu_probe_legacy()
1178 c->cputype = CPU_R3000; in cpu_probe_legacy()
1181 c->fpu_msk31 |= FPU_CSR_CONDX | FPU_CSR_FS; in cpu_probe_legacy()
1182 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | in cpu_probe_legacy()
1185 c->options |= MIPS_CPU_FPU; in cpu_probe_legacy()
1186 c->tlbsize = 64; in cpu_probe_legacy()
1190 if ((c->processor_id & PRID_REV_MASK) >= in cpu_probe_legacy()
1192 c->cputype = CPU_R4400PC; in cpu_probe_legacy()
1195 c->cputype = CPU_R4000PC; in cpu_probe_legacy()
1219 if ((c->processor_id & PRID_REV_MASK) >= in cpu_probe_legacy()
1221 c->cputype = mc ? CPU_R4400MC : CPU_R4400SC; in cpu_probe_legacy()
1224 c->cputype = mc ? CPU_R4000MC : CPU_R4000SC; in cpu_probe_legacy()
1229 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1230 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1231 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1234 c->tlbsize = 48; in cpu_probe_legacy()
1237 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1238 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1239 c->options = R4K_OPTS; in cpu_probe_legacy()
1240 c->tlbsize = 32; in cpu_probe_legacy()
1241 switch (c->processor_id & 0xf0) { in cpu_probe_legacy()
1243 c->cputype = CPU_VR4111; in cpu_probe_legacy()
1247 c->cputype = CPU_VR4121; in cpu_probe_legacy()
1251 if ((c->processor_id & 0xf) < 0x3) { in cpu_probe_legacy()
1252 c->cputype = CPU_VR4122; in cpu_probe_legacy()
1255 c->cputype = CPU_VR4181A; in cpu_probe_legacy()
1260 if ((c->processor_id & 0xf) < 0x4) { in cpu_probe_legacy()
1261 c->cputype = CPU_VR4131; in cpu_probe_legacy()
1264 c->cputype = CPU_VR4133; in cpu_probe_legacy()
1265 c->options |= MIPS_CPU_LLSC; in cpu_probe_legacy()
1271 c->cputype = CPU_VR41XX; in cpu_probe_legacy()
1277 c->cputype = CPU_R4300; in cpu_probe_legacy()
1279 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1280 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1281 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1283 c->tlbsize = 32; in cpu_probe_legacy()
1286 c->cputype = CPU_R4600; in cpu_probe_legacy()
1288 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1289 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1290 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1292 c->tlbsize = 48; in cpu_probe_legacy()
1302 c->cputype = CPU_R4650; in cpu_probe_legacy()
1304 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1305 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1306 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC; in cpu_probe_legacy()
1307 c->tlbsize = 48; in cpu_probe_legacy()
1311 c->fpu_msk31 |= FPU_CSR_CONDX | FPU_CSR_FS; in cpu_probe_legacy()
1312 c->options = MIPS_CPU_TLB | MIPS_CPU_TX39_CACHE; in cpu_probe_legacy()
1314 if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) { in cpu_probe_legacy()
1315 c->cputype = CPU_TX3927; in cpu_probe_legacy()
1317 c->tlbsize = 64; in cpu_probe_legacy()
1319 switch (c->processor_id & PRID_REV_MASK) { in cpu_probe_legacy()
1321 c->cputype = CPU_TX3912; in cpu_probe_legacy()
1323 c->tlbsize = 32; in cpu_probe_legacy()
1326 c->cputype = CPU_TX3922; in cpu_probe_legacy()
1328 c->tlbsize = 64; in cpu_probe_legacy()
1334 c->cputype = CPU_R4700; in cpu_probe_legacy()
1336 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1337 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1338 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1340 c->tlbsize = 48; in cpu_probe_legacy()
1343 c->cputype = CPU_TX49XX; in cpu_probe_legacy()
1345 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1346 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1347 c->options = R4K_OPTS | MIPS_CPU_LLSC; in cpu_probe_legacy()
1348 if (!(c->processor_id & 0x08)) in cpu_probe_legacy()
1349 c->options |= MIPS_CPU_FPU | MIPS_CPU_32FPR; in cpu_probe_legacy()
1350 c->tlbsize = 48; in cpu_probe_legacy()
1353 c->cputype = CPU_R5000; in cpu_probe_legacy()
1355 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1356 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1358 c->tlbsize = 48; in cpu_probe_legacy()
1361 c->cputype = CPU_R5432; in cpu_probe_legacy()
1363 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1364 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1366 c->tlbsize = 48; in cpu_probe_legacy()
1369 c->cputype = CPU_R5500; in cpu_probe_legacy()
1371 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1372 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1374 c->tlbsize = 48; in cpu_probe_legacy()
1377 c->cputype = CPU_NEVADA; in cpu_probe_legacy()
1379 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1380 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1382 c->tlbsize = 48; in cpu_probe_legacy()
1385 c->cputype = CPU_R6000; in cpu_probe_legacy()
1387 set_isa(c, MIPS_CPU_ISA_II); in cpu_probe_legacy()
1388 c->fpu_msk31 |= FPU_CSR_CONDX | FPU_CSR_FS; in cpu_probe_legacy()
1389 c->options = MIPS_CPU_TLB | MIPS_CPU_FPU | in cpu_probe_legacy()
1391 c->tlbsize = 32; in cpu_probe_legacy()
1394 c->cputype = CPU_R6000A; in cpu_probe_legacy()
1396 set_isa(c, MIPS_CPU_ISA_II); in cpu_probe_legacy()
1397 c->fpu_msk31 |= FPU_CSR_CONDX | FPU_CSR_FS; in cpu_probe_legacy()
1398 c->options = MIPS_CPU_TLB | MIPS_CPU_FPU | in cpu_probe_legacy()
1400 c->tlbsize = 32; in cpu_probe_legacy()
1403 c->cputype = CPU_RM7000; in cpu_probe_legacy()
1405 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1406 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | in cpu_probe_legacy()
1416 c->tlbsize = (read_c0_info() & (1 << 29)) ? 64 : 48; in cpu_probe_legacy()
1419 c->cputype = CPU_R8000; in cpu_probe_legacy()
1421 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1422 c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | in cpu_probe_legacy()
1425 c->tlbsize = 384; /* has weird TLB: 3-way x 128 */ in cpu_probe_legacy()
1428 c->cputype = CPU_R10000; in cpu_probe_legacy()
1430 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1431 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | in cpu_probe_legacy()
1435 c->tlbsize = 64; in cpu_probe_legacy()
1438 c->cputype = CPU_R12000; in cpu_probe_legacy()
1440 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1441 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | in cpu_probe_legacy()
1445 c->tlbsize = 64; in cpu_probe_legacy()
1448 if (((c->processor_id >> 4) & 0x0f) > 2) { in cpu_probe_legacy()
1449 c->cputype = CPU_R16000; in cpu_probe_legacy()
1452 c->cputype = CPU_R14000; in cpu_probe_legacy()
1455 set_isa(c, MIPS_CPU_ISA_IV); in cpu_probe_legacy()
1456 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | in cpu_probe_legacy()
1460 c->tlbsize = 64; in cpu_probe_legacy()
1463 switch (c->processor_id & PRID_REV_MASK) { in cpu_probe_legacy()
1465 c->cputype = CPU_LOONGSON2; in cpu_probe_legacy()
1468 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1469 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1472 c->cputype = CPU_LOONGSON2; in cpu_probe_legacy()
1475 set_isa(c, MIPS_CPU_ISA_III); in cpu_probe_legacy()
1476 c->fpu_msk31 |= FPU_CSR_CONDX; in cpu_probe_legacy()
1479 c->cputype = CPU_LOONGSON3; in cpu_probe_legacy()
1482 set_isa(c, MIPS_CPU_ISA_M64R1); in cpu_probe_legacy()
1486 c->cputype = CPU_LOONGSON3; in cpu_probe_legacy()
1489 set_isa(c, MIPS_CPU_ISA_M64R1); in cpu_probe_legacy()
1493 c->options = R4K_OPTS | in cpu_probe_legacy()
1496 c->tlbsize = 64; in cpu_probe_legacy()
1497 c->writecombine = _CACHE_UNCACHED_ACCELERATED; in cpu_probe_legacy()
1500 decode_configs(c); in cpu_probe_legacy()
1502 c->cputype = CPU_LOONGSON1; in cpu_probe_legacy()
1504 switch (c->processor_id & PRID_REV_MASK) { in cpu_probe_legacy()
1514 static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_mips() argument
1516 c->writecombine = _CACHE_UNCACHED_ACCELERATED; in cpu_probe_mips()
1517 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_mips()
1519 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1520 c->cputype = CPU_QEMU_GENERIC; in cpu_probe_mips()
1524 c->cputype = CPU_4KC; in cpu_probe_mips()
1525 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1530 c->cputype = CPU_4KEC; in cpu_probe_mips()
1531 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1536 c->cputype = CPU_4KSC; in cpu_probe_mips()
1537 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1541 c->cputype = CPU_5KC; in cpu_probe_mips()
1542 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1546 c->cputype = CPU_5KE; in cpu_probe_mips()
1547 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1551 c->cputype = CPU_20KC; in cpu_probe_mips()
1552 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1556 c->cputype = CPU_24K; in cpu_probe_mips()
1557 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1561 c->cputype = CPU_24K; in cpu_probe_mips()
1562 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1566 c->cputype = CPU_25KF; in cpu_probe_mips()
1567 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1571 c->cputype = CPU_34K; in cpu_probe_mips()
1572 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1576 c->cputype = CPU_74K; in cpu_probe_mips()
1577 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1581 c->cputype = CPU_M14KC; in cpu_probe_mips()
1582 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1586 c->cputype = CPU_M14KEC; in cpu_probe_mips()
1587 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1591 c->cputype = CPU_1004K; in cpu_probe_mips()
1592 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1596 c->cputype = CPU_1074K; in cpu_probe_mips()
1597 c->writecombine = _CACHE_UNCACHED; in cpu_probe_mips()
1601 c->cputype = CPU_INTERAPTIV; in cpu_probe_mips()
1605 c->cputype = CPU_INTERAPTIV; in cpu_probe_mips()
1609 c->cputype = CPU_PROAPTIV; in cpu_probe_mips()
1613 c->cputype = CPU_PROAPTIV; in cpu_probe_mips()
1617 c->cputype = CPU_P5600; in cpu_probe_mips()
1621 c->cputype = CPU_P6600; in cpu_probe_mips()
1625 c->cputype = CPU_I6400; in cpu_probe_mips()
1629 c->cputype = CPU_M5150; in cpu_probe_mips()
1633 c->cputype = CPU_M6250; in cpu_probe_mips()
1638 decode_configs(c); in cpu_probe_mips()
1643 static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_alchemy() argument
1645 decode_configs(c); in cpu_probe_alchemy()
1646 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_alchemy()
1649 c->cputype = CPU_ALCHEMY; in cpu_probe_alchemy()
1650 switch ((c->processor_id >> 24) & 0xff) { in cpu_probe_alchemy()
1665 if ((c->processor_id & PRID_REV_MASK) == 2) in cpu_probe_alchemy()
1679 static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_sibyte() argument
1681 decode_configs(c); in cpu_probe_sibyte()
1683 c->writecombine = _CACHE_UNCACHED_ACCELERATED; in cpu_probe_sibyte()
1684 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_sibyte()
1686 c->cputype = CPU_SB1; in cpu_probe_sibyte()
1689 if ((c->processor_id & PRID_REV_MASK) < 0x02) in cpu_probe_sibyte()
1690 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); in cpu_probe_sibyte()
1693 c->cputype = CPU_SB1A; in cpu_probe_sibyte()
1699 static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_sandcraft() argument
1701 decode_configs(c); in cpu_probe_sandcraft()
1702 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_sandcraft()
1704 c->cputype = CPU_SR71000; in cpu_probe_sandcraft()
1706 c->scache.ways = 8; in cpu_probe_sandcraft()
1707 c->tlbsize = 64; in cpu_probe_sandcraft()
1712 static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_nxp() argument
1714 decode_configs(c); in cpu_probe_nxp()
1715 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_nxp()
1717 c->cputype = CPU_PR4450; in cpu_probe_nxp()
1719 set_isa(c, MIPS_CPU_ISA_M32R1); in cpu_probe_nxp()
1724 static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_broadcom() argument
1726 decode_configs(c); in cpu_probe_broadcom()
1727 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_broadcom()
1730 c->cputype = CPU_BMIPS32; in cpu_probe_broadcom()
1737 c->cputype = CPU_BMIPS3300; in cpu_probe_broadcom()
1742 int rev = c->processor_id & PRID_REV_MASK; in cpu_probe_broadcom()
1746 c->cputype = CPU_BMIPS4380; in cpu_probe_broadcom()
1749 c->options |= MIPS_CPU_RIXI; in cpu_probe_broadcom()
1751 c->cputype = CPU_BMIPS4350; in cpu_probe_broadcom()
1759 c->cputype = CPU_BMIPS5000; in cpu_probe_broadcom()
1760 if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_BMIPS5200) in cpu_probe_broadcom()
1765 c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; in cpu_probe_broadcom()
1770 static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_cavium() argument
1772 decode_configs(c); in cpu_probe_cavium()
1773 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_cavium()
1777 c->cputype = CPU_CAVIUM_OCTEON; in cpu_probe_cavium()
1784 c->cputype = CPU_CAVIUM_OCTEON_PLUS; in cpu_probe_cavium()
1794 c->cputype = CPU_CAVIUM_OCTEON2; in cpu_probe_cavium()
1802 c->cputype = CPU_CAVIUM_OCTEON3; in cpu_probe_cavium()
1808 c->cputype = CPU_UNKNOWN; in cpu_probe_cavium()
1813 static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_loongson() argument
1815 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_loongson()
1817 switch (c->processor_id & PRID_REV_MASK) { in cpu_probe_loongson()
1819 c->cputype = CPU_LOONGSON3; in cpu_probe_loongson()
1822 set_isa(c, MIPS_CPU_ISA_M64R2); in cpu_probe_loongson()
1826 decode_configs(c); in cpu_probe_loongson()
1827 c->options |= MIPS_CPU_FTLB | MIPS_CPU_TLBINV | MIPS_CPU_LDPTE; in cpu_probe_loongson()
1828 c->writecombine = _CACHE_UNCACHED_ACCELERATED; in cpu_probe_loongson()
1836 static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu) in cpu_probe_ingenic() argument
1838 decode_configs(c); in cpu_probe_ingenic()
1840 c->options &= ~MIPS_CPU_COUNTER; in cpu_probe_ingenic()
1842 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_ingenic()
1844 c->cputype = CPU_JZRISC; in cpu_probe_ingenic()
1845 c->writecombine = _CACHE_UNCACHED_ACCELERATED; in cpu_probe_ingenic()
1854 static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) in cpu_probe_netlogic() argument
1856 decode_configs(c); in cpu_probe_netlogic()
1858 if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_NETLOGIC_AU13XX) { in cpu_probe_netlogic()
1859 c->cputype = CPU_ALCHEMY; in cpu_probe_netlogic()
1865 c->options = (MIPS_CPU_TLB | in cpu_probe_netlogic()
1873 switch (c->processor_id & PRID_IMP_MASK) { in cpu_probe_netlogic()
1877 c->cputype = CPU_XLP; in cpu_probe_netlogic()
1883 c->cputype = CPU_XLP; in cpu_probe_netlogic()
1895 c->cputype = CPU_XLR; in cpu_probe_netlogic()
1912 c->cputype = CPU_XLR; in cpu_probe_netlogic()
1918 c->processor_id); in cpu_probe_netlogic()
1919 c->cputype = CPU_XLR; in cpu_probe_netlogic()
1923 if (c->cputype == CPU_XLP) { in cpu_probe_netlogic()
1924 set_isa(c, MIPS_CPU_ISA_M64R2); in cpu_probe_netlogic()
1925 c->options |= (MIPS_CPU_FPU | MIPS_CPU_ULRI | MIPS_CPU_MCHECK); in cpu_probe_netlogic()
1927 c->tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1; in cpu_probe_netlogic()
1929 set_isa(c, MIPS_CPU_ISA_M64R1); in cpu_probe_netlogic()
1930 c->tlbsize = ((read_c0_config1() >> 25) & 0x3f) + 1; in cpu_probe_netlogic()
1932 c->kscratch_mask = 0xf; in cpu_probe_netlogic()
1946 struct cpuinfo_mips *c = &current_cpu_data; in cpu_probe() local
1949 c->processor_id = PRID_IMP_UNKNOWN; in cpu_probe()
1950 c->fpu_id = FPIR_IMP_NONE; in cpu_probe()
1951 c->cputype = CPU_UNKNOWN; in cpu_probe()
1952 c->writecombine = _CACHE_UNCACHED; in cpu_probe()
1954 c->fpu_csr31 = FPU_CSR_RN; in cpu_probe()
1955 c->fpu_msk31 = FPU_CSR_RSVD | FPU_CSR_ABS2008 | FPU_CSR_NAN2008; in cpu_probe()
1957 c->processor_id = read_c0_prid(); in cpu_probe()
1958 switch (c->processor_id & PRID_COMP_MASK) { in cpu_probe()
1960 cpu_probe_legacy(c, cpu); in cpu_probe()
1963 cpu_probe_mips(c, cpu); in cpu_probe()
1966 cpu_probe_alchemy(c, cpu); in cpu_probe()
1969 cpu_probe_sibyte(c, cpu); in cpu_probe()
1972 cpu_probe_broadcom(c, cpu); in cpu_probe()
1975 cpu_probe_sandcraft(c, cpu); in cpu_probe()
1978 cpu_probe_nxp(c, cpu); in cpu_probe()
1981 cpu_probe_cavium(c, cpu); in cpu_probe()
1984 cpu_probe_loongson(c, cpu); in cpu_probe()
1989 cpu_probe_ingenic(c, cpu); in cpu_probe()
1992 cpu_probe_netlogic(c, cpu); in cpu_probe()
1997 BUG_ON(c->cputype == CPU_UNKNOWN); in cpu_probe()
2004 BUG_ON(current_cpu_type() != c->cputype); in cpu_probe()
2012 c->options |= MIPS_CPU_RIXIEX; in cpu_probe()
2016 c->options &= ~MIPS_CPU_FPU; in cpu_probe()
2019 c->ases &= ~(MIPS_ASE_DSP | MIPS_ASE_DSP2P); in cpu_probe()
2022 c->options &= ~MIPS_CPU_HTW; in cpu_probe()
2027 if (c->options & MIPS_CPU_FPU) in cpu_probe()
2028 cpu_set_fpu_opts(c); in cpu_probe()
2030 cpu_set_nofpu_opts(c); in cpu_probe()
2037 c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1; in cpu_probe()
2039 c->options |= MIPS_CPU_PCI; in cpu_probe()
2042 c->srsets = 1; in cpu_probe()
2048 c->msa_id = cpu_get_msa_id(); in cpu_probe()
2049 WARN(c->msa_id & MSA_IR_WRPF, in cpu_probe()
2055 cpu_probe_vz(c); in cpu_probe()
2057 cpu_probe_vmbits(c); in cpu_probe()
2067 struct cpuinfo_mips *c = &current_cpu_data; in cpu_report() local
2070 smp_processor_id(), c->processor_id, cpu_name_string()); in cpu_report()
2071 if (c->options & MIPS_CPU_FPU) in cpu_report()
2072 printk(KERN_INFO "FPU revision is: %08x\n", c->fpu_id); in cpu_report()
2074 pr_info("MSA revision is: %08x\n", c->msa_id); in cpu_report()