cpu-probe.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. /*
  2. * Processor capabilities determination functions.
  3. *
  4. * Copyright (C) xxxx the Anonymous
  5. * Copyright (C) 2003, 2004 Maciej W. Rozycki
  6. * Copyright (C) 1994 - 2003 Ralf Baechle
  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/config.h>
  15. #include <linux/init.h>
  16. #include <linux/kernel.h>
  17. #include <linux/ptrace.h>
  18. #include <linux/stddef.h>
  19. #include <asm/cpu.h>
  20. #include <asm/fpu.h>
  21. #include <asm/mipsregs.h>
  22. #include <asm/system.h>
  23. /*
  24. * Not all of the MIPS CPUs have the "wait" instruction available. Moreover,
  25. * the implementation of the "wait" feature differs between CPU families. This
  26. * points to the function that implements CPU specific wait.
  27. * The wait instruction stops the pipeline and reduces the power consumption of
  28. * the CPU very much.
  29. */
  30. void (*cpu_wait)(void) = NULL;
  31. static void r3081_wait(void)
  32. {
  33. unsigned long cfg = read_c0_conf();
  34. write_c0_conf(cfg | R30XX_CONF_HALT);
  35. }
  36. static void r39xx_wait(void)
  37. {
  38. unsigned long cfg = read_c0_conf();
  39. write_c0_conf(cfg | TX39_CONF_HALT);
  40. }
  41. static void r4k_wait(void)
  42. {
  43. __asm__(".set\tmips3\n\t"
  44. "wait\n\t"
  45. ".set\tmips0");
  46. }
  47. /* The Au1xxx wait is available only if using 32khz counter or
  48. * external timer source, but specifically not CP0 Counter. */
  49. int allow_au1k_wait;
  50. static void au1k_wait(void)
  51. {
  52. /* using the wait instruction makes CP0 counter unusable */
  53. __asm__(".set mips3\n\t"
  54. "cache 0x14, 0(%0)\n\t"
  55. "cache 0x14, 32(%0)\n\t"
  56. "sync\n\t"
  57. "nop\n\t"
  58. "wait\n\t"
  59. "nop\n\t"
  60. "nop\n\t"
  61. "nop\n\t"
  62. "nop\n\t"
  63. ".set mips0\n\t"
  64. : : "r" (au1k_wait));
  65. }
  66. static inline void check_wait(void)
  67. {
  68. struct cpuinfo_mips *c = &current_cpu_data;
  69. printk("Checking for 'wait' instruction... ");
  70. switch (c->cputype) {
  71. case CPU_R3081:
  72. case CPU_R3081E:
  73. cpu_wait = r3081_wait;
  74. printk(" available.\n");
  75. break;
  76. case CPU_TX3927:
  77. cpu_wait = r39xx_wait;
  78. printk(" available.\n");
  79. break;
  80. case CPU_R4200:
  81. /* case CPU_R4300: */
  82. case CPU_R4600:
  83. case CPU_R4640:
  84. case CPU_R4650:
  85. case CPU_R4700:
  86. case CPU_R5000:
  87. case CPU_NEVADA:
  88. case CPU_RM7000:
  89. case CPU_RM9000:
  90. case CPU_TX49XX:
  91. case CPU_4KC:
  92. case CPU_4KEC:
  93. case CPU_4KSC:
  94. case CPU_5KC:
  95. /* case CPU_20KC:*/
  96. case CPU_24K:
  97. case CPU_25KF:
  98. cpu_wait = r4k_wait;
  99. printk(" available.\n");
  100. break;
  101. case CPU_AU1000:
  102. case CPU_AU1100:
  103. case CPU_AU1500:
  104. case CPU_AU1550:
  105. case CPU_AU1200:
  106. if (allow_au1k_wait) {
  107. cpu_wait = au1k_wait;
  108. printk(" available.\n");
  109. } else
  110. printk(" unavailable.\n");
  111. break;
  112. default:
  113. printk(" unavailable.\n");
  114. break;
  115. }
  116. }
  117. void __init check_bugs32(void)
  118. {
  119. check_wait();
  120. }
  121. /*
  122. * Probe whether cpu has config register by trying to play with
  123. * alternate cache bit and see whether it matters.
  124. * It's used by cpu_probe to distinguish between R3000A and R3081.
  125. */
  126. static inline int cpu_has_confreg(void)
  127. {
  128. #ifdef CONFIG_CPU_R3000
  129. extern unsigned long r3k_cache_size(unsigned long);
  130. unsigned long size1, size2;
  131. unsigned long cfg = read_c0_conf();
  132. size1 = r3k_cache_size(ST0_ISC);
  133. write_c0_conf(cfg ^ R30XX_CONF_AC);
  134. size2 = r3k_cache_size(ST0_ISC);
  135. write_c0_conf(cfg);
  136. return size1 != size2;
  137. #else
  138. return 0;
  139. #endif
  140. }
  141. /*
  142. * Get the FPU Implementation/Revision.
  143. */
  144. static inline unsigned long cpu_get_fpu_id(void)
  145. {
  146. unsigned long tmp, fpu_id;
  147. tmp = read_c0_status();
  148. __enable_fpu();
  149. fpu_id = read_32bit_cp1_register(CP1_REVISION);
  150. write_c0_status(tmp);
  151. return fpu_id;
  152. }
  153. /*
  154. * Check the CPU has an FPU the official way.
  155. */
  156. static inline int __cpu_has_fpu(void)
  157. {
  158. return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE);
  159. }
  160. #define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4KTLB \
  161. | MIPS_CPU_COUNTER)
  162. static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
  163. {
  164. switch (c->processor_id & 0xff00) {
  165. case PRID_IMP_R2000:
  166. c->cputype = CPU_R2000;
  167. c->isa_level = MIPS_CPU_ISA_I;
  168. c->options = MIPS_CPU_TLB | MIPS_CPU_NOFPUEX;
  169. if (__cpu_has_fpu())
  170. c->options |= MIPS_CPU_FPU;
  171. c->tlbsize = 64;
  172. break;
  173. case PRID_IMP_R3000:
  174. if ((c->processor_id & 0xff) == PRID_REV_R3000A)
  175. if (cpu_has_confreg())
  176. c->cputype = CPU_R3081E;
  177. else
  178. c->cputype = CPU_R3000A;
  179. else
  180. c->cputype = CPU_R3000;
  181. c->isa_level = MIPS_CPU_ISA_I;
  182. c->options = MIPS_CPU_TLB | MIPS_CPU_NOFPUEX;
  183. if (__cpu_has_fpu())
  184. c->options |= MIPS_CPU_FPU;
  185. c->tlbsize = 64;
  186. break;
  187. case PRID_IMP_R4000:
  188. if (read_c0_config() & CONF_SC) {
  189. if ((c->processor_id & 0xff) >= PRID_REV_R4400)
  190. c->cputype = CPU_R4400PC;
  191. else
  192. c->cputype = CPU_R4000PC;
  193. } else {
  194. if ((c->processor_id & 0xff) >= PRID_REV_R4400)
  195. c->cputype = CPU_R4400SC;
  196. else
  197. c->cputype = CPU_R4000SC;
  198. }
  199. c->isa_level = MIPS_CPU_ISA_III;
  200. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  201. MIPS_CPU_WATCH | MIPS_CPU_VCE |
  202. MIPS_CPU_LLSC;
  203. c->tlbsize = 48;
  204. break;
  205. case PRID_IMP_VR41XX:
  206. switch (c->processor_id & 0xf0) {
  207. case PRID_REV_VR4111:
  208. c->cputype = CPU_VR4111;
  209. break;
  210. case PRID_REV_VR4121:
  211. c->cputype = CPU_VR4121;
  212. break;
  213. case PRID_REV_VR4122:
  214. if ((c->processor_id & 0xf) < 0x3)
  215. c->cputype = CPU_VR4122;
  216. else
  217. c->cputype = CPU_VR4181A;
  218. break;
  219. case PRID_REV_VR4130:
  220. if ((c->processor_id & 0xf) < 0x4)
  221. c->cputype = CPU_VR4131;
  222. else
  223. c->cputype = CPU_VR4133;
  224. break;
  225. default:
  226. printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n");
  227. c->cputype = CPU_VR41XX;
  228. break;
  229. }
  230. c->isa_level = MIPS_CPU_ISA_III;
  231. c->options = R4K_OPTS;
  232. c->tlbsize = 32;
  233. break;
  234. case PRID_IMP_R4300:
  235. c->cputype = CPU_R4300;
  236. c->isa_level = MIPS_CPU_ISA_III;
  237. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  238. MIPS_CPU_LLSC;
  239. c->tlbsize = 32;
  240. break;
  241. case PRID_IMP_R4600:
  242. c->cputype = CPU_R4600;
  243. c->isa_level = MIPS_CPU_ISA_III;
  244. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC;
  245. c->tlbsize = 48;
  246. break;
  247. #if 0
  248. case PRID_IMP_R4650:
  249. /*
  250. * This processor doesn't have an MMU, so it's not
  251. * "real easy" to run Linux on it. It is left purely
  252. * for documentation. Commented out because it shares
  253. * it's c0_prid id number with the TX3900.
  254. */
  255. c->cputype = CPU_R4650;
  256. c->isa_level = MIPS_CPU_ISA_III;
  257. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC;
  258. c->tlbsize = 48;
  259. break;
  260. #endif
  261. case PRID_IMP_TX39:
  262. c->isa_level = MIPS_CPU_ISA_I;
  263. c->options = MIPS_CPU_TLB;
  264. if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) {
  265. c->cputype = CPU_TX3927;
  266. c->tlbsize = 64;
  267. } else {
  268. switch (c->processor_id & 0xff) {
  269. case PRID_REV_TX3912:
  270. c->cputype = CPU_TX3912;
  271. c->tlbsize = 32;
  272. break;
  273. case PRID_REV_TX3922:
  274. c->cputype = CPU_TX3922;
  275. c->tlbsize = 64;
  276. break;
  277. default:
  278. c->cputype = CPU_UNKNOWN;
  279. break;
  280. }
  281. }
  282. break;
  283. case PRID_IMP_R4700:
  284. c->cputype = CPU_R4700;
  285. c->isa_level = MIPS_CPU_ISA_III;
  286. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  287. MIPS_CPU_LLSC;
  288. c->tlbsize = 48;
  289. break;
  290. case PRID_IMP_TX49:
  291. c->cputype = CPU_TX49XX;
  292. c->isa_level = MIPS_CPU_ISA_III;
  293. c->options = R4K_OPTS | MIPS_CPU_LLSC;
  294. if (!(c->processor_id & 0x08))
  295. c->options |= MIPS_CPU_FPU | MIPS_CPU_32FPR;
  296. c->tlbsize = 48;
  297. break;
  298. case PRID_IMP_R5000:
  299. c->cputype = CPU_R5000;
  300. c->isa_level = MIPS_CPU_ISA_IV;
  301. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  302. MIPS_CPU_LLSC;
  303. c->tlbsize = 48;
  304. break;
  305. case PRID_IMP_R5432:
  306. c->cputype = CPU_R5432;
  307. c->isa_level = MIPS_CPU_ISA_IV;
  308. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  309. MIPS_CPU_WATCH | MIPS_CPU_LLSC;
  310. c->tlbsize = 48;
  311. break;
  312. case PRID_IMP_R5500:
  313. c->cputype = CPU_R5500;
  314. c->isa_level = MIPS_CPU_ISA_IV;
  315. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  316. MIPS_CPU_WATCH | MIPS_CPU_LLSC;
  317. c->tlbsize = 48;
  318. break;
  319. case PRID_IMP_NEVADA:
  320. c->cputype = CPU_NEVADA;
  321. c->isa_level = MIPS_CPU_ISA_IV;
  322. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  323. MIPS_CPU_DIVEC | MIPS_CPU_LLSC;
  324. c->tlbsize = 48;
  325. break;
  326. case PRID_IMP_R6000:
  327. c->cputype = CPU_R6000;
  328. c->isa_level = MIPS_CPU_ISA_II;
  329. c->options = MIPS_CPU_TLB | MIPS_CPU_FPU |
  330. MIPS_CPU_LLSC;
  331. c->tlbsize = 32;
  332. break;
  333. case PRID_IMP_R6000A:
  334. c->cputype = CPU_R6000A;
  335. c->isa_level = MIPS_CPU_ISA_II;
  336. c->options = MIPS_CPU_TLB | MIPS_CPU_FPU |
  337. MIPS_CPU_LLSC;
  338. c->tlbsize = 32;
  339. break;
  340. case PRID_IMP_RM7000:
  341. c->cputype = CPU_RM7000;
  342. c->isa_level = MIPS_CPU_ISA_IV;
  343. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  344. MIPS_CPU_LLSC;
  345. /*
  346. * Undocumented RM7000: Bit 29 in the info register of
  347. * the RM7000 v2.0 indicates if the TLB has 48 or 64
  348. * entries.
  349. *
  350. * 29 1 => 64 entry JTLB
  351. * 0 => 48 entry JTLB
  352. */
  353. c->tlbsize = (read_c0_info() & (1 << 29)) ? 64 : 48;
  354. break;
  355. case PRID_IMP_RM9000:
  356. c->cputype = CPU_RM9000;
  357. c->isa_level = MIPS_CPU_ISA_IV;
  358. c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
  359. MIPS_CPU_LLSC;
  360. /*
  361. * Bit 29 in the info register of the RM9000
  362. * indicates if the TLB has 48 or 64 entries.
  363. *
  364. * 29 1 => 64 entry JTLB
  365. * 0 => 48 entry JTLB
  366. */
  367. c->tlbsize = (read_c0_info() & (1 << 29)) ? 64 : 48;
  368. break;
  369. case PRID_IMP_R8000:
  370. c->cputype = CPU_R8000;
  371. c->isa_level = MIPS_CPU_ISA_IV;
  372. c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
  373. MIPS_CPU_FPU | MIPS_CPU_32FPR |
  374. MIPS_CPU_LLSC;
  375. c->tlbsize = 384; /* has weird TLB: 3-way x 128 */
  376. break;
  377. case PRID_IMP_R10000:
  378. c->cputype = CPU_R10000;
  379. c->isa_level = MIPS_CPU_ISA_IV;
  380. c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
  381. MIPS_CPU_FPU | MIPS_CPU_32FPR |
  382. MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
  383. MIPS_CPU_LLSC;
  384. c->tlbsize = 64;
  385. break;
  386. case PRID_IMP_R12000:
  387. c->cputype = CPU_R12000;
  388. c->isa_level = MIPS_CPU_ISA_IV;
  389. c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
  390. MIPS_CPU_FPU | MIPS_CPU_32FPR |
  391. MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
  392. MIPS_CPU_LLSC;
  393. c->tlbsize = 64;
  394. break;
  395. }
  396. }
  397. static inline unsigned int decode_config0(struct cpuinfo_mips *c)
  398. {
  399. unsigned int config0;
  400. int isa;
  401. config0 = read_c0_config();
  402. if (((config0 & MIPS_CONF_MT) >> 7) == 1)
  403. c->options |= MIPS_CPU_TLB;
  404. isa = (config0 & MIPS_CONF_AT) >> 13;
  405. switch (isa) {
  406. case 0:
  407. c->isa_level = MIPS_CPU_ISA_M32;
  408. break;
  409. case 2:
  410. c->isa_level = MIPS_CPU_ISA_M64;
  411. break;
  412. default:
  413. panic("Unsupported ISA type, cp0.config0.at: %d.", isa);
  414. }
  415. return config0 & MIPS_CONF_M;
  416. }
  417. static inline unsigned int decode_config1(struct cpuinfo_mips *c)
  418. {
  419. unsigned int config1;
  420. config1 = read_c0_config1();
  421. if (config1 & MIPS_CONF1_MD)
  422. c->ases |= MIPS_ASE_MDMX;
  423. if (config1 & MIPS_CONF1_WR)
  424. c->options |= MIPS_CPU_WATCH;
  425. if (config1 & MIPS_CONF1_CA)
  426. c->ases |= MIPS_ASE_MIPS16;
  427. if (config1 & MIPS_CONF1_EP)
  428. c->options |= MIPS_CPU_EJTAG;
  429. if (config1 & MIPS_CONF1_FP) {
  430. c->options |= MIPS_CPU_FPU;
  431. c->options |= MIPS_CPU_32FPR;
  432. }
  433. if (cpu_has_tlb)
  434. c->tlbsize = ((config1 & MIPS_CONF1_TLBS) >> 25) + 1;
  435. return config1 & MIPS_CONF_M;
  436. }
  437. static inline unsigned int decode_config2(struct cpuinfo_mips *c)
  438. {
  439. unsigned int config2;
  440. config2 = read_c0_config2();
  441. if (config2 & MIPS_CONF2_SL)
  442. c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
  443. return config2 & MIPS_CONF_M;
  444. }
  445. static inline unsigned int decode_config3(struct cpuinfo_mips *c)
  446. {
  447. unsigned int config3;
  448. config3 = read_c0_config3();
  449. if (config3 & MIPS_CONF3_SM)
  450. c->ases |= MIPS_ASE_SMARTMIPS;
  451. return config3 & MIPS_CONF_M;
  452. }
  453. static inline void decode_configs(struct cpuinfo_mips *c)
  454. {
  455. /* MIPS32 or MIPS64 compliant CPU. */
  456. c->options = MIPS_CPU_4KEX | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC |
  457. MIPS_CPU_LLSC | MIPS_CPU_MCHECK;
  458. c->scache.flags = MIPS_CACHE_NOT_PRESENT;
  459. /* Read Config registers. */
  460. if (!decode_config0(c))
  461. return; /* actually worth a panic() */
  462. if (!decode_config1(c))
  463. return;
  464. if (!decode_config2(c))
  465. return;
  466. if (!decode_config3(c))
  467. return;
  468. }
  469. static inline void cpu_probe_mips(struct cpuinfo_mips *c)
  470. {
  471. decode_configs(c);
  472. c->options |= MIPS_CPU_4KTLB;
  473. switch (c->processor_id & 0xff00) {
  474. case PRID_IMP_4KC:
  475. c->cputype = CPU_4KC;
  476. break;
  477. case PRID_IMP_4KEC:
  478. c->cputype = CPU_4KEC;
  479. break;
  480. case PRID_IMP_4KECR2:
  481. c->cputype = CPU_4KEC;
  482. break;
  483. case PRID_IMP_4KSC:
  484. c->cputype = CPU_4KSC;
  485. break;
  486. case PRID_IMP_5KC:
  487. c->cputype = CPU_5KC;
  488. break;
  489. case PRID_IMP_20KC:
  490. c->cputype = CPU_20KC;
  491. break;
  492. case PRID_IMP_24K:
  493. c->cputype = CPU_24K;
  494. break;
  495. case PRID_IMP_25KF:
  496. c->cputype = CPU_25KF;
  497. /* Probe for L2 cache */
  498. c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
  499. break;
  500. }
  501. }
  502. static inline void cpu_probe_alchemy(struct cpuinfo_mips *c)
  503. {
  504. decode_configs(c);
  505. c->options |= MIPS_CPU_4KTLB;
  506. switch (c->processor_id & 0xff00) {
  507. case PRID_IMP_AU1_REV1:
  508. case PRID_IMP_AU1_REV2:
  509. switch ((c->processor_id >> 24) & 0xff) {
  510. case 0:
  511. c->cputype = CPU_AU1000;
  512. break;
  513. case 1:
  514. c->cputype = CPU_AU1500;
  515. break;
  516. case 2:
  517. c->cputype = CPU_AU1100;
  518. break;
  519. case 3:
  520. c->cputype = CPU_AU1550;
  521. break;
  522. case 4:
  523. c->cputype = CPU_AU1200;
  524. break;
  525. default:
  526. panic("Unknown Au Core!");
  527. break;
  528. }
  529. break;
  530. }
  531. }
  532. static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
  533. {
  534. decode_configs(c);
  535. c->options |= MIPS_CPU_4KTLB;
  536. switch (c->processor_id & 0xff00) {
  537. case PRID_IMP_SB1:
  538. c->cputype = CPU_SB1;
  539. #ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
  540. /* FPU in pass1 is known to have issues. */
  541. c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
  542. #endif
  543. break;
  544. }
  545. }
  546. static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c)
  547. {
  548. decode_configs(c);
  549. c->options |= MIPS_CPU_4KTLB;
  550. switch (c->processor_id & 0xff00) {
  551. case PRID_IMP_SR71000:
  552. c->cputype = CPU_SR71000;
  553. c->scache.ways = 8;
  554. c->tlbsize = 64;
  555. break;
  556. }
  557. }
  558. __init void cpu_probe(void)
  559. {
  560. struct cpuinfo_mips *c = &current_cpu_data;
  561. c->processor_id = PRID_IMP_UNKNOWN;
  562. c->fpu_id = FPIR_IMP_NONE;
  563. c->cputype = CPU_UNKNOWN;
  564. c->processor_id = read_c0_prid();
  565. switch (c->processor_id & 0xff0000) {
  566. case PRID_COMP_LEGACY:
  567. cpu_probe_legacy(c);
  568. break;
  569. case PRID_COMP_MIPS:
  570. cpu_probe_mips(c);
  571. break;
  572. case PRID_COMP_ALCHEMY:
  573. cpu_probe_alchemy(c);
  574. break;
  575. case PRID_COMP_SIBYTE:
  576. cpu_probe_sibyte(c);
  577. break;
  578. case PRID_COMP_SANDCRAFT:
  579. cpu_probe_sandcraft(c);
  580. break;
  581. default:
  582. c->cputype = CPU_UNKNOWN;
  583. }
  584. if (c->options & MIPS_CPU_FPU) {
  585. c->fpu_id = cpu_get_fpu_id();
  586. if (c->isa_level == MIPS_CPU_ISA_M32 ||
  587. c->isa_level == MIPS_CPU_ISA_M64) {
  588. if (c->fpu_id & MIPS_FPIR_3D)
  589. c->ases |= MIPS_ASE_MIPS3D;
  590. }
  591. }
  592. }
  593. __init void cpu_report(void)
  594. {
  595. struct cpuinfo_mips *c = &current_cpu_data;
  596. printk("CPU revision is: %08x\n", c->processor_id);
  597. if (c->options & MIPS_CPU_FPU)
  598. printk("FPU revision is: %08x\n", c->fpu_id);
  599. }