mipsregs.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001 by Ralf Baechle
  7. * Copyright (C) 2000 Silicon Graphics, Inc.
  8. * Modified for further R[236]000 support by Paul M. Antoine, 1996.
  9. * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  10. * Copyright (C) 2000, 07 MIPS Technologies, Inc.
  11. * Copyright (C) 2003, 2004 Maciej W. Rozycki
  12. */
  13. #ifndef _ASM_MIPSREGS_H
  14. #define _ASM_MIPSREGS_H
  15. #if 0
  16. #include <linux/linkage.h>
  17. #endif
  18. /*
  19. * The following macros are especially useful for __asm__
  20. * inline assembler.
  21. */
  22. #ifndef __STR
  23. #define __STR(x) #x
  24. #endif
  25. #ifndef STR
  26. #define STR(x) __STR(x)
  27. #endif
  28. /*
  29. * Configure language
  30. */
  31. #ifdef __ASSEMBLY__
  32. #define _ULCAST_
  33. #else
  34. #define _ULCAST_ (unsigned long)
  35. #endif
  36. /*
  37. * Coprocessor 0 register names
  38. */
  39. #define CP0_INDEX $0
  40. #define CP0_RANDOM $1
  41. #define CP0_ENTRYLO0 $2
  42. #define CP0_ENTRYLO1 $3
  43. #define CP0_CONF $3
  44. #define CP0_CONTEXT $4
  45. #define CP0_PAGEMASK $5
  46. #define CP0_WIRED $6
  47. #define CP0_INFO $7
  48. #define CP0_BADVADDR $8
  49. #define CP0_COUNT $9
  50. #define CP0_ENTRYHI $10
  51. #define CP0_COMPARE $11
  52. #define CP0_STATUS $12
  53. #define CP0_CAUSE $13
  54. #define CP0_EPC $14
  55. #define CP0_PRID $15
  56. #define CP0_CONFIG $16
  57. #define CP0_LLADDR $17
  58. #define CP0_WATCHLO $18
  59. #define CP0_WATCHHI $19
  60. #define CP0_XCONTEXT $20
  61. #define CP0_FRAMEMASK $21
  62. #define CP0_DIAGNOSTIC $22
  63. #define CP0_DEBUG $23
  64. #define CP0_DEPC $24
  65. #define CP0_PERFORMANCE $25
  66. #define CP0_ECC $26
  67. #define CP0_CACHEERR $27
  68. #define CP0_TAGLO $28
  69. #define CP0_TAGHI $29
  70. #define CP0_ERROREPC $30
  71. #define CP0_DESAVE $31
  72. /*
  73. * R4640/R4650 cp0 register names. These registers are listed
  74. * here only for completeness; without MMU these CPUs are not useable
  75. * by Linux. A future ELKS port might take make Linux run on them
  76. * though ...
  77. */
  78. #define CP0_IBASE $0
  79. #define CP0_IBOUND $1
  80. #define CP0_DBASE $2
  81. #define CP0_DBOUND $3
  82. #define CP0_CALG $17
  83. #define CP0_IWATCH $18
  84. #define CP0_DWATCH $19
  85. /*
  86. * Coprocessor 0 Set 1 register names
  87. */
  88. #define CP0_S1_DERRADDR0 $26
  89. #define CP0_S1_DERRADDR1 $27
  90. #define CP0_S1_INTCONTROL $20
  91. /*
  92. * Coprocessor 0 Set 2 register names
  93. */
  94. #define CP0_S2_SRSCTL $12 /* MIPSR2 */
  95. /*
  96. * Coprocessor 0 Set 3 register names
  97. */
  98. #define CP0_S3_SRSMAP $12 /* MIPSR2 */
  99. /*
  100. * TX39 Series
  101. */
  102. #define CP0_TX39_CACHE $7
  103. /*
  104. * Coprocessor 1 (FPU) register names
  105. */
  106. #define CP1_REVISION $0
  107. #define CP1_STATUS $31
  108. /*
  109. * FPU Status Register Values
  110. */
  111. /*
  112. * Status Register Values
  113. */
  114. #define FPU_CSR_FLUSH 0x01000000 /* flush denormalised results to 0 */
  115. #define FPU_CSR_COND 0x00800000 /* $fcc0 */
  116. #define FPU_CSR_COND0 0x00800000 /* $fcc0 */
  117. #define FPU_CSR_COND1 0x02000000 /* $fcc1 */
  118. #define FPU_CSR_COND2 0x04000000 /* $fcc2 */
  119. #define FPU_CSR_COND3 0x08000000 /* $fcc3 */
  120. #define FPU_CSR_COND4 0x10000000 /* $fcc4 */
  121. #define FPU_CSR_COND5 0x20000000 /* $fcc5 */
  122. #define FPU_CSR_COND6 0x40000000 /* $fcc6 */
  123. #define FPU_CSR_COND7 0x80000000 /* $fcc7 */
  124. /*
  125. * X the exception cause indicator
  126. * E the exception enable
  127. * S the sticky/flag bit
  128. */
  129. #define FPU_CSR_ALL_X 0x0003f000
  130. #define FPU_CSR_UNI_X 0x00020000
  131. #define FPU_CSR_INV_X 0x00010000
  132. #define FPU_CSR_DIV_X 0x00008000
  133. #define FPU_CSR_OVF_X 0x00004000
  134. #define FPU_CSR_UDF_X 0x00002000
  135. #define FPU_CSR_INE_X 0x00001000
  136. #define FPU_CSR_ALL_E 0x00000f80
  137. #define FPU_CSR_INV_E 0x00000800
  138. #define FPU_CSR_DIV_E 0x00000400
  139. #define FPU_CSR_OVF_E 0x00000200
  140. #define FPU_CSR_UDF_E 0x00000100
  141. #define FPU_CSR_INE_E 0x00000080
  142. #define FPU_CSR_ALL_S 0x0000007c
  143. #define FPU_CSR_INV_S 0x00000040
  144. #define FPU_CSR_DIV_S 0x00000020
  145. #define FPU_CSR_OVF_S 0x00000010
  146. #define FPU_CSR_UDF_S 0x00000008
  147. #define FPU_CSR_INE_S 0x00000004
  148. /* rounding mode */
  149. #define FPU_CSR_RN 0x0 /* nearest */
  150. #define FPU_CSR_RZ 0x1 /* towards zero */
  151. #define FPU_CSR_RU 0x2 /* towards +Infinity */
  152. #define FPU_CSR_RD 0x3 /* towards -Infinity */
  153. /*
  154. * Values for PageMask register
  155. */
  156. #ifdef CONFIG_CPU_VR41XX
  157. /* Why doesn't stupidity hurt ... */
  158. #define PM_1K 0x00000000
  159. #define PM_4K 0x00001800
  160. #define PM_16K 0x00007800
  161. #define PM_64K 0x0001f800
  162. #define PM_256K 0x0007f800
  163. #else
  164. #define PM_4K 0x00000000
  165. #define PM_16K 0x00006000
  166. #define PM_64K 0x0001e000
  167. #define PM_256K 0x0007e000
  168. #define PM_1M 0x001fe000
  169. #define PM_4M 0x007fe000
  170. #define PM_16M 0x01ffe000
  171. #define PM_64M 0x07ffe000
  172. #define PM_256M 0x1fffe000
  173. #endif
  174. /*
  175. * Values used for computation of new tlb entries
  176. */
  177. #define PL_4K 12
  178. #define PL_16K 14
  179. #define PL_64K 16
  180. #define PL_256K 18
  181. #define PL_1M 20
  182. #define PL_4M 22
  183. #define PL_16M 24
  184. #define PL_64M 26
  185. #define PL_256M 28
  186. /*
  187. * Macros to access the system control coprocessor
  188. */
  189. #define read_32bit_cp0_register(source) \
  190. ({ int __res; \
  191. __asm__ __volatile__( \
  192. ".set\tpush\n\t" \
  193. ".set\treorder\n\t" \
  194. "mfc0\t%0,"STR(source)"\n\t" \
  195. ".set\tpop" \
  196. : "=r" (__res)); \
  197. __res;})
  198. #define read_32bit_cp0_set1_register(source) \
  199. ({ int __res; \
  200. __asm__ __volatile__( \
  201. ".set\tpush\n\t" \
  202. ".set\treorder\n\t" \
  203. "cfc0\t%0,"STR(source)"\n\t" \
  204. ".set\tpop" \
  205. : "=r" (__res)); \
  206. __res;})
  207. /*
  208. * For now use this only with interrupts disabled!
  209. */
  210. #define read_64bit_cp0_register(source) \
  211. ({ int __res; \
  212. __asm__ __volatile__( \
  213. ".set\tmips3\n\t" \
  214. "dmfc0\t%0,"STR(source)"\n\t" \
  215. ".set\tmips0" \
  216. : "=r" (__res)); \
  217. __res;})
  218. #define write_32bit_cp0_register(register,value) \
  219. __asm__ __volatile__( \
  220. "mtc0\t%0,"STR(register)"\n\t" \
  221. "nop" \
  222. : : "r" (value));
  223. #define write_32bit_cp0_set1_register(register,value) \
  224. __asm__ __volatile__( \
  225. "ctc0\t%0,"STR(register)"\n\t" \
  226. "nop" \
  227. : : "r" (value));
  228. #define write_64bit_cp0_register(register,value) \
  229. __asm__ __volatile__( \
  230. ".set\tmips3\n\t" \
  231. "dmtc0\t%0,"STR(register)"\n\t" \
  232. ".set\tmips0" \
  233. : : "r" (value))
  234. /*
  235. * This should be changed when we get a compiler that support the MIPS32 ISA.
  236. */
  237. #define read_mips32_cp0_config1() \
  238. ({ int __res; \
  239. __asm__ __volatile__( \
  240. ".set\tnoreorder\n\t" \
  241. ".set\tnoat\n\t" \
  242. ".word\t0x40018001\n\t" \
  243. "move\t%0,$1\n\t" \
  244. ".set\tat\n\t" \
  245. ".set\treorder" \
  246. :"=r" (__res)); \
  247. __res;})
  248. #define tlb_write_indexed() \
  249. __asm__ __volatile__( \
  250. ".set noreorder\n\t" \
  251. "tlbwi\n\t" \
  252. ".set reorder")
  253. /*
  254. * R4x00 interrupt enable / cause bits
  255. */
  256. #define IE_SW0 (_ULCAST_(1) << 8)
  257. #define IE_SW1 (_ULCAST_(1) << 9)
  258. #define IE_IRQ0 (_ULCAST_(1) << 10)
  259. #define IE_IRQ1 (_ULCAST_(1) << 11)
  260. #define IE_IRQ2 (_ULCAST_(1) << 12)
  261. #define IE_IRQ3 (_ULCAST_(1) << 13)
  262. #define IE_IRQ4 (_ULCAST_(1) << 14)
  263. #define IE_IRQ5 (_ULCAST_(1) << 15)
  264. /*
  265. * R4x00 interrupt cause bits
  266. */
  267. #define C_SW0 (_ULCAST_(1) << 8)
  268. #define C_SW1 (_ULCAST_(1) << 9)
  269. #define C_IRQ0 (_ULCAST_(1) << 10)
  270. #define C_IRQ1 (_ULCAST_(1) << 11)
  271. #define C_IRQ2 (_ULCAST_(1) << 12)
  272. #define C_IRQ3 (_ULCAST_(1) << 13)
  273. #define C_IRQ4 (_ULCAST_(1) << 14)
  274. #define C_IRQ5 (_ULCAST_(1) << 15)
  275. #ifndef _LANGUAGE_ASSEMBLY
  276. /*
  277. * Manipulate the status register.
  278. * Mostly used to access the interrupt bits.
  279. */
  280. #define __BUILD_SET_CP0(name,register) \
  281. extern __inline__ unsigned int \
  282. set_cp0_##name(unsigned int set) \
  283. { \
  284. unsigned int res; \
  285. \
  286. res = read_32bit_cp0_register(register); \
  287. res |= set; \
  288. write_32bit_cp0_register(register, res); \
  289. \
  290. return res; \
  291. } \
  292. \
  293. extern __inline__ unsigned int \
  294. clear_cp0_##name(unsigned int clear) \
  295. { \
  296. unsigned int res; \
  297. \
  298. res = read_32bit_cp0_register(register); \
  299. res &= ~clear; \
  300. write_32bit_cp0_register(register, res); \
  301. \
  302. return res; \
  303. } \
  304. \
  305. extern __inline__ unsigned int \
  306. change_cp0_##name(unsigned int change, unsigned int new) \
  307. { \
  308. unsigned int res; \
  309. \
  310. res = read_32bit_cp0_register(register); \
  311. res &= ~change; \
  312. res |= (new & change); \
  313. if(change) \
  314. write_32bit_cp0_register(register, res); \
  315. \
  316. return res; \
  317. }
  318. __BUILD_SET_CP0(status,CP0_STATUS)
  319. __BUILD_SET_CP0(cause,CP0_CAUSE)
  320. __BUILD_SET_CP0(config,CP0_CONFIG)
  321. #endif /* defined (_LANGUAGE_ASSEMBLY) */
  322. /*
  323. * Bitfields in the R4xx0 cp0 status register
  324. */
  325. #define ST0_IE 0x00000001
  326. #define ST0_EXL 0x00000002
  327. #define ST0_ERL 0x00000004
  328. #define ST0_KSU 0x00000018
  329. # define KSU_USER 0x00000010
  330. # define KSU_SUPERVISOR 0x00000008
  331. # define KSU_KERNEL 0x00000000
  332. #define ST0_UX 0x00000020
  333. #define ST0_SX 0x00000040
  334. #define ST0_KX 0x00000080
  335. #define ST0_DE 0x00010000
  336. #define ST0_CE 0x00020000
  337. /*
  338. * Setting c0_status.co enables Hit_Writeback and Hit_Writeback_Invalidate
  339. * cacheops in userspace. This bit exists only on RM7000 and RM9000
  340. * processors.
  341. */
  342. #define ST0_CO 0x08000000
  343. /*
  344. * Bitfields in the R[23]000 cp0 status register.
  345. */
  346. #define ST0_IEC 0x00000001
  347. #define ST0_KUC 0x00000002
  348. #define ST0_IEP 0x00000004
  349. #define ST0_KUP 0x00000008
  350. #define ST0_IEO 0x00000010
  351. #define ST0_KUO 0x00000020
  352. /* bits 6 & 7 are reserved on R[23]000 */
  353. #define ST0_ISC 0x00010000
  354. #define ST0_SWC 0x00020000
  355. #define ST0_CM 0x00080000
  356. /*
  357. * Bits specific to the R4640/R4650
  358. */
  359. #define ST0_UM (_ULCAST_(1) << 4)
  360. #define ST0_IL (_ULCAST_(1) << 23)
  361. #define ST0_DL (_ULCAST_(1) << 24)
  362. /*
  363. * Enable the MIPS MDMX and DSP ASEs
  364. */
  365. #define ST0_MX 0x01000000
  366. /*
  367. * Bitfields in the TX39 family CP0 Configuration Register 3
  368. */
  369. #define TX39_CONF_ICS_SHIFT 19
  370. #define TX39_CONF_ICS_MASK 0x00380000
  371. #define TX39_CONF_ICS_1KB 0x00000000
  372. #define TX39_CONF_ICS_2KB 0x00080000
  373. #define TX39_CONF_ICS_4KB 0x00100000
  374. #define TX39_CONF_ICS_8KB 0x00180000
  375. #define TX39_CONF_ICS_16KB 0x00200000
  376. #define TX39_CONF_DCS_SHIFT 16
  377. #define TX39_CONF_DCS_MASK 0x00070000
  378. #define TX39_CONF_DCS_1KB 0x00000000
  379. #define TX39_CONF_DCS_2KB 0x00010000
  380. #define TX39_CONF_DCS_4KB 0x00020000
  381. #define TX39_CONF_DCS_8KB 0x00030000
  382. #define TX39_CONF_DCS_16KB 0x00040000
  383. #define TX39_CONF_CWFON 0x00004000
  384. #define TX39_CONF_WBON 0x00002000
  385. #define TX39_CONF_RF_SHIFT 10
  386. #define TX39_CONF_RF_MASK 0x00000c00
  387. #define TX39_CONF_DOZE 0x00000200
  388. #define TX39_CONF_HALT 0x00000100
  389. #define TX39_CONF_LOCK 0x00000080
  390. #define TX39_CONF_ICE 0x00000020
  391. #define TX39_CONF_DCE 0x00000010
  392. #define TX39_CONF_IRSIZE_SHIFT 2
  393. #define TX39_CONF_IRSIZE_MASK 0x0000000c
  394. #define TX39_CONF_DRSIZE_SHIFT 0
  395. #define TX39_CONF_DRSIZE_MASK 0x00000003
  396. /*
  397. * Status register bits available in all MIPS CPUs.
  398. */
  399. #define ST0_IM 0x0000ff00
  400. #define STATUSB_IP0 8
  401. #define STATUSF_IP0 (_ULCAST_(1) << 8)
  402. #define STATUSB_IP1 9
  403. #define STATUSF_IP1 (_ULCAST_(1) << 9)
  404. #define STATUSB_IP2 10
  405. #define STATUSF_IP2 (_ULCAST_(1) << 10)
  406. #define STATUSB_IP3 11
  407. #define STATUSF_IP3 (_ULCAST_(1) << 11)
  408. #define STATUSB_IP4 12
  409. #define STATUSF_IP4 (_ULCAST_(1) << 12)
  410. #define STATUSB_IP5 13
  411. #define STATUSF_IP5 (_ULCAST_(1) << 13)
  412. #define STATUSB_IP6 14
  413. #define STATUSF_IP6 (_ULCAST_(1) << 14)
  414. #define STATUSB_IP7 15
  415. #define STATUSF_IP7 (_ULCAST_(1) << 15)
  416. #define STATUSB_IP8 0
  417. #define STATUSF_IP8 (_ULCAST_(1) << 0)
  418. #define STATUSB_IP9 1
  419. #define STATUSF_IP9 (_ULCAST_(1) << 1)
  420. #define STATUSB_IP10 2
  421. #define STATUSF_IP10 (_ULCAST_(1) << 2)
  422. #define STATUSB_IP11 3
  423. #define STATUSF_IP11 (_ULCAST_(1) << 3)
  424. #define STATUSB_IP12 4
  425. #define STATUSF_IP12 (_ULCAST_(1) << 4)
  426. #define STATUSB_IP13 5
  427. #define STATUSF_IP13 (_ULCAST_(1) << 5)
  428. #define STATUSB_IP14 6
  429. #define STATUSF_IP14 (_ULCAST_(1) << 6)
  430. #define STATUSB_IP15 7
  431. #define STATUSF_IP15 (_ULCAST_(1) << 7)
  432. #define ST0_CH 0x00040000
  433. #define ST0_SR 0x00100000
  434. #define ST0_TS 0x00200000
  435. #define ST0_BEV 0x00400000
  436. #define ST0_RE 0x02000000
  437. #define ST0_FR 0x04000000
  438. #define ST0_CU 0xf0000000
  439. #define ST0_CU0 0x10000000
  440. #define ST0_CU1 0x20000000
  441. #define ST0_CU2 0x40000000
  442. #define ST0_CU3 0x80000000
  443. #define ST0_XX 0x80000000 /* MIPS IV naming */
  444. /*
  445. * Bitfields and bit numbers in the coprocessor 0 cause register.
  446. *
  447. * Refer to your MIPS R4xx0 manual, chapter 5 for explanation.
  448. */
  449. #define CAUSEB_EXCCODE 2
  450. #define CAUSEF_EXCCODE (_ULCAST_(31) << 2)
  451. #define CAUSEB_IP 8
  452. #define CAUSEF_IP (_ULCAST_(255) << 8)
  453. #define CAUSEB_IP0 8
  454. #define CAUSEF_IP0 (_ULCAST_(1) << 8)
  455. #define CAUSEB_IP1 9
  456. #define CAUSEF_IP1 (_ULCAST_(1) << 9)
  457. #define CAUSEB_IP2 10
  458. #define CAUSEF_IP2 (_ULCAST_(1) << 10)
  459. #define CAUSEB_IP3 11
  460. #define CAUSEF_IP3 (_ULCAST_(1) << 11)
  461. #define CAUSEB_IP4 12
  462. #define CAUSEF_IP4 (_ULCAST_(1) << 12)
  463. #define CAUSEB_IP5 13
  464. #define CAUSEF_IP5 (_ULCAST_(1) << 13)
  465. #define CAUSEB_IP6 14
  466. #define CAUSEF_IP6 (_ULCAST_(1) << 14)
  467. #define CAUSEB_IP7 15
  468. #define CAUSEF_IP7 (_ULCAST_(1) << 15)
  469. #define CAUSEB_IV 23
  470. #define CAUSEF_IV (_ULCAST_(1) << 23)
  471. #define CAUSEB_CE 28
  472. #define CAUSEF_CE (_ULCAST_(3) << 28)
  473. #define CAUSEB_BD 31
  474. #define CAUSEF_BD (_ULCAST_(1) << 31)
  475. /*
  476. * Bits in the coprocessor 0 config register.
  477. */
  478. /* Generic bits. */
  479. #define CONF_CM_CACHABLE_NO_WA 0
  480. #define CONF_CM_CACHABLE_WA 1
  481. #define CONF_CM_UNCACHED 2
  482. #define CONF_CM_CACHABLE_NONCOHERENT 3
  483. #define CONF_CM_CACHABLE_CE 4
  484. #define CONF_CM_CACHABLE_COW 5
  485. #define CONF_CM_CACHABLE_CUW 6
  486. #define CONF_CM_CACHABLE_ACCELERATED 7
  487. #define CONF_CM_CMASK 7
  488. #define CONF_BE (_ULCAST_(1) << 15)
  489. /* Bits common to various processors. */
  490. #define CONF_CU (_ULCAST_(1) << 3)
  491. #define CONF_DB (_ULCAST_(1) << 4)
  492. #define CONF_IB (_ULCAST_(1) << 5)
  493. #define CONF_DC (_ULCAST_(7) << 6)
  494. #define CONF_IC (_ULCAST_(7) << 9)
  495. #define CONF_EB (_ULCAST_(1) << 13)
  496. #define CONF_EM (_ULCAST_(1) << 14)
  497. #define CONF_SM (_ULCAST_(1) << 16)
  498. #define CONF_SC (_ULCAST_(1) << 17)
  499. #define CONF_EW (_ULCAST_(3) << 18)
  500. #define CONF_EP (_ULCAST_(15)<< 24)
  501. #define CONF_EC (_ULCAST_(7) << 28)
  502. #define CONF_CM (_ULCAST_(1) << 31)
  503. /* Bits specific to the R4xx0. */
  504. #define R4K_CONF_SW (_ULCAST_(1) << 20)
  505. #define R4K_CONF_SS (_ULCAST_(1) << 21)
  506. #define R4K_CONF_SB (_ULCAST_(3) << 22)
  507. /* Bits specific to the R5000. */
  508. #define R5K_CONF_SE (_ULCAST_(1) << 12)
  509. #define R5K_CONF_SS (_ULCAST_(3) << 20)
  510. /* Bits specific to the RM7000. */
  511. #define RM7K_CONF_SE (_ULCAST_(1) << 3)
  512. #define RM7K_CONF_TE (_ULCAST_(1) << 12)
  513. #define RM7K_CONF_CLK (_ULCAST_(1) << 16)
  514. #define RM7K_CONF_TC (_ULCAST_(1) << 17)
  515. #define RM7K_CONF_SI (_ULCAST_(3) << 20)
  516. #define RM7K_CONF_SC (_ULCAST_(1) << 31)
  517. /* Bits specific to the R10000. */
  518. #define R10K_CONF_DN (_ULCAST_(3) << 3)
  519. #define R10K_CONF_CT (_ULCAST_(1) << 5)
  520. #define R10K_CONF_PE (_ULCAST_(1) << 6)
  521. #define R10K_CONF_PM (_ULCAST_(3) << 7)
  522. #define R10K_CONF_EC (_ULCAST_(15)<< 9)
  523. #define R10K_CONF_SB (_ULCAST_(1) << 13)
  524. #define R10K_CONF_SK (_ULCAST_(1) << 14)
  525. #define R10K_CONF_SS (_ULCAST_(7) << 16)
  526. #define R10K_CONF_SC (_ULCAST_(7) << 19)
  527. #define R10K_CONF_DC (_ULCAST_(7) << 26)
  528. #define R10K_CONF_IC (_ULCAST_(7) << 29)
  529. /* Bits specific to the VR41xx. */
  530. #define VR41_CONF_CS (_ULCAST_(1) << 12)
  531. #define VR41_CONF_P4K (_ULCAST_(1) << 13)
  532. #define VR41_CONF_BP (_ULCAST_(1) << 16)
  533. #define VR41_CONF_M16 (_ULCAST_(1) << 20)
  534. #define VR41_CONF_AD (_ULCAST_(1) << 23)
  535. /* Bits specific to the R30xx. */
  536. #define R30XX_CONF_FDM (_ULCAST_(1) << 19)
  537. #define R30XX_CONF_REV (_ULCAST_(1) << 22)
  538. #define R30XX_CONF_AC (_ULCAST_(1) << 23)
  539. #define R30XX_CONF_RF (_ULCAST_(1) << 24)
  540. #define R30XX_CONF_HALT (_ULCAST_(1) << 25)
  541. #define R30XX_CONF_FPINT (_ULCAST_(7) << 26)
  542. #define R30XX_CONF_DBR (_ULCAST_(1) << 29)
  543. #define R30XX_CONF_SB (_ULCAST_(1) << 30)
  544. #define R30XX_CONF_LOCK (_ULCAST_(1) << 31)
  545. /* Bits specific to the TX49. */
  546. #define TX49_CONF_DC (_ULCAST_(1) << 16)
  547. #define TX49_CONF_IC (_ULCAST_(1) << 17) /* conflict with CONF_SC */
  548. #define TX49_CONF_HALT (_ULCAST_(1) << 18)
  549. #define TX49_CONF_CWFON (_ULCAST_(1) << 27)
  550. /* Bits specific to the MIPS32/64 PRA. */
  551. #define MIPS_CONF_MT (_ULCAST_(7) << 7)
  552. #define MIPS_CONF_AR (_ULCAST_(7) << 10)
  553. #define MIPS_CONF_AT (_ULCAST_(3) << 13)
  554. #define MIPS_CONF_M (_ULCAST_(1) << 31)
  555. /*
  556. * Bits in the MIPS32/64 PRA coprocessor 0 config registers 1 and above.
  557. */
  558. #define MIPS_CONF1_FP (_ULCAST_(1) << 0)
  559. #define MIPS_CONF1_EP (_ULCAST_(1) << 1)
  560. #define MIPS_CONF1_CA (_ULCAST_(1) << 2)
  561. #define MIPS_CONF1_WR (_ULCAST_(1) << 3)
  562. #define MIPS_CONF1_PC (_ULCAST_(1) << 4)
  563. #define MIPS_CONF1_MD (_ULCAST_(1) << 5)
  564. #define MIPS_CONF1_C2 (_ULCAST_(1) << 6)
  565. #define MIPS_CONF1_DA (_ULCAST_(7) << 7)
  566. #define MIPS_CONF1_DL (_ULCAST_(7) << 10)
  567. #define MIPS_CONF1_DS (_ULCAST_(7) << 13)
  568. #define MIPS_CONF1_IA (_ULCAST_(7) << 16)
  569. #define MIPS_CONF1_IL (_ULCAST_(7) << 19)
  570. #define MIPS_CONF1_IS (_ULCAST_(7) << 22)
  571. #define MIPS_CONF1_TLBS (_ULCAST_(63)<< 25)
  572. #define MIPS_CONF2_SA (_ULCAST_(15)<< 0)
  573. #define MIPS_CONF2_SL (_ULCAST_(15)<< 4)
  574. #define MIPS_CONF2_SS (_ULCAST_(15)<< 8)
  575. #define MIPS_CONF2_SU (_ULCAST_(15)<< 12)
  576. #define MIPS_CONF2_TA (_ULCAST_(15)<< 16)
  577. #define MIPS_CONF2_TL (_ULCAST_(15)<< 20)
  578. #define MIPS_CONF2_TS (_ULCAST_(15)<< 24)
  579. #define MIPS_CONF2_TU (_ULCAST_(7) << 28)
  580. #define MIPS_CONF3_TL (_ULCAST_(1) << 0)
  581. #define MIPS_CONF3_SM (_ULCAST_(1) << 1)
  582. #define MIPS_CONF3_MT (_ULCAST_(1) << 2)
  583. #define MIPS_CONF3_SP (_ULCAST_(1) << 4)
  584. #define MIPS_CONF3_VINT (_ULCAST_(1) << 5)
  585. #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6)
  586. #define MIPS_CONF3_LPA (_ULCAST_(1) << 7)
  587. #define MIPS_CONF3_DSP (_ULCAST_(1) << 10)
  588. #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13)
  589. #define MIPS_CONF7_WII (_ULCAST_(1) << 31)
  590. #define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
  591. /*
  592. * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
  593. */
  594. #define MIPS_FPIR_S (_ULCAST_(1) << 16)
  595. #define MIPS_FPIR_D (_ULCAST_(1) << 17)
  596. #define MIPS_FPIR_PS (_ULCAST_(1) << 18)
  597. #define MIPS_FPIR_3D (_ULCAST_(1) << 19)
  598. #define MIPS_FPIR_W (_ULCAST_(1) << 20)
  599. #define MIPS_FPIR_L (_ULCAST_(1) << 21)
  600. #define MIPS_FPIR_F64 (_ULCAST_(1) << 22)
  601. #endif /* _ASM_MIPSREGS_H */