ctlreg.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. /* $OpenBSD: ctlreg.h,v 1.7 2003/06/02 23:27:54 millert Exp $ */
  2. /* $NetBSD: ctlreg.h,v 1.15 1997/07/20 18:55:03 pk Exp $ */
  3. /*
  4. * Copyright (c) 1996
  5. * The President and Fellows of Harvard College. All rights reserved.
  6. * Copyright (c) 1992, 1993
  7. * The Regents of the University of California. All rights reserved.
  8. *
  9. * This software was developed by the Computer Systems Engineering group
  10. * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
  11. * contributed to Berkeley.
  12. *
  13. * All advertising materials mentioning features or use of this software
  14. * must display the following acknowledgement:
  15. * This product includes software developed by Harvard University.
  16. * This product includes software developed by the University of
  17. * California, Lawrence Berkeley Laboratory.
  18. *
  19. * Redistribution and use in source and binary forms, with or without
  20. * modification, are permitted provided that the following conditions
  21. * are met:
  22. * 1. Redistributions of source code must retain the above copyright
  23. * notice, this list of conditions and the following disclaimer.
  24. * 2. Redistributions in binary form must reproduce the above copyright
  25. * notice, this list of conditions and the following disclaimer in the
  26. * documentation and/or other materials provided with the distribution.
  27. * 3. Neither the name of the University nor the names of its contributors
  28. * may be used to endorse or promote products derived from this software
  29. * without specific prior written permission.
  30. *
  31. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  32. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  33. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  34. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  35. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  36. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  37. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  39. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  40. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  41. * SUCH DAMAGE.
  42. *
  43. * @(#)ctlreg.h 8.1 (Berkeley) 6/11/93
  44. */
  45. /*
  46. * Sun4m support by Aaron Brown, Harvard University.
  47. * Changes Copyright (c) 1995 The President and Fellows of Harvard College.
  48. * All rights reserved.
  49. */
  50. /*
  51. * Sun 4, 4c, and 4m control registers. (includes address space definitions
  52. * and some registers in control space).
  53. */
  54. /*
  55. * The Alternate address spaces.
  56. */
  57. /* 0x00 unused */
  58. /* 0x01 unused */
  59. #define ASI_CONTROL 0x02 /* cache enable, context reg, etc */
  60. #define ASI_SEGMAP 0x03 /* [4/4c] segment maps */
  61. #define ASI_SRMMUFP 0x03 /* [4m] ref mmu flush/probe */
  62. #define ASI_PTE 0x04 /* [4/4c] PTE space (pmegs) */
  63. #define ASI_SRMMU 0x04 /* [4m] ref mmu registers */
  64. #define ASI_REGMAP 0x06 /* [4/3-level MMU ] region maps */
  65. #define ASI_HWFLUSHSEG 0x05 /* [4/4c] hardware assisted version of FLUSHSEG */
  66. #define ASI_HWFLUSHPG 0x06 /* [4/4c] hardware assisted version of FLUSHPG */
  67. #define ASI_SRMMUDIAG 0x06 /* [4m] */
  68. #define ASI_HWFLUSHCTX 0x07 /* [4/4c] hardware assisted version of FLUSHCTX */
  69. #define ASI_USERI 0x08 /* I-space (user) */
  70. #define ASI_KERNELI 0x09 /* I-space (kernel) */
  71. #define ASI_USERD 0x0a /* D-space (user) */
  72. #define ASI_KERNELD 0x0b /* D-space (kernel) */
  73. #define ASI_FLUSHREG 0x7 /* [4/4c] flush cache by region */
  74. #define ASI_FLUSHSEG 0x0c /* [4/4c] flush cache by segment */
  75. #define ASI_FLUSHPG 0x0d /* [4/4c] flush cache by page */
  76. #define ASI_FLUSHCTX 0x0e /* [4/4c] flush cache by context */
  77. #define ASI_DCACHE 0x0f /* [4] flush data cache */
  78. #define ASI_ICACHETAG 0x0c /* [4m] instruction cache tag */
  79. #define ASI_ICACHEDATA 0x0d /* [4m] instruction cache data */
  80. #define ASI_DCACHETAG 0x0e /* [4m] data cache tag */
  81. #define ASI_DCACHEDATA 0x0f /* [4m] data cache data */
  82. #define ASI_IDCACHELFP 0x10 /* [4m] flush i&d cache line (page) */
  83. #define ASI_IDCACHELFS 0x11 /* [4m] flush i&d cache line (seg) */
  84. #define ASI_IDCACHELFR 0x12 /* [4m] flush i&d cache line (reg) */
  85. #define ASI_IDCACHELFC 0x13 /* [4m] flush i&d cache line (ctxt) */
  86. #define ASI_IDCACHELFU 0x14 /* [4m] flush i&d cache line (user) */
  87. #define ASI_BYPASS 0x20 /* [4m] sun ref mmu bypass,
  88. ie. direct phys access */
  89. #define ASI_HICACHECLR 0x31 /* [4m] hypersparc only: I-cache flash clear */
  90. #define ASI_ICACHECLR 0x36 /* [4m] ms1 only: I-cache flash clear */
  91. #define ASI_DCACHECLR 0x37 /* [4m] ms1 only: D-cache flash clear */
  92. #define ASI_DCACHEDIAG 0x39 /* [4m] data cache diagnostic register access */
  93. /*
  94. * [4/4c] Registers in the control space (ASI_CONTROL).
  95. */
  96. #define AC_IDPROM 0x00000000 /* [4] ID PROM */
  97. #define AC_CONTEXT 0x30000000 /* [4/4c] context register (byte) */
  98. #define AC_SYSENABLE 0x40000000 /* [4/4c] system enable register (byte) */
  99. #define AC_DVMA_ENABLE 0x50000000 /* [4] enable user dvma */
  100. #define AC_BUS_ERR 0x60000000 /* [4] bus error register */
  101. #define AC_SYNC_ERR 0x60000000 /* [4c] sync (memory) error reg */
  102. #define AC_SYNC_VA 0x60000004 /* [4c] sync error virtual addr */
  103. #define AC_ASYNC_ERR 0x60000008 /* [4c] async error reg */
  104. #define AC_ASYNC_VA 0x6000000c /* [4c] async error virtual addr */
  105. #define AC_DIAG_REG 0x70000000 /* [4] diagnostic reg */
  106. #define AC_CACHETAGS 0x80000000 /* [4/4c?] cache tag base address */
  107. #define AC_CACHEDATA 0x90000000 /* [4] cached data [sun4/400?] */
  108. #define AC_DVMA_MAP 0xd0000000 /* [4] user dvma map entries */
  109. #define AC_VMEINTVEC 0xe0000000 /* [4] vme interrupt vector */
  110. #define AC_SERIAL 0xf0000000 /* [4/4c] special serial port sneakiness */
  111. /* AC_SERIAL is not used in the kernel (it is for the PROM) */
  112. /* XXX: does not belong here */
  113. #define ME_REG_IERR 0x80 /* memory err ctrl reg error intr pending bit */
  114. /*
  115. * [4/4c]
  116. * Bits in sync error register. Reading the register clears these;
  117. * otherwise they accumulate. The error(s) occurred at the virtual
  118. * address stored in the sync error address register, and may have
  119. * been due to, e.g., what would usually be called a page fault.
  120. * Worse, the bits accumulate during instruction prefetch, so
  121. * various bits can be on that should be off.
  122. */
  123. #define SER_WRITE 0x8000 /* error occurred during write */
  124. #define SER_INVAL 0x80 /* PTE had PG_V off */
  125. #define SER_PROT 0x40 /* operation violated PTE prot */
  126. #define SER_TIMEOUT 0x20 /* bus timeout (non-existent mem) */
  127. #define SER_SBUSERR 0x10 /* S-Bus bus error */
  128. #define SER_MEMERR 0x08 /* memory ecc/parity error */
  129. #define SER_SZERR 0x02 /* [4/vme?] size error, whatever that is */
  130. #define SER_WATCHDOG 0x01 /* watchdog reset (never see this) */
  131. #define SER_BITS \
  132. "\20\20WRITE\10INVAL\7PROT\6TIMEOUT\5SBUSERR\4MEMERR\2SZERR\1WATCHDOG"
  133. /*
  134. * [4/4c]
  135. * Bits in async error register (errors from DVMA or Sun-4 cache
  136. * writeback). The corresponding bit is also set in the sync error reg.
  137. *
  138. * A writeback invalid error means there is a bug in the PTE manager.
  139. *
  140. * The word is that the async error register does not work right.
  141. */
  142. #define AER_WBINVAL 0x80 /* writeback found PTE without PG_V */
  143. #define AER_TIMEOUT 0x20 /* bus timeout */
  144. #define AER_DVMAERR 0x10 /* bus error during DVMA */
  145. #define AER_BITS "\20\10WBINVAL\6TIMEOUT\5DVMAERR"
  146. /*
  147. * [4/4c] Bits in system enable register.
  148. */
  149. #define SYSEN_DVMA 0x20 /* Enable dvma */
  150. #define SYSEN_CACHE 0x10 /* Enable cache */
  151. #define SYSEN_IOCACHE 0x40 /* Enable IO cache */
  152. #define SYSEN_VIDEO 0x08 /* Enable on-board video */
  153. #define SYSEN_RESET 0x04 /* Reset the hardware */
  154. #define SYSEN_RESETVME 0x02 /* Reset the VME bus */
  155. /*
  156. * [4m] Bits in ASI_CONTROL? space, sun4m only.
  157. */
  158. #define MXCC_ENABLE_ADDR 0x1c00a00 /* Enable register for MXCC */
  159. #define MXCC_ENABLE_BIT 0x4 /* Enable bit for MXCC */
  160. /*
  161. * Bits in ASI_SRMMUFP space.
  162. * Bits 8-11 determine the type of flush/probe.
  163. * Address bits 12-31 hold the page frame.
  164. */
  165. #define ASI_SRMMUFP_L3 (0<<8) /* probe L3 | flush L3 PTE */
  166. #define ASI_SRMMUFP_L2 (1<<8) /* probe L2 | flush L2/L3 PTE/PTD's */
  167. #define ASI_SRMMUFP_L1 (2<<8) /* probe L1 | flush L1/L2/L3 PTE/PTD's*/
  168. #define ASI_SRMMUFP_L0 (3<<8) /* probe L0 | flush L0/L1/L2/L3 PTE/PTD's */
  169. #define ASI_SRMMUFP_LN (4<<8) /* probe all | flush all levels */
  170. /*
  171. * [4m] Registers and bits in the SPARC Reference MMU (ASI_SRMMU).
  172. */
  173. #define SRMMU_PCR 0x00000000 /* Processor control register */
  174. #define SRMMU_CXTPTR 0x00000100 /* Context table pointer register */
  175. #define SRMMU_CXR 0x00000200 /* Context register */
  176. #define SRMMU_SFSR 0x00000300 /* Synchronous fault status reg */
  177. #define SRMMU_SFAR 0x00000400 /* Synchronous fault address reg */
  178. #define SRMMU_AFSR 0x00000500 /* Asynchronous fault status reg (HS)*/
  179. #define SRMMU_AFAR 0x00000600 /* Asynchronous fault address reg (HS)*/
  180. #define SRMMU_PCFG 0x00000600 /* Processor configuration reg (TURBO)*/
  181. #define SRMMU_TLBCTRL 0x00001000 /* TLB replacement control reg */
  182. /*
  183. * [4m] Bits in SRMMU control register. One set per module.
  184. */
  185. #define VIKING_PCR_ME 0x00000001 /* MMU Enable */
  186. #define VIKING_PCR_NF 0x00000002 /* Fault inhibit bit */
  187. #define VIKING_PCR_PSO 0x00000080 /* Partial Store Ordering enable */
  188. #define VIKING_PCR_DCE 0x00000100 /* Data cache enable bit */
  189. #define VIKING_PCR_ICE 0x00000200 /* SuperSPARC instr. cache enable */
  190. #define VIKING_PCR_SB 0x00000400 /* Store buffer enable bit */
  191. #define VIKING_PCR_MB 0x00000800 /* MBus mode: 0=MXCC, 1=no MXCC */
  192. #define VIKING_PCR_PE 0x00001000 /* Enable memory parity checking */
  193. #define VIKING_PCR_BM 0x00002000 /* 1 iff booting */
  194. #define VIKING_PCR_SE 0x00004000 /* Coherent bus snoop enable */
  195. #define VIKING_PCR_AC 0x00008000 /* 1=cache non-MMU accesses */
  196. #define VIKING_PCR_TC 0x00010000 /* 1=cache table walks */
  197. #define HYPERSPARC_PCR_ME 0x00000001 /* MMU Enable */
  198. #define HYPERSPARC_PCR_NF 0x00000002 /* Fault inhibit bit */
  199. #define HYPERSPARC_PCR_CE 0x00000100 /* Cache enable bit */
  200. #define HYPERSPARC_PCR_CM 0x00000400 /* Cache mode: 1=write-back */
  201. #define HYPERSPARC_PCR_MR 0x00000800 /* Memory reflection: 1 = on */
  202. #define HYPERSPARC_PCR_CS 0x00001000 /* cache size: 1=256k, 0=128k */
  203. #define HYPERSPARC_PCR_C 0x00002000 /* enable cache when MMU off */
  204. #define HYPERSPARC_PCR_BM 0x00004000 /* 1 iff booting */
  205. #define HYPERSPARC_PCR_MID 0x00078000 /* MBus module ID MID<3:0> */
  206. #define HYPERSPARC_PCR_WBE 0x00080000 /* Write buffer enable */
  207. #define HYPERSPARC_PCR_SE 0x00100000 /* Coherent bus snoop enable */
  208. #define HYPERSPARC_PCR_CWR 0x00200000 /* Cache wrap enable */
  209. #define CYPRESS_PCR_ME 0x00000001 /* MMU Enable */
  210. #define CYPRESS_PCR_NF 0x00000002 /* Fault inhibit bit */
  211. #define CYPRESS_PCR_CE 0x00000100 /* Cache enable bit */
  212. #define CYPRESS_PCR_CL 0x00000200 /* Cache Lock (604 only) */
  213. #define CYPRESS_PCR_CM 0x00000400 /* Cache mode: 1=write-back */
  214. #define CYPRESS_PCR_MR 0x00000800 /* Memory reflection: 1=on (605 only) */
  215. #define CYPRESS_PCR_C 0x00002000 /* enable cache when MMU off */
  216. #define CYPRESS_PCR_BM 0x00004000 /* 1 iff booting */
  217. #define CYPRESS_PCR_MID 0x00078000 /* MBus module ID MID<3:0> (605 only) */
  218. #define CYPRESS_PCR_MV 0x00080000 /* Multichip Valid */
  219. #define CYPRESS_PCR_MCM 0x00300000 /* Multichip Mask */
  220. #define CYPRESS_PCR_MCA 0x00c00000 /* Multichip Address */
  221. #define MS1_PCR_ME 0x00000001 /* MMU Enable */
  222. #define MS1_PCR_NF 0x00000002 /* Fault inhibit bit */
  223. #define MS1_PCR_DCE 0x00000100 /* Data cache enable */
  224. #define MS1_PCR_ICE 0x00000200 /* Instruction cache enable */
  225. #define MS1_PCR_RC 0x00000c00 /* DRAM Refresh control */
  226. #define MS1_PCR_PE 0x00001000 /* Enable memory parity checking */
  227. #define MS1_PCR_BM 0x00004000 /* 1 iff booting */
  228. #define MS1_PCR_AC 0x00008000 /* 1=cache if ME==0 (and [ID]CE on) */
  229. #define MS1_PCR_ID 0x00010000 /* 1=disable ITBR */
  230. #define MS1_PCR_PC 0x00020000 /* Parity control: 0=even,1=odd */
  231. #define MS1_PCR_MV 0x00100000 /* Memory data View (diag) */
  232. #define MS1_PCR_DV 0x00200000 /* Data View (diag) */
  233. #define MS1_PCR_AV 0x00400000 /* Address View (diag) */
  234. #define MS1_PCR_STW 0x00800000 /* Software Tablewalk enable */
  235. #define SWIFT_PCR_ME 0x00000001 /* MMU Enable */
  236. #define SWIFT_PCR_NF 0x00000002 /* Fault inhibit bit */
  237. #define SWIFT_PCR_DCE 0x00000100 /* Data cache enable */
  238. #define SWIFT_PCR_ICE 0x00000200 /* Instruction cache enable */
  239. #define SWIFT_PCR_RC 0x00003c00 /* DRAM Refresh control */
  240. #define SWIFT_PCR_BM 0x00004000 /* 1 iff booting */
  241. #define SWIFT_PCR_AC 0x00008000 /* 1=cache if ME=0 (and [ID]CE on) */
  242. #define SWIFT_PCR_PA 0x00010000 /* TCX/SX control */
  243. #define SWIFT_PCR_PC 0x00020000 /* Parity control: 0=even,1=odd */
  244. #define SWIFT_PCR_PE 0x00040000 /* Enable memory parity checking */
  245. #define SWIFT_PCR_PMC 0x00180000 /* Page mode control */
  246. #define SWIFT_PCR_BF 0x00200000 /* Branch Folding */
  247. #define SWIFT_PCR_WP 0x00400000 /* Watch point enable */
  248. #define SWIFT_PCR_STW 0x00800000 /* Software Tablewalk enable */
  249. #define TURBOSPARC_PCR_ME 0x00000001 /* MMU Enable */
  250. #define TURBOSPARC_PCR_NF 0x00000002 /* Fault inhibit bit */
  251. #define TURBOSPARC_PCR_ICS 0x00000004 /* I-cache snoop enable */
  252. #define TURBOSPARC_PCR_PSO 0x00000008 /* Partial Store order (ro!) */
  253. #define TURBOSPARC_PCR_DCE 0x00000100 /* Data cache enable */
  254. #define TURBOSPARC_PCR_ICE 0x00000200 /* Instruction cache enable */
  255. #define TURBOSPARC_PCR_RC 0x00003c00 /* DRAM Refresh control */
  256. #define TURBOSPARC_PCR_BM 0x00004000 /* 1 iff booting */
  257. #define TURBOSPARC_PCR_PC 0x00020000 /* Parity ctrl: 0=even,1=odd */
  258. #define TURBOSPARC_PCR_PE 0x00040000 /* Enable parity checking */
  259. #define TURBOSPARC_PCR_PMC 0x00180000 /* Page mode control */
  260. /* The Turbosparc's Processor Configuration Register */
  261. #define TURBOSPARC_PCFG_SCC 0x00000007 /* e-cache config */
  262. #define TURBOSPARC_PCFG_SE 0x00000008 /* e-cache enable */
  263. #define TURBOSPARC_PCFG_US2 0x00000010 /* microsparc II compat */
  264. #define TURBOSPARC_PCFG_WT 0x00000020 /* write-through enable */
  265. #define TURBOSPARC_PCFG_SBC 0x000000c0 /* SBus Clock */
  266. #define TURBOSPARC_PCFG_WS 0x03800000 /* DRAM wait states */
  267. #define TURBOSPARC_PCFG_RAH 0x0c000000 /* DRAM Row Address Hold */
  268. #define TURBOSPARC_PCFG_AXC 0x30000000 /* AFX Clock */
  269. #define TURBOSPARC_PCFG_SNP 0x40000000 /* DVMA Snoop enable */
  270. #define TURBOSPARC_PCFG_IOCLK 0x80000000 /* I/O clock ratio */
  271. /* Implementation and Version fields are common to all modules */
  272. #define SRMMU_PCR_VER 0x0f000000 /* Version of MMU implementation */
  273. #define SRMMU_PCR_IMPL 0xf0000000 /* Implementation number of MMU */
  274. /* [4m] Bits in the Synchronous Fault Status Register */
  275. #define SFSR_EM 0x00020000 /* Error mode watchdog reset occurred */
  276. #define SFSR_CS 0x00010000 /* Control Space error */
  277. #define SFSR_PERR 0x00006000 /* Parity error code */
  278. #define SFSR_SB 0x00008000 /* SS: Store Buffer Error */
  279. #define SFSR_P 0x00004000 /* SS: Parity error */
  280. #define SFSR_UC 0x00001000 /* Uncorrectable error */
  281. #define SFSR_TO 0x00000800 /* S-Bus timeout */
  282. #define SFSR_BE 0x00000400 /* S-Bus bus error */
  283. #define SFSR_LVL 0x00000300 /* Pagetable level causing the fault */
  284. #define SFSR_AT 0x000000e0 /* Access type */
  285. #define SFSR_FT 0x0000001c /* Fault type */
  286. #define SFSR_FAV 0x00000002 /* Fault Address is valid */
  287. #define SFSR_OW 0x00000001 /* Overwritten with new fault */
  288. #define SFSR_BITS \
  289. "\20\21CSERR\17PARITY\16SYSERR\15UNCORR\14TIMEOUT\13BUSERR\2FAV\1OW"
  290. /* [4m] Synchronous Fault Types */
  291. #define SFSR_FT_NONE (0 << 2) /* no fault */
  292. #define SFSR_FT_INVADDR (1 << 2) /* invalid address fault */
  293. #define SFSR_FT_PROTERR (2 << 2) /* protection fault */
  294. #define SFSR_FT_PRIVERR (3 << 2) /* privelege violation */
  295. #define SFSR_FT_TRANSERR (4 << 2) /* translation fault */
  296. #define SFSR_FT_BUSERR (5 << 2) /* access bus error */
  297. #define SFSR_FT_INTERR (6 << 2) /* internal error */
  298. #define SFSR_FT_RESERVED (7 << 2) /* reserved */
  299. /* [4m] Synchronous Fault Access Types */
  300. #define SFSR_AT_LDUDATA (0 << 5) /* Load user data */
  301. #define SFSR_AT_LDSDATA (1 << 5) /* Load supervisor data */
  302. #define SFSR_AT_LDUTEXT (2 << 5) /* Load user text */
  303. #define SFSR_AT_LDSTEXT (3 << 5) /* Load supervisor text */
  304. #define SFSR_AT_STUDATA (4 << 5) /* Store user data */
  305. #define SFSR_AT_STSDATA (5 << 5) /* Store supervisor data */
  306. #define SFSR_AT_STUTEXT (6 << 5) /* Store user text */
  307. #define SFSR_AT_STSTEXT (7 << 5) /* Store supervisor text */
  308. #define SFSR_AT_SUPERVISOR (1 << 5) /* Set iff supervisor */
  309. #define SFSR_AT_TEXT (2 << 5) /* Set iff text */
  310. #define SFSR_AT_STORE (4 << 5) /* Set iff store */
  311. /* [4m] Synchronous Fault PT Levels */
  312. #define SFSR_LVL_0 (0 << 8) /* Context table entry */
  313. #define SFSR_LVL_1 (1 << 8) /* Region table entry */
  314. #define SFSR_LVL_2 (2 << 8) /* Segment table entry */
  315. #define SFSR_LVL_3 (3 << 8) /* Page table entry */
  316. /* [4m] Asynchronous Fault Status Register bits */
  317. #define AFSR_AFO 0x00000001 /* Async. fault occurred */
  318. #define AFSR_AFA 0x000000f0 /* Bits <35:32> of faulting phys addr */
  319. #define AFSR_AFA_RSHIFT 4 /* Shift to get AFA to bit 0 */
  320. #define AFSR_AFA_LSHIFT 28 /* Shift to get AFA to bit 32 */
  321. #define AFSR_BE 0x00000400 /* Bus error */
  322. #define AFSR_TO 0x00000800 /* Bus timeout */
  323. #define AFSR_UC 0x00001000 /* Uncorrectable error */
  324. #define AFSR_SE 0x00002000 /* System error */
  325. #define AFSR_BITS "\20\16SYSERR\15UNCORR\14TIMEOUT\13BUSERR\1AFO"
  326. /* [4m] TLB Replacement Control Register bits */
  327. #define TLBC_DISABLE 0x00000020 /* Disable replacement counter */
  328. #define TLBC_RCNTMASK 0x0000001f /* Replacement counter (0-31) */
  329. /*
  330. * The Ross Hypersparc has an Instruction Cache Control Register (ICCR)
  331. * It contains an enable bit for the on-chip instruction cache and a bit
  332. * that controls whether a FLUSH instruction causes an Unimplemented
  333. * Flush Trap or just flushes the appropriate instruction cache line.
  334. * The ICCR register is implemented as Ancillary State register number 31.
  335. */
  336. #define HYPERSPARC_ICCR_ICE 1 /* Instruction cache enable */
  337. #define HYPERSPARC_ICCR_FTD 2 /* Unimpl. flush trap disable */
  338. #define HYPERSPARC_ASRNUM_ICCR 31 /* ICCR == ASR#31 */