uperf_sbusreg.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /* $OpenBSD: uperf_sbusreg.h,v 1.3 2003/06/02 18:32:41 jason Exp $ */
  2. /*
  3. * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  16. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  19. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  21. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  22. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  23. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  24. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  25. * POSSIBILITY OF SUCH DAMAGE.
  26. *
  27. * Effort sponsored in part by the Defense Advanced Research Projects
  28. * Agency (DARPA) and Air Force Research Laboratory, Air Force
  29. * Materiel Command, USAF, under agreement number F30602-01-2-0537.
  30. *
  31. */
  32. /*
  33. * System Controller registers (for both uni- and dual- processor versions)
  34. */
  35. /*
  36. * Ebus interface registers
  37. */
  38. #define USC_ADDR 0x0000
  39. #define USC_DATA 0x0004
  40. /* Indirect registers */
  41. #define USC_CTRL 0x00 /* overall: control */
  42. #define USC_ID 0x04 /* overall: identity */
  43. #define USC_PERF0 0x08 /* overall: perf counter 0 */
  44. #define USC_PERF1 0x0c /* overall: perf connter 1 */
  45. #define USC_PERFSHAD 0x10 /* overall: perf shadow */
  46. #define USC_PERFCTRL 0x20 /* overall: perf control */
  47. #define USC_DBGPIN 0x30 /* overall: debug pin control */
  48. #define USC_P0CFG 0x40 /* port/processor 1 config */
  49. #define USC_P0STS 0x44 /* port/processor 0 status */
  50. #define USC_P1CFG 0x48 /* port/processor 1 config */
  51. #define USC_P1STS 0x4c /* port/processor 1 status */
  52. #define USC_SYSIOCFG 0x50 /* sysio/u2s port config */
  53. #define USC_SYSIOSTS 0x54 /* sysio/u2s port status */
  54. #define USC_FFBCFG 0x58 /* dsc: ffb config */
  55. #define USC_FFBSTS 0x5c /* dsc: ffb status */
  56. #define USC_MCCTRL0 0x60 /* usc: memory control 0 */
  57. #define USC_MCCTRL1 0x64 /* usc: memory control 1 */
  58. #define USC_CCDIAG 0x70 /* dsc: */
  59. #define USC_CCVEC 0x74 /* dsc: */
  60. #define USC_CCFLT 0x78 /* dsc: */
  61. #define USC_CCPRC 0x7c /* dsc: */
  62. #define USC_MEM0 0x80 /* dsc: mem control 0 */
  63. #define USC_MEM1 0x84 /* dsc: RAS control */
  64. #define USC_MEM2 0x88 /* dsc: CAS_RD control */
  65. #define USC_MEM3 0x8c /* dsc: Bank_Sel control */
  66. #define USC_MEM4 0x90 /* dsc: BMX_Buffer control */
  67. #define USC_MEM5 0x94 /* dsc: CAS_WR control */
  68. #define USC_MEM6 0x98 /* dsc: Phase_Level control */
  69. #define USC_MEM7 0x9c /* dsc: SIMM_Busy_Rd control */
  70. #define USC_MEM8 0xa0 /* dsc: Count_Control */
  71. #define USC_MEM9 0xa4 /* dsc: Refresh control */
  72. #define USC_MEMA 0xa8 /* dsc: Row control */
  73. #define USC_MEMB 0xac /* dsc: guess! */
  74. #define USC_CTRL_POR 0x80000000 /* power on reset */
  75. #define USC_CTRL_SFTPOR 0x40000000 /* last reset was soft */
  76. #define USC_CTRL_XIR 0x20000000 /* initiate XIR */
  77. #define USC_CTRL_BPOR 0x10000000 /* last reset was scan */
  78. #define USC_CTRL_BXIR 0x08000000 /* last reset was xir */
  79. #define USC_CTRL_WAKEUP 0x04000000 /* last reset was wakeup */
  80. #define USC_CTRL_FATAL 0x02000000 /* fatal error detect */
  81. #define USC_CTRL_IAP 0x00800000 /* inv parity on addr bus */
  82. #define USC_CTRL_ENWKUP 0x00400000 /* enable wakeup POR */
  83. #define USC_ID_JEDEC 0xffff0000 /* JEDEC ID */
  84. #define USC_ID_UPANUM_M 0x0000f000 /* #UPA ports supported mask */
  85. #define USC_ID_UPANUM_S 12 /* #UPA ports supported shift */
  86. #define USC_ID_IMPL_M 0x000000f0 /* implementation # mask */
  87. #define USC_ID_IMPL_S 4 /* implementation # shift */
  88. #define USC_ID_VERS_M 0x0000000f /* version mask */
  89. #define USC_ID_VERS_S 0 /* version shift */
  90. #define USC_PCTRL_CLR1 0x00008000 /* clear cntr in SEL1 */
  91. #define USC_PCTRL_SEL1 0x00000f00 /* event source 1 */
  92. #define USC_PCTRL_CLR0 0x00000080 /* clear cntrl in SEL0 */
  93. #define USC_PCTRL_SEL0 0x0000000f /* event source 0 */
  94. /* Event sources, counter 0 */
  95. #define SEL0_SYSCK 0x00000000 /* system clock count */
  96. #define SEL0_PRALL 0x00000001 /* prequests, all sources */
  97. #define SEL0_PRP0 0x00000002 /* prequests, proc 0 */
  98. #define SEL0_PRUS 0x00000004 /* prequests, u2s */
  99. #define SEL0_128BUSY 0x00000005 /* # of cycles 128bit UPA busy */
  100. #define SEL0_64BUSY 0x00000006 /* # of cycles 64bit UPA busy */
  101. #define SEL0_PIOSTALL 0x00000007 /* # cycles stalled during PIO */
  102. #define SEL0_MEMREQ 0x00000008 /* # memory requests issued */
  103. #define SEL0_MCBUSY 0x00000009 /* # cycles memory controller busy */
  104. #define SEL0_PENDSTALL 0x0000000a /* # stalls pending xact scbd hit */
  105. #define SEL0_CWMRP0 0x0000000b /* # coherent write miss req, prc0 */
  106. #define SEL0_CWMRP1 0x0000000c /* # coherent write miss req, prc1 */
  107. #define SEL0_CIT 0x0000000d /* # coherent intervene xacts */
  108. #define SEL0_DACT 0x0000000e /* # data transactions from u2s */
  109. #define SEL0_CRXI 0x0000000f /* # coherent read xacts issued */
  110. /* Event sources, counter 1 */
  111. #define SEL1_SYSCK 0x00000000 /* system clock count */
  112. #define SEL1_PRALL 0x00000001 /* prequests, all sources */
  113. #define SEL1_PRP0 0x00000002 /* prequests, proc 0 */
  114. #define SEL1_PRUS 0x00000004 /* prequests, u2s */
  115. #define SEL1_RDP0 0x00000005 /* read reqs from P0 */
  116. #define SEL1_CRMP0 0x00000006 /* coherent read misses from P0 */
  117. #define SEL1_PIOP0 0x00000007 /* PIO accesses from P0 */
  118. #define SEL1_MRI 0x00000008 /* memory reqs issued */
  119. #define SEL1_MRC 0x00000009 /* memory reqs complete */
  120. #define SEL1_RDP1 0x0000000a /* read reqs from P1 */
  121. #define SEL1_CRMP1 0x0000000b /* coherent read misses from P1 */
  122. #define SEL1_PIOP1 0x0000000c /* PIO accesses from P1 */
  123. #define SEL1_CWXI 0x0000000d /* coherent write xacts issued */
  124. #define SEL1_DXU 0x0000000e /* # data xacts from u2s */
  125. /* Port config (USC_P0CFG, USC_P1CFG, USC_SYSIOCFG, USC_FFBCFG) */
  126. #define USC_PCFG_MD 0x80000000 /* master disable */
  127. #define USC_PCFG_SSLP 0x40000000 /* slave sleep */
  128. #define USC_PCFG_SPRQS 0x0f000000 /* slave prequest queue size */
  129. #define USC_PCFG_SIQS 0x00030000 /* slave interrupt queue size */
  130. #define USC_PCFG_SQEN 0x00008000 /* qualifies writes to SPRQS,SIQS */
  131. #define USC_PCFG_ONER 0x00004000 /* one read */
  132. /* Port status (USC_P0STS, USC_P1STS, USC_SYSIOSTS, USC_FFBSTS) */
  133. #define USC_PSTS_FATAL 0x80000000 /* fatal error detected */
  134. #define USC_PSTS_IADDR 0x40000000 /* invalid address */
  135. #define USC_PSTS_IPORT 0x20000000 /* invalid port */
  136. #define USC_PSTS_IPRTY 0x10000000 /* parity error */
  137. #define USC_PSTS_MC0OF 0x08000000 /* master class 0 overflow */
  138. #define USC_PSTS_MC1OF 0x04000000 /* master class 1 overflow */
  139. #define USC_PSTS_MCQ0 0x03800000 /* # reqs before mc0 overflow */
  140. #define USC_PSTS_MC1Q 0x00700000 /* # reqs before mc1 overflow */
  141. /* usc: memory control 0 */
  142. #define USC_MC0_REFEN 0x80000000 /* refresh enable */
  143. #define USC_MC0_SIMP 0x0000ff00 /* simms present */
  144. #define USC_MC0_REFI 0x000000ff /* refresh interval */
  145. /* usc: memory control 1 */
  146. #define USC_MC1_CSR 0x00001000 /* CAS-to-RAS delay for CBR ref cyc */
  147. #define USC_MC1_WPC1 0x00000c00 /* page cycle 1 write */
  148. #define USC_MC1_RCD 0x00000200 /* RAS-to-CAS delay */
  149. #define USC_MC1_CP 0x00000100 /* CAS precharge */
  150. #define USC_MC1_RP 0x000000c0 /* RAS precharge */
  151. #define USC_MC1_RAS 0x00000030 /* length of RAS for precharge */
  152. #define USC_MC1_PC0 0x0000000c /* page cycle 0 */
  153. #define USC_MC1_PC1 0x00000003 /* page cycle 1 */
  154. /* dsc: memory control 0 */
  155. #define USC_MEM0_REFE 0x80000000 /* refresh enable */
  156. #define USC_MEM0_FSME 0x10000000 /* fsm error */
  157. #define USC_MEM0_PPE 0x08000000 /* ping-pong buffer error */
  158. #define USC_MEM0_DPSE 0x04000000 /* data path scheduler error */
  159. #define USC_MEM0_MCE 0x02000000 /* memory controller error */
  160. #define USC_MEM0_MRE 0x01000000 /* missed refresh error */
  161. #define USC_MEM0_RPMC 0x00800000 /* RAS Phi 0 cookie for refresh */
  162. #define USC_MEM0_RWMC 0x00400000 /* RAS Phi 0 cookie for writers */
  163. #define USC_MEM0_SW0 0x001f0000 /* strecth count for first write */
  164. #define USC_MEM0_SP 0x00000f00 /* simm present mask */
  165. #define USC_MEM0_REFI 0x000000ff /* refresh interval */
  166. /* cache coherence diagnostic: USC_CCDIAG */
  167. #define USC_CCDIAG_SNP 0xffff0000 /* SRAM address */
  168. #define USC_CCDIAG_DME 0x00008000 /* enable writes to DTAG */
  169. /* cache coherence snoop vector: USC_CCVEC */
  170. #define USC_CCVEC_TAG 0x7ff80000 /* tag portion of SRAM data */
  171. #define USC_CCVEC_ST 0x00060000 /* state portion of SRAM data */
  172. #define USC_CCVEC_PAR 0x00010000 /* parity portion of SRAM data */
  173. /* cache coherence fault: USC_CCFLT */
  174. #define USC_CCFLT_PERR0 0x80000000 /* dual tag parity error, proc 0 */
  175. #define USC_CCFLT_CERR0 0x40000000 /* coherence error, proc 0 */
  176. #define USC_CCFLT_PERR1 0x20000000 /* dual tag parity error, proc 1 */
  177. #define USC_CCFLT_CERR1 0x10000000 /* coherence error, proc 1 */
  178. #define USC_CCFLT_IDX 0x0fffe000 /* index of fault */
  179. /* cache coherence processor index: USC_CCPRC */
  180. #define USC_CCPRC_PIDX 0x7fffffff /* address mask for ports 1 & 2 */