cpu-probe.c 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210
  1. /*
  2. * Processor capabilities determination functions.
  3. *
  4. * Copyright (C) xxxx the Anonymous
  5. * Copyright (C) 1994 - 2006 Ralf Baechle
  6. * Copyright (C) 2003, 2004 Maciej W. Rozycki
  7. * Copyright (C) 2001, 2004, 2011, 2012 MIPS Technologies, Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version
  12. * 2 of the License, or (at your option) any later version.
  13. */
  14. #include <linux/init.h>
  15. #include <linux/kernel.h>
  16. #include <linux/ptrace.h>
  17. #include <linux/smp.h>
  18. #include <linux/stddef.h>
  19. #include <linux/export.h>
  20. #include <asm/bugs.h>
  21. #include <asm/cpu.h>
  22. #include <asm/fpu.h>
  23. #include <asm/mipsregs.h>
  24. #include <asm/watch.h>
  25. #include <asm/elf.h>
  26. #include <asm/spram.h>
  27. #include <asm/uaccess.h>
  28. /*
  29. * Not all of the MIPS CPUs have the "wait" instruction available. Moreover,
  30. * the implementation of the "wait" feature differs between CPU families. This
  31. * points to the function that implements CPU specific wait.
  32. * The wait instruction stops the pipeline and reduces the power consumption of
  33. * the CPU very much.
  34. */
  35. void (*cpu_wait)(void);
  36. EXPORT_SYMBOL(cpu_wait);
  37. static void r3081_wait(void)
  38. {
  39. unsigned long cfg = read_c0_conf();
  40. write_c0_conf(cfg | R30XX_CONF_HALT);
  41. }
  42. static void r39xx_wait(void)
  43. {
  44. local_irq_disable();
  45. if (!need_resched())
  46. write_c0_conf(read_c0_conf() | TX39_CONF_HALT);
  47. local_irq_enable();
  48. }
  49. extern void r4k_wait(void);
  50. /*
  51. * This variant is preferable as it allows testing need_resched and going to
  52. * sleep depending on the outcome atomically. Unfortunately the "It is
  53. * implementation-dependent whether the pipeline restarts when a non-enabled
  54. * interrupt is requested" restriction in the MIPS32/MIPS64 architecture makes
  55. * using this version a gamble.
  56. */
  57. void r4k_wait_irqoff(void)
  58. {
  59. local_irq_disable();
  60. if (!need_resched())
  61. __asm__(" .set push \n"
  62. " .set mips3 \n"
  63. " wait \n"
  64. " .set pop \n");
  65. local_irq_enable();
  66. __asm__(" .globl __pastwait \n"
  67. "__pastwait: \n");
  68. }
  69. /*
  70. * The RM7000 variant has to handle erratum 38. The workaround is to not
  71. * have any pending stores when the WAIT instruction is executed.
  72. */
  73. static void rm7k_wait_irqoff(void)
  74. {
  75. local_irq_disable();
  76. if (!need_resched())
  77. __asm__(
  78. " .set push \n"
  79. " .set mips3 \n"
  80. " .set noat \n"
  81. " mfc0 $1, $12 \n"
  82. " sync \n"
  83. " mtc0 $1, $12 # stalls until W stage \n"
  84. " wait \n"
  85. " mtc0 $1, $12 # stalls until W stage \n"
  86. " .set pop \n");
  87. local_irq_enable();
  88. }
  89. /*
  90. * The Au1xxx wait is available only if using 32khz counter or
  91. * external timer source, but specifically not CP0 Counter.
  92. * alchemy/common/time.c may override cpu_wait!
  93. */
  94. static void au1k_wait(void)
  95. {
  96. __asm__(" .set mips3 \n"
  97. " cache 0x14, 0(%0) \n"
  98. " cache 0x14, 32(%0) \n"
  99. " sync \n"
  100. " nop \n"
  101. " wait \n"
  102. " nop \n"
  103. " nop \n"
  104. " nop \n"
  105. " nop \n"
  106. " .set mips0 \n"
  107. : : "r" (au1k_wait));
  108. }
  109. static int __initdata nowait;
  110. static int __init wait_disable(char *s)
  111. {
  112. nowait = 1;
  113. return 1;
  114. }
  115. __setup("nowait", wait_disable);
  116. static int __cpuinitdata mips_fpu_disabled;
  117. static int __init fpu_disable(char *s)
  118. {
  119. cpu_data[0].options &= ~MIPS_CPU_FPU;
  120. mips_fpu_disabled = 1;
  121. return 1;
  122. }
  123. __setup("nofpu", fpu_disable);
  124. int __cpuinitdata mips_dsp_disabled;
  125. static int __init dsp_disable(char *s)
  126. {
  127. cpu_data[0].ases &= ~MIPS_ASE_DSP;
  128. mips_dsp_disabled = 1;
  129. return 1;
  130. }
  131. __setup("nodsp", dsp_disable);
  132. void __init check_wait(void)
  133. {
  134. struct cpuinfo_mips *c = &current_cpu_data;
  135. if (nowait) {
  136. printk("Wait instruction disabled.\n");
  137. return;
  138. }
  139. switch (c->cputype) {
  140. case CPU_R3081:
  141. case CPU_R3081E:
  142. cpu_wait = r3081_wait;
  143. break;
  144. case CPU_TX3927:
  145. cpu_wait = r39xx_wait;
  146. break;
  147. case CPU_R4200:
  148. /* case CPU_R4300: */
  149. case CPU_R4600:
  150. case CPU_R4640:
  151. case CPU_R4650:
  152. case CPU_R4700:
  153. case CPU_R5000:
  154. case CPU_R5500:
  155. case CPU_NEVADA:
  156. case CPU_4KC:
  157. case CPU_4KEC:
  158. case CPU_4KSC:
  159. case CPU_5KC:
  160. case CPU_25KF:
  161. case CPU_PR4450:
  162. case CPU_BMIPS3300:
  163. case CPU_BMIPS4350:
  164. case CPU_BMIPS4380:
  165. case CPU_BMIPS5000:
  166. case CPU_CAVIUM_OCTEON:
  167. case CPU_CAVIUM_OCTEON_PLUS:
  168. case CPU_CAVIUM_OCTEON2:
  169. case CPU_JZRISC:
  170. case CPU_LOONGSON1:
  171. case CPU_XLR:
  172. case CPU_XLP:
  173. cpu_wait = r4k_wait;
  174. break;
  175. case CPU_RM7000:
  176. cpu_wait = rm7k_wait_irqoff;
  177. break;
  178. case CPU_M14KC:
  179. case CPU_24K:
  180. case CPU_34K:
  181. case CPU_1004K:
  182. cpu_wait = r4k_wait;
  183. if (read_c0_config7() & MIPS_CONF7_WII)
  184. cpu_wait = r4k_wait_irqoff;
  185. break;
  186. case CPU_74K:
  187. cpu_wait = r4k_wait;
  188. if ((c->processor_id & 0xff) >= PRID_REV_ENCODE_332(2, 1, 0))
  189. cpu_wait = r4k_wait_irqoff;
  190. break;
  191. case CPU_TX49XX:
  192. cpu_wait = r4k_wait_irqoff;
  193. break;
  194. case CPU_ALCHEMY:
  195. cpu_wait = au1k_wait;
  196. break;
  197. case CPU_20KC:
  198. /*
  199. * WAIT on Rev1.0 has E1, E2, E3 and E16.
  200. * WAIT on Rev2.0 and Rev3.0 has E16.
  201. * Rev3.1 WAIT is nop, why bother
  202. */
  203. if ((c->processor_id & 0xff) <= 0x64)
  204. break;
  205. /*
  206. * Another rev is incremeting c0_count at a reduced clock
  207. * rate while in WAIT mode. So we basically have the choice
  208. * between using the cp0 timer as clocksource or avoiding
  209. * the WAIT instruction. Until more details are known,
  210. * disable the use of WAIT for 20Kc entirely.
  211. cpu_wait = r4k_wait;
  212. */
  213. break;
  214. case CPU_RM9000:
  215. if ((c->processor_id & 0x00ff) >= 0x40)
  216. cpu_wait = r4k_wait;
  217. break;
  218. default:
  219. break;
  220. }
  221. }
  222. static inline void check_errata(void)
  223. {
  224. struct cpuinfo_mips *c = &current_cpu_data;
  225. switch (c->cputype) {
  226. case CPU_34K:
  227. /*
  228. * Erratum "RPS May Cause Incorrect Instruction Execution"
  229. * This code only handles VPE0, any SMP/SMTC/RTOS code
  230. * making use of VPE1 will be responsable for that VPE.
  231. */
  232. if ((c->processor_id & PRID_REV_MASK) <= PRID_REV_34K_V1_0_2)
  233. write_c0_config7(read_c0_config7() | MIPS_CONF7_RPS);
  234. break;
  235. default:
  236. break;
  237. }
  238. }
  239. void __init check_bugs32(void)
  240. {
  241. check_errata();
  242. }
  243. /*
  244. * Probe whether cpu has config register by trying to play with
  245. * alternate cache bit and see whether it matters.
  246. * It's used by cpu_probe to distinguish between R3000A and R3081.
  247. */
  248. static inline int cpu_has_confreg(void)
  249. {
  250. #ifdef CONFIG_CPU_R3000
  251. extern unsigned long r3k_cache_size(unsigned long);
  252. unsigned long size1, size2;
  253. unsigned long cfg = read_c0_conf();
  254. size1 = r3k_cache_size(ST0_ISC);
  255. write_c0_conf(cfg ^ R30XX_CONF_AC);
  256. size2 = r3k_cache_size(ST0_ISC);
  257. write_c0_conf(cfg);
  258. return size1 != size2;
  259. #else
  260. return 0;
  261. #endif
  262. }
  263. static inline void set_elf_platform(int cpu, const char *plat)
  264. {
  265. if (cpu == 0)
  266. __elf_platform = plat;
  267. }
  268. /*
  269. * Get the FPU Implementation/Revision.
  270. */
  271. static inline unsigned long cpu_get_fpu_id(void)
  272. {
  273. unsigned long tmp, fpu_id;
  274. tmp = read_c0_status();
  275. __enable_fpu();
  276. fpu_id = read_32bit_cp1_register(CP1_REVISION);
  277. write_c0_status(tmp);
  278. return fpu_id;
  279. }
  280. /*
  281. * Check the CPU has an FPU the official way.
  282. */
  283. static inline int __cpu_has_fpu(void)
  284. {
  285. return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE);
  286. }
  287. static inline void cpu_probe_vmbits(struct cpuinfo_mips *c)
  288. {
  289. #ifdef __NEED_VMBITS_PROBE
  290. write_c0_entryhi(0x3fffffffffffe000ULL);
  291. back_to_back_c0_hazard();
  292. c->vmbits = fls64(read_c0_entryhi() & 0x3fffffffffffe000ULL);
  293. #endif
  294. }
  295. static char unknown_isa[] __cpuinitdata = KERN_ERR \
  296. "Unsupported ISA type, c0.config0: %d.";
  297. static inline unsigned int decode_config0(struct cpuinfo_mips *c)
  298. {
  299. unsigned int config0;
  300. int isa;
  301. config0 = read_c0_config();
  302. if (((config0 & MIPS_CONF_MT) >> 7) == 1)
  303. c->options |= MIPS_CPU_TLB;
  304. isa = (config0 & MIPS_CONF_AT) >> 13;
  305. switch (isa) {
  306. case 0:
  307. switch ((config0 & MIPS_CONF_AR) >> 10) {
  308. case 0:
  309. c->isa_level = MIPS_CPU_ISA_M32R1;
  310. break;
  311. case 1:
  312. c->isa_level = MIPS_CPU_ISA_M32R2;
  313. break;
  314. default:
  315. goto unknown;
  316. }
  317. break;
  318. case 2:
  319. switch ((config0 & MIPS_CONF_AR) >> 10) {
  320. case 0:
  321. c->isa_level = MIPS_CPU_ISA_M64R1;
  322. break;
  323. case 1:
  324. c->isa_level = MIPS_CPU_ISA_M64R2;
  325. break;
  326. default:
  327. goto unknown;
  328. }
  329. break;
  330. default:
  331. goto unknown;
  332. }
  333. return config0 & MIPS_CONF_M;
  334. unknown:
  335. panic(unknown_isa, config0);
  336. }
  337. static inline unsigned int decode_config1(struct cpuinfo_mips *c)
  338. {
  339. unsigned int config1;
  340. config1 = read_c0_config1();
  341. if (config1 & MIPS_CONF1_MD)
  342. c->ases |= MIPS_ASE_MDMX;
  343. if (config1 & MIPS_CONF1_WR)
  344. c->options |= MIPS_CPU_WATCH;
  345. if (config1 & MIPS_CONF1_CA)
  346. c->ases |= MIPS_ASE_MIPS16;
  347. if (config1 & MIPS_CONF1_EP)
  348. c->options |= MIPS_CPU_EJTAG;
  349. if (config1 & MIPS_CONF1_FP) {
  350. c->options |= MIPS_CPU_FPU;
  351. c->options |= MIPS_CPU_32FPR;
  352. }
  353. if (cpu_has_tlb)
  354. c->tlbsize = ((config1 & MIPS_CONF1_TLBS) >> 25) + 1;
  355. return config1 & MIPS_CONF_M;
  356. }
  357. static inline unsigned int decode_config2(struct cpuinfo_mips *c)
  358. {
  359. unsigned int config2;
  360. config2 = read_c0_config2();
  361. if (config2 & MIPS_CONF2_SL)
  362. c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
  363. return config2 & MIPS_CONF_M;
  364. }
  365. static inline unsigned int decode_config3(struct cpuinfo_mips *c)
  366. {
  367. unsigned int config3;
  368. config3 = read_c0_config3();
  369. if (config3 & MIPS_CONF3_SM)
  370. c->ases |= MIPS_ASE_SMARTMIPS;
  371. if (config3 & MIPS_CONF3_DSP)
  372. c->ases |= MIPS_ASE_DSP;
  373. if (config3 & MIPS_CONF3_VINT)
  374. c->options |= MIPS_CPU_VINT;
  375. if (config3 & MIPS_CONF3_VEIC)
  376. c->options |= MIPS_CPU_VEIC;
  377. if (config3 & MIPS_CONF3_MT)
  378. c->ases |= MIPS_ASE_MIPSMT;
  379. if (config3 & MIPS_CONF3_ULRI)
  380. c->options |= MIPS_CPU_ULRI;
  381. return config3 & MIPS_CONF_M;
  382. }
  383. static inline unsigned int decode_config4(struct cpuinfo_mips *c)
  384. {
  385. unsigned int config4;
  386. config4 = read_c0_config4();
  387. if ((config4 & MIPS_CONF4_MMUEXTDEF) == MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT
  388. && cpu_has_tlb)
  389. c->tlbsize += (config4 & MIPS_CONF4_MMUSIZEEXT) * 0x40;
  390. c->kscratch_mask = (config4 >> 16) & 0xff;
  391. return config4 & MIPS_CONF_M;
  392. }
  393. static void __cpuinit decode_configs(struct cpuinfo_mips *c)
  394. {
  395. int ok;
  396. /* MIPS32 or MIPS64 compliant CPU. */
  397. c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER |
  398. MIPS_CPU_DIVEC | MIPS_CPU_LLSC | MIPS_CPU_MCHECK;
  399. c->scache.flags = MIPS_CACHE_NOT_PRESENT;
  400. ok = decode_config0(c); /* Read Config registers. */
  401. BUG_ON(!ok); /* Arch spec violation! */
  402. if (ok)
  403. ok = decode_config1(c);
  404. if (ok)
  405. ok = decode_config2(c);
  406. if (ok)
  407. ok = decode_config3(c);
  408. if (ok)
  409. ok = decode_config4(c);
  410. mips_probe_watch_registers(c);
  411. if (cpu_has_mips_r2)
  412. c->core = read_c0_ebase() & 0x3ff;
  413. }
  414. #define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE \
  415. | MIPS_CPU_COUNTER)
  416. static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
  417. {
  418. switch (c->processor_id & 0xff00) {
  419. case PRID_IMP_R2000:
  420. c->cputype = CPU_R2000;
  421. __cpu_name[cpu] = "R2000";
  422. c->isa_level = MIPS_CPU_ISA_I;
  423. c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
  424. MIPS_CPU_NOFPUEX;
  425. if (__cpu_has_fpu())
  426. c->options |= MIPS_CPU_FPU;
  427. c->tlbsize = 64;
  428. break;
  429. case PRID_IMP_R3000:
  430. if ((c->processor_id & 0xff) == PRID_REV_R3000A) {
  431. if (cpu_has_confreg()) {
  432. c->cputype = CPU_R3081E;
  433. __cpu_name[cpu] = "R3081";
  434. } else {
  435. c->cputype = CPU_R3000A;
  436. __cpu_name[cpu] = "R3000A";
  437. }
  438. break;
  439. } else {
  440. c->cputype = CPU_R3000;
  441. __cpu_name[cpu] = "R3000";
  442. }
  443. c->isa_level = MIPS_CPU_ISA_I;
  444. c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
  445. MIPS_CPU_NOFPUEX;
  446. if (__cpu_has_fpu())
  447. c->options |= MIPS_CPU_FPU;
  448. c->tlbsize = 64;
  449. break;
  450. case PRID_IMP_R4000:
  451. if (read_c0_config() & CONF_SC) {
  452. if ((c->processor_id & 0xff) >= PRID_REV_R4400) {
  453. c->cputype = CPU_R4400PC;
  454. __cpu_name[cpu] = "R4400PC";
  455. } else {
  456. c->cputype = CPU_R4000PC;
  457. __cpu_name[cpu] = "R4000PC";
  458. }
  459. } else {
  460. if ((c->processor_id & 0xff) >= PRID_REV_R4400) {
  461. c->cputype = CPU_R4400SC;
  462. __cpu_name[cpu] = "R4400SC";
  463. } else {
  464. c->cputype = CPU_R4000SC;
  465. __cpu_name[cpu] = "R4000SC";
  466. }
  467. }
  468. c->isa_level = MIPS_CPU_ISA_III;
  469. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  470. MIPS_CPU_WATCH | MIPS_CPU_VCE |
  471. MIPS_CPU_LLSC;
  472. c->tlbsize = 48;
  473. break;
  474. case PRID_IMP_VR41XX:
  475. switch (c->processor_id & 0xf0) {
  476. case PRID_REV_VR4111:
  477. c->cputype = CPU_VR4111;
  478. __cpu_name[cpu] = "NEC VR4111";
  479. break;
  480. case PRID_REV_VR4121:
  481. c->cputype = CPU_VR4121;
  482. __cpu_name[cpu] = "NEC VR4121";
  483. break;
  484. case PRID_REV_VR4122:
  485. if ((c->processor_id & 0xf) < 0x3) {
  486. c->cputype = CPU_VR4122;
  487. __cpu_name[cpu] = "NEC VR4122";
  488. } else {
  489. c->cputype = CPU_VR4181A;
  490. __cpu_name[cpu] = "NEC VR4181A";
  491. }
  492. break;
  493. case PRID_REV_VR4130:
  494. if ((c->processor_id & 0xf) < 0x4) {
  495. c->cputype = CPU_VR4131;
  496. __cpu_name[cpu] = "NEC VR4131";
  497. } else {
  498. c->cputype = CPU_VR4133;
  499. __cpu_name[cpu] = "NEC VR4133";
  500. }
  501. break;
  502. default:
  503. printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n");
  504. c->cputype = CPU_VR41XX;
  505. __cpu_name[cpu] = "NEC Vr41xx";
  506. break;
  507. }
  508. c->isa_level = MIPS_CPU_ISA_III;
  509. c->options = R4K_OPTS;
  510. c->tlbsize = 32;
  511. break;
  512. case PRID_IMP_R4300:
  513. c->cputype = CPU_R4300;
  514. __cpu_name[cpu] = "R4300";
  515. c->isa_level = MIPS_CPU_ISA_III;
  516. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  517. MIPS_CPU_LLSC;
  518. c->tlbsize = 32;
  519. break;
  520. case PRID_IMP_R4600:
  521. c->cputype = CPU_R4600;
  522. __cpu_name[cpu] = "R4600";
  523. c->isa_level = MIPS_CPU_ISA_III;
  524. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  525. MIPS_CPU_LLSC;
  526. c->tlbsize = 48;
  527. break;
  528. #if 0
  529. case PRID_IMP_R4650:
  530. /*
  531. * This processor doesn't have an MMU, so it's not
  532. * "real easy" to run Linux on it. It is left purely
  533. * for documentation. Commented out because it shares
  534. * it's c0_prid id number with the TX3900.
  535. */
  536. c->cputype = CPU_R4650;
  537. __cpu_name[cpu] = "R4650";
  538. c->isa_level = MIPS_CPU_ISA_III;
  539. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC;
  540. c->tlbsize = 48;
  541. break;
  542. #endif
  543. case PRID_IMP_TX39:
  544. c->isa_level = MIPS_CPU_ISA_I;
  545. c->options = MIPS_CPU_TLB | MIPS_CPU_TX39_CACHE;
  546. if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) {
  547. c->cputype = CPU_TX3927;
  548. __cpu_name[cpu] = "TX3927";
  549. c->tlbsize = 64;
  550. } else {
  551. switch (c->processor_id & 0xff) {
  552. case PRID_REV_TX3912:
  553. c->cputype = CPU_TX3912;
  554. __cpu_name[cpu] = "TX3912";
  555. c->tlbsize = 32;
  556. break;
  557. case PRID_REV_TX3922:
  558. c->cputype = CPU_TX3922;
  559. __cpu_name[cpu] = "TX3922";
  560. c->tlbsize = 64;
  561. break;
  562. }
  563. }
  564. break;
  565. case PRID_IMP_R4700:
  566. c->cputype = CPU_R4700;
  567. __cpu_name[cpu] = "R4700";
  568. c->isa_level = MIPS_CPU_ISA_III;
  569. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  570. MIPS_CPU_LLSC;
  571. c->tlbsize = 48;
  572. break;
  573. case PRID_IMP_TX49:
  574. c->cputype = CPU_TX49XX;
  575. __cpu_name[cpu] = "R49XX";
  576. c->isa_level = MIPS_CPU_ISA_III;
  577. c->options = R4K_OPTS | MIPS_CPU_LLSC;
  578. if (!(c->processor_id & 0x08))
  579. c->options |= MIPS_CPU_FPU | MIPS_CPU_32FPR;
  580. c->tlbsize = 48;
  581. break;
  582. case PRID_IMP_R5000:
  583. c->cputype = CPU_R5000;
  584. __cpu_name[cpu] = "R5000";
  585. c->isa_level = MIPS_CPU_ISA_IV;
  586. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  587. MIPS_CPU_LLSC;
  588. c->tlbsize = 48;
  589. break;
  590. case PRID_IMP_R5432:
  591. c->cputype = CPU_R5432;
  592. __cpu_name[cpu] = "R5432";
  593. c->isa_level = MIPS_CPU_ISA_IV;
  594. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  595. MIPS_CPU_WATCH | MIPS_CPU_LLSC;
  596. c->tlbsize = 48;
  597. break;
  598. case PRID_IMP_R5500:
  599. c->cputype = CPU_R5500;
  600. __cpu_name[cpu] = "R5500";
  601. c->isa_level = MIPS_CPU_ISA_IV;
  602. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  603. MIPS_CPU_WATCH | MIPS_CPU_LLSC;
  604. c->tlbsize = 48;
  605. break;
  606. case PRID_IMP_NEVADA:
  607. c->cputype = CPU_NEVADA;
  608. __cpu_name[cpu] = "Nevada";
  609. c->isa_level = MIPS_CPU_ISA_IV;
  610. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  611. MIPS_CPU_DIVEC | MIPS_CPU_LLSC;
  612. c->tlbsize = 48;
  613. break;
  614. case PRID_IMP_R6000:
  615. c->cputype = CPU_R6000;
  616. __cpu_name[cpu] = "R6000";
  617. c->isa_level = MIPS_CPU_ISA_II;
  618. c->options = MIPS_CPU_TLB | MIPS_CPU_FPU |
  619. MIPS_CPU_LLSC;
  620. c->tlbsize = 32;
  621. break;
  622. case PRID_IMP_R6000A:
  623. c->cputype = CPU_R6000A;
  624. __cpu_name[cpu] = "R6000A";
  625. c->isa_level = MIPS_CPU_ISA_II;
  626. c->options = MIPS_CPU_TLB | MIPS_CPU_FPU |
  627. MIPS_CPU_LLSC;
  628. c->tlbsize = 32;
  629. break;
  630. case PRID_IMP_RM7000:
  631. c->cputype = CPU_RM7000;
  632. __cpu_name[cpu] = "RM7000";
  633. c->isa_level = MIPS_CPU_ISA_IV;
  634. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  635. MIPS_CPU_LLSC;
  636. /*
  637. * Undocumented RM7000: Bit 29 in the info register of
  638. * the RM7000 v2.0 indicates if the TLB has 48 or 64
  639. * entries.
  640. *
  641. * 29 1 => 64 entry JTLB
  642. * 0 => 48 entry JTLB
  643. */
  644. c->tlbsize = (read_c0_info() & (1 << 29)) ? 64 : 48;
  645. break;
  646. case PRID_IMP_RM9000:
  647. c->cputype = CPU_RM9000;
  648. __cpu_name[cpu] = "RM9000";
  649. c->isa_level = MIPS_CPU_ISA_IV;
  650. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  651. MIPS_CPU_LLSC;
  652. /*
  653. * Bit 29 in the info register of the RM9000
  654. * indicates if the TLB has 48 or 64 entries.
  655. *
  656. * 29 1 => 64 entry JTLB
  657. * 0 => 48 entry JTLB
  658. */
  659. c->tlbsize = (read_c0_info() & (1 << 29)) ? 64 : 48;
  660. break;
  661. case PRID_IMP_R8000:
  662. c->cputype = CPU_R8000;
  663. __cpu_name[cpu] = "RM8000";
  664. c->isa_level = MIPS_CPU_ISA_IV;
  665. c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
  666. MIPS_CPU_FPU | MIPS_CPU_32FPR |
  667. MIPS_CPU_LLSC;
  668. c->tlbsize = 384; /* has weird TLB: 3-way x 128 */
  669. break;
  670. case PRID_IMP_R10000:
  671. c->cputype = CPU_R10000;
  672. __cpu_name[cpu] = "R10000";
  673. c->isa_level = MIPS_CPU_ISA_IV;
  674. c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
  675. MIPS_CPU_FPU | MIPS_CPU_32FPR |
  676. MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
  677. MIPS_CPU_LLSC;
  678. c->tlbsize = 64;
  679. break;
  680. case PRID_IMP_R12000:
  681. c->cputype = CPU_R12000;
  682. __cpu_name[cpu] = "R12000";
  683. c->isa_level = MIPS_CPU_ISA_IV;
  684. c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
  685. MIPS_CPU_FPU | MIPS_CPU_32FPR |
  686. MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
  687. MIPS_CPU_LLSC;
  688. c->tlbsize = 64;
  689. break;
  690. case PRID_IMP_R14000:
  691. c->cputype = CPU_R14000;
  692. __cpu_name[cpu] = "R14000";
  693. c->isa_level = MIPS_CPU_ISA_IV;
  694. c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
  695. MIPS_CPU_FPU | MIPS_CPU_32FPR |
  696. MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
  697. MIPS_CPU_LLSC;
  698. c->tlbsize = 64;
  699. break;
  700. case PRID_IMP_LOONGSON2:
  701. c->cputype = CPU_LOONGSON2;
  702. __cpu_name[cpu] = "ICT Loongson-2";
  703. switch (c->processor_id & PRID_REV_MASK) {
  704. case PRID_REV_LOONGSON2E:
  705. set_elf_platform(cpu, "loongson2e");
  706. break;
  707. case PRID_REV_LOONGSON2F:
  708. set_elf_platform(cpu, "loongson2f");
  709. break;
  710. }
  711. c->isa_level = MIPS_CPU_ISA_III;
  712. c->options = R4K_OPTS |
  713. MIPS_CPU_FPU | MIPS_CPU_LLSC |
  714. MIPS_CPU_32FPR;
  715. c->tlbsize = 64;
  716. break;
  717. case PRID_IMP_LOONGSON1:
  718. decode_configs(c);
  719. c->cputype = CPU_LOONGSON1;
  720. switch (c->processor_id & PRID_REV_MASK) {
  721. case PRID_REV_LOONGSON1B:
  722. __cpu_name[cpu] = "Loongson 1B";
  723. break;
  724. }
  725. break;
  726. }
  727. }
  728. static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
  729. {
  730. decode_configs(c);
  731. switch (c->processor_id & 0xff00) {
  732. case PRID_IMP_4KC:
  733. c->cputype = CPU_4KC;
  734. __cpu_name[cpu] = "MIPS 4Kc";
  735. break;
  736. case PRID_IMP_4KEC:
  737. case PRID_IMP_4KECR2:
  738. c->cputype = CPU_4KEC;
  739. __cpu_name[cpu] = "MIPS 4KEc";
  740. break;
  741. case PRID_IMP_4KSC:
  742. case PRID_IMP_4KSD:
  743. c->cputype = CPU_4KSC;
  744. __cpu_name[cpu] = "MIPS 4KSc";
  745. break;
  746. case PRID_IMP_5KC:
  747. c->cputype = CPU_5KC;
  748. __cpu_name[cpu] = "MIPS 5Kc";
  749. break;
  750. case PRID_IMP_5KE:
  751. c->cputype = CPU_5KE;
  752. __cpu_name[cpu] = "MIPS 5KE";
  753. break;
  754. case PRID_IMP_20KC:
  755. c->cputype = CPU_20KC;
  756. __cpu_name[cpu] = "MIPS 20Kc";
  757. break;
  758. case PRID_IMP_24K:
  759. case PRID_IMP_24KE:
  760. c->cputype = CPU_24K;
  761. __cpu_name[cpu] = "MIPS 24Kc";
  762. break;
  763. case PRID_IMP_25KF:
  764. c->cputype = CPU_25KF;
  765. __cpu_name[cpu] = "MIPS 25Kc";
  766. break;
  767. case PRID_IMP_34K:
  768. c->cputype = CPU_34K;
  769. __cpu_name[cpu] = "MIPS 34Kc";
  770. break;
  771. case PRID_IMP_74K:
  772. c->cputype = CPU_74K;
  773. __cpu_name[cpu] = "MIPS 74Kc";
  774. break;
  775. case PRID_IMP_M14KC:
  776. c->cputype = CPU_M14KC;
  777. __cpu_name[cpu] = "MIPS M14Kc";
  778. break;
  779. case PRID_IMP_1004K:
  780. c->cputype = CPU_1004K;
  781. __cpu_name[cpu] = "MIPS 1004Kc";
  782. break;
  783. }
  784. spram_config();
  785. }
  786. static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
  787. {
  788. decode_configs(c);
  789. switch (c->processor_id & 0xff00) {
  790. case PRID_IMP_AU1_REV1:
  791. case PRID_IMP_AU1_REV2:
  792. c->cputype = CPU_ALCHEMY;
  793. switch ((c->processor_id >> 24) & 0xff) {
  794. case 0:
  795. __cpu_name[cpu] = "Au1000";
  796. break;
  797. case 1:
  798. __cpu_name[cpu] = "Au1500";
  799. break;
  800. case 2:
  801. __cpu_name[cpu] = "Au1100";
  802. break;
  803. case 3:
  804. __cpu_name[cpu] = "Au1550";
  805. break;
  806. case 4:
  807. __cpu_name[cpu] = "Au1200";
  808. if ((c->processor_id & 0xff) == 2)
  809. __cpu_name[cpu] = "Au1250";
  810. break;
  811. case 5:
  812. __cpu_name[cpu] = "Au1210";
  813. break;
  814. default:
  815. __cpu_name[cpu] = "Au1xxx";
  816. break;
  817. }
  818. break;
  819. }
  820. }
  821. static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu)
  822. {
  823. decode_configs(c);
  824. switch (c->processor_id & 0xff00) {
  825. case PRID_IMP_SB1:
  826. c->cputype = CPU_SB1;
  827. __cpu_name[cpu] = "SiByte SB1";
  828. /* FPU in pass1 is known to have issues. */
  829. if ((c->processor_id & 0xff) < 0x02)
  830. c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
  831. break;
  832. case PRID_IMP_SB1A:
  833. c->cputype = CPU_SB1A;
  834. __cpu_name[cpu] = "SiByte SB1A";
  835. break;
  836. }
  837. }
  838. static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu)
  839. {
  840. decode_configs(c);
  841. switch (c->processor_id & 0xff00) {
  842. case PRID_IMP_SR71000:
  843. c->cputype = CPU_SR71000;
  844. __cpu_name[cpu] = "Sandcraft SR71000";
  845. c->scache.ways = 8;
  846. c->tlbsize = 64;
  847. break;
  848. }
  849. }
  850. static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu)
  851. {
  852. decode_configs(c);
  853. switch (c->processor_id & 0xff00) {
  854. case PRID_IMP_PR4450:
  855. c->cputype = CPU_PR4450;
  856. __cpu_name[cpu] = "Philips PR4450";
  857. c->isa_level = MIPS_CPU_ISA_M32R1;
  858. break;
  859. }
  860. }
  861. static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
  862. {
  863. decode_configs(c);
  864. switch (c->processor_id & 0xff00) {
  865. case PRID_IMP_BMIPS32_REV4:
  866. case PRID_IMP_BMIPS32_REV8:
  867. c->cputype = CPU_BMIPS32;
  868. __cpu_name[cpu] = "Broadcom BMIPS32";
  869. set_elf_platform(cpu, "bmips32");
  870. break;
  871. case PRID_IMP_BMIPS3300:
  872. case PRID_IMP_BMIPS3300_ALT:
  873. case PRID_IMP_BMIPS3300_BUG:
  874. c->cputype = CPU_BMIPS3300;
  875. __cpu_name[cpu] = "Broadcom BMIPS3300";
  876. set_elf_platform(cpu, "bmips3300");
  877. break;
  878. case PRID_IMP_BMIPS43XX: {
  879. int rev = c->processor_id & 0xff;
  880. if (rev >= PRID_REV_BMIPS4380_LO &&
  881. rev <= PRID_REV_BMIPS4380_HI) {
  882. c->cputype = CPU_BMIPS4380;
  883. __cpu_name[cpu] = "Broadcom BMIPS4380";
  884. set_elf_platform(cpu, "bmips4380");
  885. } else {
  886. c->cputype = CPU_BMIPS4350;
  887. __cpu_name[cpu] = "Broadcom BMIPS4350";
  888. set_elf_platform(cpu, "bmips4350");
  889. }
  890. break;
  891. }
  892. case PRID_IMP_BMIPS5000:
  893. c->cputype = CPU_BMIPS5000;
  894. __cpu_name[cpu] = "Broadcom BMIPS5000";
  895. set_elf_platform(cpu, "bmips5000");
  896. c->options |= MIPS_CPU_ULRI;
  897. break;
  898. }
  899. }
  900. static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
  901. {
  902. decode_configs(c);
  903. switch (c->processor_id & 0xff00) {
  904. case PRID_IMP_CAVIUM_CN38XX:
  905. case PRID_IMP_CAVIUM_CN31XX:
  906. case PRID_IMP_CAVIUM_CN30XX:
  907. c->cputype = CPU_CAVIUM_OCTEON;
  908. __cpu_name[cpu] = "Cavium Octeon";
  909. goto platform;
  910. case PRID_IMP_CAVIUM_CN58XX:
  911. case PRID_IMP_CAVIUM_CN56XX:
  912. case PRID_IMP_CAVIUM_CN50XX:
  913. case PRID_IMP_CAVIUM_CN52XX:
  914. c->cputype = CPU_CAVIUM_OCTEON_PLUS;
  915. __cpu_name[cpu] = "Cavium Octeon+";
  916. platform:
  917. set_elf_platform(cpu, "octeon");
  918. break;
  919. case PRID_IMP_CAVIUM_CN61XX:
  920. case PRID_IMP_CAVIUM_CN63XX:
  921. case PRID_IMP_CAVIUM_CN66XX:
  922. case PRID_IMP_CAVIUM_CN68XX:
  923. c->cputype = CPU_CAVIUM_OCTEON2;
  924. __cpu_name[cpu] = "Cavium Octeon II";
  925. set_elf_platform(cpu, "octeon2");
  926. break;
  927. default:
  928. printk(KERN_INFO "Unknown Octeon chip!\n");
  929. c->cputype = CPU_UNKNOWN;
  930. break;
  931. }
  932. }
  933. static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
  934. {
  935. decode_configs(c);
  936. /* JZRISC does not implement the CP0 counter. */
  937. c->options &= ~MIPS_CPU_COUNTER;
  938. switch (c->processor_id & 0xff00) {
  939. case PRID_IMP_JZRISC:
  940. c->cputype = CPU_JZRISC;
  941. __cpu_name[cpu] = "Ingenic JZRISC";
  942. break;
  943. default:
  944. panic("Unknown Ingenic Processor ID!");
  945. break;
  946. }
  947. }
  948. static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu)
  949. {
  950. decode_configs(c);
  951. if ((c->processor_id & 0xff00) == PRID_IMP_NETLOGIC_AU13XX) {
  952. c->cputype = CPU_ALCHEMY;
  953. __cpu_name[cpu] = "Au1300";
  954. /* following stuff is not for Alchemy */
  955. return;
  956. }
  957. c->options = (MIPS_CPU_TLB |
  958. MIPS_CPU_4KEX |
  959. MIPS_CPU_COUNTER |
  960. MIPS_CPU_DIVEC |
  961. MIPS_CPU_WATCH |
  962. MIPS_CPU_EJTAG |
  963. MIPS_CPU_LLSC);
  964. switch (c->processor_id & 0xff00) {
  965. case PRID_IMP_NETLOGIC_XLP8XX:
  966. case PRID_IMP_NETLOGIC_XLP3XX:
  967. c->cputype = CPU_XLP;
  968. __cpu_name[cpu] = "Netlogic XLP";
  969. break;
  970. case PRID_IMP_NETLOGIC_XLR732:
  971. case PRID_IMP_NETLOGIC_XLR716:
  972. case PRID_IMP_NETLOGIC_XLR532:
  973. case PRID_IMP_NETLOGIC_XLR308:
  974. case PRID_IMP_NETLOGIC_XLR532C:
  975. case PRID_IMP_NETLOGIC_XLR516C:
  976. case PRID_IMP_NETLOGIC_XLR508C:
  977. case PRID_IMP_NETLOGIC_XLR308C:
  978. c->cputype = CPU_XLR;
  979. __cpu_name[cpu] = "Netlogic XLR";
  980. break;
  981. case PRID_IMP_NETLOGIC_XLS608:
  982. case PRID_IMP_NETLOGIC_XLS408:
  983. case PRID_IMP_NETLOGIC_XLS404:
  984. case PRID_IMP_NETLOGIC_XLS208:
  985. case PRID_IMP_NETLOGIC_XLS204:
  986. case PRID_IMP_NETLOGIC_XLS108:
  987. case PRID_IMP_NETLOGIC_XLS104:
  988. case PRID_IMP_NETLOGIC_XLS616B:
  989. case PRID_IMP_NETLOGIC_XLS608B:
  990. case PRID_IMP_NETLOGIC_XLS416B:
  991. case PRID_IMP_NETLOGIC_XLS412B:
  992. case PRID_IMP_NETLOGIC_XLS408B:
  993. case PRID_IMP_NETLOGIC_XLS404B:
  994. c->cputype = CPU_XLR;
  995. __cpu_name[cpu] = "Netlogic XLS";
  996. break;
  997. default:
  998. pr_info("Unknown Netlogic chip id [%02x]!\n",
  999. c->processor_id);
  1000. c->cputype = CPU_XLR;
  1001. break;
  1002. }
  1003. if (c->cputype == CPU_XLP) {
  1004. c->isa_level = MIPS_CPU_ISA_M64R2;
  1005. c->options |= (MIPS_CPU_FPU | MIPS_CPU_ULRI | MIPS_CPU_MCHECK);
  1006. /* This will be updated again after all threads are woken up */
  1007. c->tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1;
  1008. } else {
  1009. c->isa_level = MIPS_CPU_ISA_M64R1;
  1010. c->tlbsize = ((read_c0_config1() >> 25) & 0x3f) + 1;
  1011. }
  1012. }
  1013. #ifdef CONFIG_64BIT
  1014. /* For use by uaccess.h */
  1015. u64 __ua_limit;
  1016. EXPORT_SYMBOL(__ua_limit);
  1017. #endif
  1018. const char *__cpu_name[NR_CPUS];
  1019. const char *__elf_platform;
  1020. __cpuinit void cpu_probe(void)
  1021. {
  1022. struct cpuinfo_mips *c = &current_cpu_data;
  1023. unsigned int cpu = smp_processor_id();
  1024. c->processor_id = PRID_IMP_UNKNOWN;
  1025. c->fpu_id = FPIR_IMP_NONE;
  1026. c->cputype = CPU_UNKNOWN;
  1027. c->processor_id = read_c0_prid();
  1028. switch (c->processor_id & 0xff0000) {
  1029. case PRID_COMP_LEGACY:
  1030. cpu_probe_legacy(c, cpu);
  1031. break;
  1032. case PRID_COMP_MIPS:
  1033. cpu_probe_mips(c, cpu);
  1034. break;
  1035. case PRID_COMP_ALCHEMY:
  1036. cpu_probe_alchemy(c, cpu);
  1037. break;
  1038. case PRID_COMP_SIBYTE:
  1039. cpu_probe_sibyte(c, cpu);
  1040. break;
  1041. case PRID_COMP_BROADCOM:
  1042. cpu_probe_broadcom(c, cpu);
  1043. break;
  1044. case PRID_COMP_SANDCRAFT:
  1045. cpu_probe_sandcraft(c, cpu);
  1046. break;
  1047. case PRID_COMP_NXP:
  1048. cpu_probe_nxp(c, cpu);
  1049. break;
  1050. case PRID_COMP_CAVIUM:
  1051. cpu_probe_cavium(c, cpu);
  1052. break;
  1053. case PRID_COMP_INGENIC:
  1054. cpu_probe_ingenic(c, cpu);
  1055. break;
  1056. case PRID_COMP_NETLOGIC:
  1057. cpu_probe_netlogic(c, cpu);
  1058. break;
  1059. }
  1060. BUG_ON(!__cpu_name[cpu]);
  1061. BUG_ON(c->cputype == CPU_UNKNOWN);
  1062. /*
  1063. * Platform code can force the cpu type to optimize code
  1064. * generation. In that case be sure the cpu type is correctly
  1065. * manually setup otherwise it could trigger some nasty bugs.
  1066. */
  1067. BUG_ON(current_cpu_type() != c->cputype);
  1068. if (mips_fpu_disabled)
  1069. c->options &= ~MIPS_CPU_FPU;
  1070. if (mips_dsp_disabled)
  1071. c->ases &= ~MIPS_ASE_DSP;
  1072. if (c->options & MIPS_CPU_FPU) {
  1073. c->fpu_id = cpu_get_fpu_id();
  1074. if (c->isa_level == MIPS_CPU_ISA_M32R1 ||
  1075. c->isa_level == MIPS_CPU_ISA_M32R2 ||
  1076. c->isa_level == MIPS_CPU_ISA_M64R1 ||
  1077. c->isa_level == MIPS_CPU_ISA_M64R2) {
  1078. if (c->fpu_id & MIPS_FPIR_3D)
  1079. c->ases |= MIPS_ASE_MIPS3D;
  1080. }
  1081. }
  1082. if (cpu_has_mips_r2)
  1083. c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
  1084. else
  1085. c->srsets = 1;
  1086. cpu_probe_vmbits(c);
  1087. #ifdef CONFIG_64BIT
  1088. if (cpu == 0)
  1089. __ua_limit = ~((1ull << cpu_vmbits) - 1);
  1090. #endif
  1091. }
  1092. __cpuinit void cpu_report(void)
  1093. {
  1094. struct cpuinfo_mips *c = &current_cpu_data;
  1095. printk(KERN_INFO "CPU revision is: %08x (%s)\n",
  1096. c->processor_id, cpu_name_string());
  1097. if (c->options & MIPS_CPU_FPU)
  1098. printk(KERN_INFO "FPU revision is: %08x\n", c->fpu_id);
  1099. }