cpu-probe.c 28 KB

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