nosy.h 9.8 KB

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