cpu-probe.c 28 KB

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