cpu-probe.c 15 KB

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