15 #include <linux/kernel.h>
16 #include <linux/ptrace.h>
18 #include <linux/stddef.h>
19 #include <linux/export.h>
28 #include <asm/uaccess.h>
40 static void r3081_wait(
void)
46 static void r39xx_wait(
void)
80 static void rm7k_wait_irqoff(
void)
90 " mtc0 $1, $12 # stalls until W stage \n"
92 " mtc0 $1, $12 # stalls until W stage \n"
102 static void au1k_wait(
void)
105 " cache 0x14, 0(%0) \n"
106 " cache 0x14, 32(%0) \n"
115 : :
"r" (au1k_wait));
120 static int __init wait_disable(
char *
s)
127 __setup(
"nowait", wait_disable);
131 static int __init fpu_disable(
char *
s)
134 mips_fpu_disabled = 1;
143 static int __init dsp_disable(
char *
s)
146 mips_dsp_disabled = 1;
158 printk(
"Wait instruction disabled.\n");
251 static inline void check_errata(
void)
280 static inline int cpu_has_confreg(
void)
282 #ifdef CONFIG_CPU_R3000
284 unsigned long size1, size2;
291 return size1 != size2;
297 static inline void set_elf_platform(
int cpu,
const char *plat)
306 static inline unsigned long cpu_get_fpu_id(
void)
320 static inline int __cpu_has_fpu(
void)
325 static inline void cpu_probe_vmbits(
struct cpuinfo_mips *c)
327 #ifdef __NEED_VMBITS_PROBE
329 back_to_back_c0_hazard();
335 "Unsupported ISA type, c0.config0: %d.";
337 static inline unsigned int decode_config0(
struct cpuinfo_mips *c)
339 unsigned int config0;
361 switch ((config0 & MIPS_CONF_AR) >> 10) {
379 panic(unknown_isa, config0);
382 static inline unsigned int decode_config1(
struct cpuinfo_mips *c)
384 unsigned int config1;
406 static inline unsigned int decode_config2(
struct cpuinfo_mips *c)
408 unsigned int config2;
418 static inline unsigned int decode_config3(
struct cpuinfo_mips *c)
420 unsigned int config3;
446 static inline unsigned int decode_config4(
struct cpuinfo_mips *c)
448 unsigned int config4;
471 ok = decode_config0(c);
474 ok = decode_config1(c);
476 ok = decode_config2(c);
478 ok = decode_config3(c);
480 ok = decode_config4(c);
488 #define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE \
491 static inline void cpu_probe_legacy(
struct cpuinfo_mips *c,
unsigned int cpu)
506 if (cpu_has_confreg()) {
782 set_elf_platform(cpu,
"loongson2e");
785 set_elf_platform(cpu,
"loongson2f");
810 static inline void cpu_probe_mips(
struct cpuinfo_mips *c,
unsigned int cpu)
874 static inline void cpu_probe_alchemy(
struct cpuinfo_mips *c,
unsigned int cpu)
910 static inline void cpu_probe_sibyte(
struct cpuinfo_mips *c,
unsigned int cpu)
929 static inline void cpu_probe_sandcraft(
struct cpuinfo_mips *c,
unsigned int cpu)
942 static inline void cpu_probe_nxp(
struct cpuinfo_mips *c,
unsigned int cpu)
954 static inline void cpu_probe_broadcom(
struct cpuinfo_mips *c,
unsigned int cpu)
962 set_elf_platform(cpu,
"bmips32");
969 set_elf_platform(cpu,
"bmips3300");
978 set_elf_platform(cpu,
"bmips4380");
982 set_elf_platform(cpu,
"bmips4350");
989 set_elf_platform(cpu,
"bmips5000");
995 static inline void cpu_probe_cavium(
struct cpuinfo_mips *c,
unsigned int cpu)
1012 set_elf_platform(cpu,
"octeon");
1020 set_elf_platform(cpu,
"octeon2");
1029 static inline void cpu_probe_ingenic(
struct cpuinfo_mips *c,
unsigned int cpu)
1040 panic(
"Unknown Ingenic Processor ID!");
1045 static inline void cpu_probe_netlogic(
struct cpuinfo_mips *c,
int cpu)
1101 pr_info(
"Unknown Netlogic chip id [%02x]!\n",
1139 cpu_probe_legacy(c, cpu);
1142 cpu_probe_mips(c, cpu);
1145 cpu_probe_alchemy(c, cpu);
1148 cpu_probe_sibyte(c, cpu);
1151 cpu_probe_broadcom(c, cpu);
1154 cpu_probe_sandcraft(c, cpu);
1157 cpu_probe_nxp(c, cpu);
1160 cpu_probe_cavium(c, cpu);
1163 cpu_probe_ingenic(c, cpu);
1166 cpu_probe_netlogic(c, cpu);
1170 BUG_ON(!__cpu_name[cpu]);
1180 if (mips_fpu_disabled)
1183 if (mips_dsp_disabled)
1187 c->
fpu_id = cpu_get_fpu_id();
1206 cpu_probe_vmbits(c);
1210 __ua_limit = ~((1ull << cpu_vmbits) - 1);