cpu-probe.c 28 KB

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