nosy.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /*
  2. * Chip register definitions for PCILynx chipset. Based on pcilynx.h
  3. * from the Linux 1394 drivers, but modified a bit so the names here
  4. * match the specification exactly (even though they have weird names,
  5. * like xxx_OVER_FLOW, or arbitrary abbreviations like SNTRJ for "sent
  6. * reject" etc.)
  7. */
  8. #define PCILYNX_MAX_REGISTER 0xfff
  9. #define PCILYNX_MAX_MEMORY 0xffff
  10. #define PCI_LATENCY_CACHELINE 0x0c
  11. #define MISC_CONTROL 0x40
  12. #define MISC_CONTROL_SWRESET (1<<0)
  13. #define SERIAL_EEPROM_CONTROL 0x44
  14. #define PCI_INT_STATUS 0x48
  15. #define PCI_INT_ENABLE 0x4c
  16. /* status and enable have identical bit numbers */
  17. #define PCI_INT_INT_PEND (1<<31)
  18. #define PCI_INT_FRC_INT (1<<30)
  19. #define PCI_INT_SLV_ADR_PERR (1<<28)
  20. #define PCI_INT_SLV_DAT_PERR (1<<27)
  21. #define PCI_INT_MST_DAT_PERR (1<<26)
  22. #define PCI_INT_MST_DEV_TO (1<<25)
  23. #define PCI_INT_INT_SLV_TO (1<<23)
  24. #define PCI_INT_AUX_TO (1<<18)
  25. #define PCI_INT_AUX_INT (1<<17)
  26. #define PCI_INT_P1394_INT (1<<16)
  27. #define PCI_INT_DMA4_PCL (1<<9)
  28. #define PCI_INT_DMA4_HLT (1<<8)
  29. #define PCI_INT_DMA3_PCL (1<<7)
  30. #define PCI_INT_DMA3_HLT (1<<6)
  31. #define PCI_INT_DMA2_PCL (1<<5)
  32. #define PCI_INT_DMA2_HLT (1<<4)
  33. #define PCI_INT_DMA1_PCL (1<<3)
  34. #define PCI_INT_DMA1_HLT (1<<2)
  35. #define PCI_INT_DMA0_PCL (1<<1)
  36. #define PCI_INT_DMA0_HLT (1<<0)
  37. /* all DMA interrupts combined: */
  38. #define PCI_INT_DMA_ALL 0x3ff
  39. #define PCI_INT_DMA_HLT(chan) (1 << (chan * 2))
  40. #define PCI_INT_DMA_PCL(chan) (1 << (chan * 2 + 1))
  41. #define LBUS_ADDR 0xb4
  42. #define LBUS_ADDR_SEL_RAM (0x0<<16)
  43. #define LBUS_ADDR_SEL_ROM (0x1<<16)
  44. #define LBUS_ADDR_SEL_AUX (0x2<<16)
  45. #define LBUS_ADDR_SEL_ZV (0x3<<16)
  46. #define GPIO_CTRL_A 0xb8
  47. #define GPIO_CTRL_B 0xbc
  48. #define GPIO_DATA_BASE 0xc0
  49. #define DMA_BREG(base, chan) (base + chan * 0x20)
  50. #define DMA_SREG(base, chan) (base + chan * 0x10)
  51. #define PCL_NEXT_INVALID (1<<0)
  52. /* transfer commands */
  53. #define PCL_CMD_RCV (0x1<<24)
  54. #define PCL_CMD_RCV_AND_UPDATE (0xa<<24)
  55. #define PCL_CMD_XMT (0x2<<24)
  56. #define PCL_CMD_UNFXMT (0xc<<24)
  57. #define PCL_CMD_PCI_TO_LBUS (0x8<<24)
  58. #define PCL_CMD_LBUS_TO_PCI (0x9<<24)
  59. /* aux commands */
  60. #define PCL_CMD_NOP (0x0<<24)
  61. #define PCL_CMD_LOAD (0x3<<24)
  62. #define PCL_CMD_STOREQ (0x4<<24)
  63. #define PCL_CMD_STORED (0xb<<24)
  64. #define PCL_CMD_STORE0 (0x5<<24)
  65. #define PCL_CMD_STORE1 (0x6<<24)
  66. #define PCL_CMD_COMPARE (0xe<<24)
  67. #define PCL_CMD_SWAP_COMPARE (0xf<<24)
  68. #define PCL_CMD_ADD (0xd<<24)
  69. #define PCL_CMD_BRANCH (0x7<<24)
  70. /* BRANCH condition codes */
  71. #define PCL_COND_DMARDY_SET (0x1<<20)
  72. #define PCL_COND_DMARDY_CLEAR (0x2<<20)
  73. #define PCL_GEN_INTR (1<<19)
  74. #define PCL_LAST_BUFF (1<<18)
  75. #define PCL_LAST_CMD (PCL_LAST_BUFF)
  76. #define PCL_WAITSTAT (1<<17)
  77. #define PCL_BIGENDIAN (1<<16)
  78. #define PCL_ISOMODE (1<<12)
  79. #define DMA0_PREV_PCL 0x100
  80. #define DMA1_PREV_PCL 0x120
  81. #define DMA2_PREV_PCL 0x140
  82. #define DMA3_PREV_PCL 0x160
  83. #define DMA4_PREV_PCL 0x180
  84. #define DMA_PREV_PCL(chan) (DMA_BREG(DMA0_PREV_PCL, chan))
  85. #define DMA0_CURRENT_PCL 0x104
  86. #define DMA1_CURRENT_PCL 0x124
  87. #define DMA2_CURRENT_PCL 0x144
  88. #define DMA3_CURRENT_PCL 0x164
  89. #define DMA4_CURRENT_PCL 0x184
  90. #define DMA_CURRENT_PCL(chan) (DMA_BREG(DMA0_CURRENT_PCL, chan))
  91. #define DMA0_CHAN_STAT 0x10c
  92. #define DMA1_CHAN_STAT 0x12c
  93. #define DMA2_CHAN_STAT 0x14c
  94. #define DMA3_CHAN_STAT 0x16c
  95. #define DMA4_CHAN_STAT 0x18c
  96. #define DMA_CHAN_STAT(chan) (DMA_BREG(DMA0_CHAN_STAT, chan))
  97. /* CHAN_STATUS registers share bits */
  98. #define DMA_CHAN_STAT_SELFID (1<<31)
  99. #define DMA_CHAN_STAT_ISOPKT (1<<30)
  100. #define DMA_CHAN_STAT_PCIERR (1<<29)
  101. #define DMA_CHAN_STAT_PKTERR (1<<28)
  102. #define DMA_CHAN_STAT_PKTCMPL (1<<27)
  103. #define DMA_CHAN_STAT_SPECIALACK (1<<14)
  104. #define DMA0_CHAN_CTRL 0x110
  105. #define DMA1_CHAN_CTRL 0x130
  106. #define DMA2_CHAN_CTRL 0x150
  107. #define DMA3_CHAN_CTRL 0x170
  108. #define DMA4_CHAN_CTRL 0x190
  109. #define DMA_CHAN_CTRL(chan) (DMA_BREG(DMA0_CHAN_CTRL, chan))
  110. /* CHAN_CTRL registers share bits */
  111. #define DMA_CHAN_CTRL_ENABLE (1<<31)
  112. #define DMA_CHAN_CTRL_BUSY (1<<30)
  113. #define DMA_CHAN_CTRL_LINK (1<<29)
  114. #define DMA0_READY 0x114
  115. #define DMA1_READY 0x134
  116. #define DMA2_READY 0x154
  117. #define DMA3_READY 0x174
  118. #define DMA4_READY 0x194
  119. #define DMA_READY(chan) (DMA_BREG(DMA0_READY, chan))
  120. #define DMA_GLOBAL_REGISTER 0x908
  121. #define FIFO_SIZES 0xa00
  122. #define FIFO_CONTROL 0xa10
  123. #define FIFO_CONTROL_GRF_FLUSH (1<<4)
  124. #define FIFO_CONTROL_ITF_FLUSH (1<<3)
  125. #define FIFO_CONTROL_ATF_FLUSH (1<<2)
  126. #define FIFO_XMIT_THRESHOLD 0xa14
  127. #define DMA0_WORD0_CMP_VALUE 0xb00
  128. #define DMA1_WORD0_CMP_VALUE 0xb10
  129. #define DMA2_WORD0_CMP_VALUE 0xb20
  130. #define DMA3_WORD0_CMP_VALUE 0xb30
  131. #define DMA4_WORD0_CMP_VALUE 0xb40
  132. #define DMA_WORD0_CMP_VALUE(chan) (DMA_SREG(DMA0_WORD0_CMP_VALUE, chan))
  133. #define DMA0_WORD0_CMP_ENABLE 0xb04
  134. #define DMA1_WORD0_CMP_ENABLE 0xb14
  135. #define DMA2_WORD0_CMP_ENABLE 0xb24
  136. #define DMA3_WORD0_CMP_ENABLE 0xb34
  137. #define DMA4_WORD0_CMP_ENABLE 0xb44
  138. #define DMA_WORD0_CMP_ENABLE(chan) (DMA_SREG(DMA0_WORD0_CMP_ENABLE, chan))
  139. #define DMA0_WORD1_CMP_VALUE 0xb08
  140. #define DMA1_WORD1_CMP_VALUE 0xb18
  141. #define DMA2_WORD1_CMP_VALUE 0xb28
  142. #define DMA3_WORD1_CMP_VALUE 0xb38
  143. #define DMA4_WORD1_CMP_VALUE 0xb48
  144. #define DMA_WORD1_CMP_VALUE(chan) (DMA_SREG(DMA0_WORD1_CMP_VALUE, chan))
  145. #define DMA0_WORD1_CMP_ENABLE 0xb0c
  146. #define DMA1_WORD1_CMP_ENABLE 0xb1c
  147. #define DMA2_WORD1_CMP_ENABLE 0xb2c
  148. #define DMA3_WORD1_CMP_ENABLE 0xb3c
  149. #define DMA4_WORD1_CMP_ENABLE 0xb4c
  150. #define DMA_WORD1_CMP_ENABLE(chan) (DMA_SREG(DMA0_WORD1_CMP_ENABLE, chan))
  151. /* word 1 compare enable flags */
  152. #define DMA_WORD1_CMP_MATCH_OTHERBUS (1<<15)
  153. #define DMA_WORD1_CMP_MATCH_BROADCAST (1<<14)
  154. #define DMA_WORD1_CMP_MATCH_BUS_BCAST (1<<13)
  155. #define DMA_WORD1_CMP_MATCH_LOCAL_NODE (1<<12)
  156. #define DMA_WORD1_CMP_MATCH_EXACT (1<<11)
  157. #define DMA_WORD1_CMP_ENABLE_SELF_ID (1<<10)
  158. #define DMA_WORD1_CMP_ENABLE_MASTER (1<<8)
  159. #define LINK_ID 0xf00
  160. #define LINK_ID_BUS(id) (id<<22)
  161. #define LINK_ID_NODE(id) (id<<16)
  162. #define LINK_CONTROL 0xf04
  163. #define LINK_CONTROL_BUSY (1<<29)
  164. #define LINK_CONTROL_TX_ISO_EN (1<<26)
  165. #define LINK_CONTROL_RX_ISO_EN (1<<25)
  166. #define LINK_CONTROL_TX_ASYNC_EN (1<<24)
  167. #define LINK_CONTROL_RX_ASYNC_EN (1<<23)
  168. #define LINK_CONTROL_RESET_TX (1<<21)
  169. #define LINK_CONTROL_RESET_RX (1<<20)
  170. #define LINK_CONTROL_CYCMASTER (1<<11)
  171. #define LINK_CONTROL_CYCSOURCE (1<<10)
  172. #define LINK_CONTROL_CYCTIMEREN (1<<9)
  173. #define LINK_CONTROL_RCV_CMP_VALID (1<<7)
  174. #define LINK_CONTROL_SNOOP_ENABLE (1<<6)
  175. #define CYCLE_TIMER 0xf08
  176. #define LINK_PHY 0xf0c
  177. #define LINK_PHY_READ (1<<31)
  178. #define LINK_PHY_WRITE (1<<30)
  179. #define LINK_PHY_ADDR(addr) (addr<<24)
  180. #define LINK_PHY_WDATA(data) (data<<16)
  181. #define LINK_PHY_RADDR(addr) (addr<<8)
  182. #define LINK_INT_STATUS 0xf14
  183. #define LINK_INT_ENABLE 0xf18
  184. /* status and enable have identical bit numbers */
  185. #define LINK_INT_LINK_INT (1<<31)
  186. #define LINK_INT_PHY_TIME_OUT (1<<30)
  187. #define LINK_INT_PHY_REG_RCVD (1<<29)
  188. #define LINK_INT_PHY_BUSRESET (1<<28)
  189. #define LINK_INT_TX_RDY (1<<26)
  190. #define LINK_INT_RX_DATA_RDY (1<<25)
  191. #define LINK_INT_IT_STUCK (1<<20)
  192. #define LINK_INT_AT_STUCK (1<<19)
  193. #define LINK_INT_SNTRJ (1<<17)
  194. #define LINK_INT_HDR_ERR (1<<16)
  195. #define LINK_INT_TC_ERR (1<<15)
  196. #define LINK_INT_CYC_SEC (1<<11)
  197. #define LINK_INT_CYC_STRT (1<<10)
  198. #define LINK_INT_CYC_DONE (1<<9)
  199. #define LINK_INT_CYC_PEND (1<<8)
  200. #define LINK_INT_CYC_LOST (1<<7)
  201. #define LINK_INT_CYC_ARB_FAILED (1<<6)
  202. #define LINK_INT_GRF_OVER_FLOW (1<<5)
  203. #define LINK_INT_ITF_UNDER_FLOW (1<<4)
  204. #define LINK_INT_ATF_UNDER_FLOW (1<<3)
  205. #define LINK_INT_IARB_FAILED (1<<0)