cn66xx_regs.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. /**********************************************************************
  2. * Author: Cavium, Inc.
  3. *
  4. * Contact: support@cavium.com
  5. * Please include "LiquidIO" in the subject.
  6. *
  7. * Copyright (c) 2003-2015 Cavium, Inc.
  8. *
  9. * This file is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License, Version 2, as
  11. * published by the Free Software Foundation.
  12. *
  13. * This file is distributed in the hope that it will be useful, but
  14. * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
  15. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
  16. * NONINFRINGEMENT. See the GNU General Public License for more
  17. * details.
  18. *
  19. * This file may also be available under a different license from Cavium.
  20. * Contact Cavium, Inc. for more information
  21. **********************************************************************/
  22. /*! \file cn66xx_regs.h
  23. * \brief Host Driver: Register Address and Register Mask values for
  24. * Octeon CN66XX devices.
  25. */
  26. #ifndef __CN66XX_REGS_H__
  27. #define __CN66XX_REGS_H__
  28. #define CN6XXX_XPANSION_BAR 0x30
  29. #define CN6XXX_MSI_CAP 0x50
  30. #define CN6XXX_MSI_ADDR_LO 0x54
  31. #define CN6XXX_MSI_ADDR_HI 0x58
  32. #define CN6XXX_MSI_DATA 0x5C
  33. #define CN6XXX_PCIE_CAP 0x70
  34. #define CN6XXX_PCIE_DEVCAP 0x74
  35. #define CN6XXX_PCIE_DEVCTL 0x78
  36. #define CN6XXX_PCIE_LINKCAP 0x7C
  37. #define CN6XXX_PCIE_LINKCTL 0x80
  38. #define CN6XXX_PCIE_SLOTCAP 0x84
  39. #define CN6XXX_PCIE_SLOTCTL 0x88
  40. #define CN6XXX_PCIE_ENH_CAP 0x100
  41. #define CN6XXX_PCIE_UNCORR_ERR_STATUS 0x104
  42. #define CN6XXX_PCIE_UNCORR_ERR_MASK 0x108
  43. #define CN6XXX_PCIE_UNCORR_ERR 0x10C
  44. #define CN6XXX_PCIE_CORR_ERR_STATUS 0x110
  45. #define CN6XXX_PCIE_CORR_ERR_MASK 0x114
  46. #define CN6XXX_PCIE_ADV_ERR_CAP 0x118
  47. #define CN6XXX_PCIE_ACK_REPLAY_TIMER 0x700
  48. #define CN6XXX_PCIE_OTHER_MSG 0x704
  49. #define CN6XXX_PCIE_PORT_FORCE_LINK 0x708
  50. #define CN6XXX_PCIE_ACK_FREQ 0x70C
  51. #define CN6XXX_PCIE_PORT_LINK_CTL 0x710
  52. #define CN6XXX_PCIE_LANE_SKEW 0x714
  53. #define CN6XXX_PCIE_SYM_NUM 0x718
  54. #define CN6XXX_PCIE_FLTMSK 0x720
  55. /* ############## BAR0 Registers ################ */
  56. #define CN6XXX_SLI_CTL_PORT0 0x0050
  57. #define CN6XXX_SLI_CTL_PORT1 0x0060
  58. #define CN6XXX_SLI_WINDOW_CTL 0x02E0
  59. #define CN6XXX_SLI_DBG_DATA 0x0310
  60. #define CN6XXX_SLI_SCRATCH1 0x03C0
  61. #define CN6XXX_SLI_SCRATCH2 0x03D0
  62. #define CN6XXX_SLI_CTL_STATUS 0x0570
  63. #define CN6XXX_WIN_WR_ADDR_LO 0x0000
  64. #define CN6XXX_WIN_WR_ADDR_HI 0x0004
  65. #define CN6XXX_WIN_WR_ADDR64 CN6XXX_WIN_WR_ADDR_LO
  66. #define CN6XXX_WIN_RD_ADDR_LO 0x0010
  67. #define CN6XXX_WIN_RD_ADDR_HI 0x0014
  68. #define CN6XXX_WIN_RD_ADDR64 CN6XXX_WIN_RD_ADDR_LO
  69. #define CN6XXX_WIN_WR_DATA_LO 0x0020
  70. #define CN6XXX_WIN_WR_DATA_HI 0x0024
  71. #define CN6XXX_WIN_WR_DATA64 CN6XXX_WIN_WR_DATA_LO
  72. #define CN6XXX_WIN_RD_DATA_LO 0x0040
  73. #define CN6XXX_WIN_RD_DATA_HI 0x0044
  74. #define CN6XXX_WIN_RD_DATA64 CN6XXX_WIN_RD_DATA_LO
  75. #define CN6XXX_WIN_WR_MASK_LO 0x0030
  76. #define CN6XXX_WIN_WR_MASK_HI 0x0034
  77. #define CN6XXX_WIN_WR_MASK_REG CN6XXX_WIN_WR_MASK_LO
  78. /* 1 register (32-bit) to enable Input queues */
  79. #define CN6XXX_SLI_PKT_INSTR_ENB 0x1000
  80. /* 1 register (32-bit) to enable Output queues */
  81. #define CN6XXX_SLI_PKT_OUT_ENB 0x1010
  82. /* 1 register (32-bit) to determine whether Output queues are in reset. */
  83. #define CN6XXX_SLI_PORT_IN_RST_OQ 0x11F0
  84. /* 1 register (32-bit) to determine whether Input queues are in reset. */
  85. #define CN6XXX_SLI_PORT_IN_RST_IQ 0x11F4
  86. /*###################### REQUEST QUEUE #########################*/
  87. /* 1 register (32-bit) - instr. size of each input queue. */
  88. #define CN6XXX_SLI_PKT_INSTR_SIZE 0x1020
  89. /* 32 registers for Input Queue Instr Count - SLI_PKT_IN_DONE0_CNTS */
  90. #define CN6XXX_SLI_IQ_INSTR_COUNT_START 0x2000
  91. /* 32 registers for Input Queue Start Addr - SLI_PKT0_INSTR_BADDR */
  92. #define CN6XXX_SLI_IQ_BASE_ADDR_START64 0x2800
  93. /* 32 registers for Input Doorbell - SLI_PKT0_INSTR_BAOFF_DBELL */
  94. #define CN6XXX_SLI_IQ_DOORBELL_START 0x2C00
  95. /* 32 registers for Input Queue size - SLI_PKT0_INSTR_FIFO_RSIZE */
  96. #define CN6XXX_SLI_IQ_SIZE_START 0x3000
  97. /* 32 registers for Instruction Header Options - SLI_PKT0_INSTR_HEADER */
  98. #define CN6XXX_SLI_IQ_PKT_INSTR_HDR_START64 0x3400
  99. /* 1 register (64-bit) - Back Pressure for each input queue - SLI_PKT0_IN_BP */
  100. #define CN66XX_SLI_INPUT_BP_START64 0x3800
  101. /* Each Input Queue register is at a 16-byte Offset in BAR0 */
  102. #define CN6XXX_IQ_OFFSET 0x10
  103. /* 1 register (32-bit) - ES, RO, NS, Arbitration for Input Queue Data &
  104. * gather list fetches. SLI_PKT_INPUT_CONTROL.
  105. */
  106. #define CN6XXX_SLI_PKT_INPUT_CONTROL 0x1170
  107. /* 1 register (64-bit) - Number of instructions to read at one time
  108. * - 2 bits for each input ring. SLI_PKT_INSTR_RD_SIZE.
  109. */
  110. #define CN6XXX_SLI_PKT_INSTR_RD_SIZE 0x11A0
  111. /* 1 register (64-bit) - Assign Input ring to MAC port
  112. * - 2 bits for each input ring. SLI_PKT_IN_PCIE_PORT.
  113. */
  114. #define CN6XXX_SLI_IN_PCIE_PORT 0x11B0
  115. /*------- Request Queue Macros ---------*/
  116. #define CN6XXX_SLI_IQ_BASE_ADDR64(iq) \
  117. (CN6XXX_SLI_IQ_BASE_ADDR_START64 + ((iq) * CN6XXX_IQ_OFFSET))
  118. #define CN6XXX_SLI_IQ_SIZE(iq) \
  119. (CN6XXX_SLI_IQ_SIZE_START + ((iq) * CN6XXX_IQ_OFFSET))
  120. #define CN6XXX_SLI_IQ_PKT_INSTR_HDR64(iq) \
  121. (CN6XXX_SLI_IQ_PKT_INSTR_HDR_START64 + ((iq) * CN6XXX_IQ_OFFSET))
  122. #define CN6XXX_SLI_IQ_DOORBELL(iq) \
  123. (CN6XXX_SLI_IQ_DOORBELL_START + ((iq) * CN6XXX_IQ_OFFSET))
  124. #define CN6XXX_SLI_IQ_INSTR_COUNT(iq) \
  125. (CN6XXX_SLI_IQ_INSTR_COUNT_START + ((iq) * CN6XXX_IQ_OFFSET))
  126. #define CN66XX_SLI_IQ_BP64(iq) \
  127. (CN66XX_SLI_INPUT_BP_START64 + ((iq) * CN6XXX_IQ_OFFSET))
  128. /*------------------ Masks ----------------*/
  129. #define CN6XXX_INPUT_CTL_ROUND_ROBIN_ARB BIT(22)
  130. #define CN6XXX_INPUT_CTL_DATA_NS BIT(8)
  131. #define CN6XXX_INPUT_CTL_DATA_ES_64B_SWAP BIT(6)
  132. #define CN6XXX_INPUT_CTL_DATA_RO BIT(5)
  133. #define CN6XXX_INPUT_CTL_USE_CSR BIT(4)
  134. #define CN6XXX_INPUT_CTL_GATHER_NS BIT(3)
  135. #define CN6XXX_INPUT_CTL_GATHER_ES_64B_SWAP BIT(2)
  136. #define CN6XXX_INPUT_CTL_GATHER_RO BIT(1)
  137. #ifdef __BIG_ENDIAN_BITFIELD
  138. #define CN6XXX_INPUT_CTL_MASK \
  139. (CN6XXX_INPUT_CTL_DATA_ES_64B_SWAP \
  140. | CN6XXX_INPUT_CTL_USE_CSR \
  141. | CN6XXX_INPUT_CTL_GATHER_ES_64B_SWAP)
  142. #else
  143. #define CN6XXX_INPUT_CTL_MASK \
  144. (CN6XXX_INPUT_CTL_DATA_ES_64B_SWAP \
  145. | CN6XXX_INPUT_CTL_USE_CSR)
  146. #endif
  147. /*############################ OUTPUT QUEUE #########################*/
  148. /* 32 registers for Output queue buffer and info size - SLI_PKT0_OUT_SIZE */
  149. #define CN6XXX_SLI_OQ0_BUFF_INFO_SIZE 0x0C00
  150. /* 32 registers for Output Queue Start Addr - SLI_PKT0_SLIST_BADDR */
  151. #define CN6XXX_SLI_OQ_BASE_ADDR_START64 0x1400
  152. /* 32 registers for Output Queue Packet Credits - SLI_PKT0_SLIST_BAOFF_DBELL */
  153. #define CN6XXX_SLI_OQ_PKT_CREDITS_START 0x1800
  154. /* 32 registers for Output Queue size - SLI_PKT0_SLIST_FIFO_RSIZE */
  155. #define CN6XXX_SLI_OQ_SIZE_START 0x1C00
  156. /* 32 registers for Output Queue Packet Count - SLI_PKT0_CNTS */
  157. #define CN6XXX_SLI_OQ_PKT_SENT_START 0x2400
  158. /* Each Output Queue register is at a 16-byte Offset in BAR0 */
  159. #define CN6XXX_OQ_OFFSET 0x10
  160. /* 1 register (32-bit) - 1 bit for each output queue
  161. * - Relaxed Ordering setting for reading Output Queues descriptors
  162. * - SLI_PKT_SLIST_ROR
  163. */
  164. #define CN6XXX_SLI_PKT_SLIST_ROR 0x1030
  165. /* 1 register (32-bit) - 1 bit for each output queue
  166. * - No Snoop mode for reading Output Queues descriptors
  167. * - SLI_PKT_SLIST_NS
  168. */
  169. #define CN6XXX_SLI_PKT_SLIST_NS 0x1040
  170. /* 1 register (64-bit) - 2 bits for each output queue
  171. * - Endian-Swap mode for reading Output Queue descriptors
  172. * - SLI_PKT_SLIST_ES
  173. */
  174. #define CN6XXX_SLI_PKT_SLIST_ES64 0x1050
  175. /* 1 register (32-bit) - 1 bit for each output queue
  176. * - InfoPtr mode for Output Queues.
  177. * - SLI_PKT_IPTR
  178. */
  179. #define CN6XXX_SLI_PKT_IPTR 0x1070
  180. /* 1 register (32-bit) - 1 bit for each output queue
  181. * - DPTR format selector for Output queues.
  182. * - SLI_PKT_DPADDR
  183. */
  184. #define CN6XXX_SLI_PKT_DPADDR 0x1080
  185. /* 1 register (32-bit) - 1 bit for each output queue
  186. * - Relaxed Ordering setting for reading Output Queues data
  187. * - SLI_PKT_DATA_OUT_ROR
  188. */
  189. #define CN6XXX_SLI_PKT_DATA_OUT_ROR 0x1090
  190. /* 1 register (32-bit) - 1 bit for each output queue
  191. * - No Snoop mode for reading Output Queues data
  192. * - SLI_PKT_DATA_OUT_NS
  193. */
  194. #define CN6XXX_SLI_PKT_DATA_OUT_NS 0x10A0
  195. /* 1 register (64-bit) - 2 bits for each output queue
  196. * - Endian-Swap mode for reading Output Queue data
  197. * - SLI_PKT_DATA_OUT_ES
  198. */
  199. #define CN6XXX_SLI_PKT_DATA_OUT_ES64 0x10B0
  200. /* 1 register (32-bit) - 1 bit for each output queue
  201. * - Controls whether SLI_PKTn_CNTS is incremented for bytes or for packets.
  202. * - SLI_PKT_OUT_BMODE
  203. */
  204. #define CN6XXX_SLI_PKT_OUT_BMODE 0x10D0
  205. /* 1 register (64-bit) - 2 bits for each output queue
  206. * - Assign PCIE port for Output queues
  207. * - SLI_PKT_PCIE_PORT.
  208. */
  209. #define CN6XXX_SLI_PKT_PCIE_PORT64 0x10E0
  210. /* 1 (64-bit) register for Output Queue Packet Count Interrupt Threshold
  211. * & Time Threshold. The same setting applies to all 32 queues.
  212. * The register is defined as a 64-bit registers, but we use the
  213. * 32-bit offsets to define distinct addresses.
  214. */
  215. #define CN6XXX_SLI_OQ_INT_LEVEL_PKTS 0x1120
  216. #define CN6XXX_SLI_OQ_INT_LEVEL_TIME 0x1124
  217. /* 1 (64-bit register) for Output Queue backpressure across all rings. */
  218. #define CN6XXX_SLI_OQ_WMARK 0x1180
  219. /* 1 register to control output queue global backpressure & ring enable. */
  220. #define CN6XXX_SLI_PKT_CTL 0x1220
  221. /*------- Output Queue Macros ---------*/
  222. #define CN6XXX_SLI_OQ_BASE_ADDR64(oq) \
  223. (CN6XXX_SLI_OQ_BASE_ADDR_START64 + ((oq) * CN6XXX_OQ_OFFSET))
  224. #define CN6XXX_SLI_OQ_SIZE(oq) \
  225. (CN6XXX_SLI_OQ_SIZE_START + ((oq) * CN6XXX_OQ_OFFSET))
  226. #define CN6XXX_SLI_OQ_BUFF_INFO_SIZE(oq) \
  227. (CN6XXX_SLI_OQ0_BUFF_INFO_SIZE + ((oq) * CN6XXX_OQ_OFFSET))
  228. #define CN6XXX_SLI_OQ_PKTS_SENT(oq) \
  229. (CN6XXX_SLI_OQ_PKT_SENT_START + ((oq) * CN6XXX_OQ_OFFSET))
  230. #define CN6XXX_SLI_OQ_PKTS_CREDIT(oq) \
  231. (CN6XXX_SLI_OQ_PKT_CREDITS_START + ((oq) * CN6XXX_OQ_OFFSET))
  232. /*######################### DMA Counters #########################*/
  233. /* 2 registers (64-bit) - DMA Count - 1 for each DMA counter 0/1. */
  234. #define CN6XXX_DMA_CNT_START 0x0400
  235. /* 2 registers (64-bit) - DMA Timer 0/1, contains DMA timer values
  236. * SLI_DMA_0_TIM
  237. */
  238. #define CN6XXX_DMA_TIM_START 0x0420
  239. /* 2 registers (64-bit) - DMA count & Time Interrupt threshold -
  240. * SLI_DMA_0_INT_LEVEL
  241. */
  242. #define CN6XXX_DMA_INT_LEVEL_START 0x03E0
  243. /* Each DMA register is at a 16-byte Offset in BAR0 */
  244. #define CN6XXX_DMA_OFFSET 0x10
  245. /*---------- DMA Counter Macros ---------*/
  246. #define CN6XXX_DMA_CNT(dq) \
  247. (CN6XXX_DMA_CNT_START + ((dq) * CN6XXX_DMA_OFFSET))
  248. #define CN6XXX_DMA_INT_LEVEL(dq) \
  249. (CN6XXX_DMA_INT_LEVEL_START + ((dq) * CN6XXX_DMA_OFFSET))
  250. #define CN6XXX_DMA_PKT_INT_LEVEL(dq) \
  251. (CN6XXX_DMA_INT_LEVEL_START + ((dq) * CN6XXX_DMA_OFFSET))
  252. #define CN6XXX_DMA_TIME_INT_LEVEL(dq) \
  253. (CN6XXX_DMA_INT_LEVEL_START + 4 + ((dq) * CN6XXX_DMA_OFFSET))
  254. #define CN6XXX_DMA_TIM(dq) \
  255. (CN6XXX_DMA_TIM_START + ((dq) * CN6XXX_DMA_OFFSET))
  256. /*######################## INTERRUPTS #########################*/
  257. /* 1 register (64-bit) for Interrupt Summary */
  258. #define CN6XXX_SLI_INT_SUM64 0x0330
  259. /* 1 register (64-bit) for Interrupt Enable */
  260. #define CN6XXX_SLI_INT_ENB64_PORT0 0x0340
  261. #define CN6XXX_SLI_INT_ENB64_PORT1 0x0350
  262. /* 1 register (32-bit) to enable Output Queue Packet/Byte Count Interrupt */
  263. #define CN6XXX_SLI_PKT_CNT_INT_ENB 0x1150
  264. /* 1 register (32-bit) to enable Output Queue Packet Timer Interrupt */
  265. #define CN6XXX_SLI_PKT_TIME_INT_ENB 0x1160
  266. /* 1 register (32-bit) to indicate which Output Queue reached pkt threshold */
  267. #define CN6XXX_SLI_PKT_CNT_INT 0x1130
  268. /* 1 register (32-bit) to indicate which Output Queue reached time threshold */
  269. #define CN6XXX_SLI_PKT_TIME_INT 0x1140
  270. /*------------------ Interrupt Masks ----------------*/
  271. #define CN6XXX_INTR_RML_TIMEOUT_ERR BIT(1)
  272. #define CN6XXX_INTR_BAR0_RW_TIMEOUT_ERR BIT(2)
  273. #define CN6XXX_INTR_IO2BIG_ERR BIT(3)
  274. #define CN6XXX_INTR_PKT_COUNT BIT(4)
  275. #define CN6XXX_INTR_PKT_TIME BIT(5)
  276. #define CN6XXX_INTR_M0UPB0_ERR BIT(8)
  277. #define CN6XXX_INTR_M0UPWI_ERR BIT(9)
  278. #define CN6XXX_INTR_M0UNB0_ERR BIT(10)
  279. #define CN6XXX_INTR_M0UNWI_ERR BIT(11)
  280. #define CN6XXX_INTR_M1UPB0_ERR BIT(12)
  281. #define CN6XXX_INTR_M1UPWI_ERR BIT(13)
  282. #define CN6XXX_INTR_M1UNB0_ERR BIT(14)
  283. #define CN6XXX_INTR_M1UNWI_ERR BIT(15)
  284. #define CN6XXX_INTR_MIO_INT0 BIT(16)
  285. #define CN6XXX_INTR_MIO_INT1 BIT(17)
  286. #define CN6XXX_INTR_MAC_INT0 BIT(18)
  287. #define CN6XXX_INTR_MAC_INT1 BIT(19)
  288. #define CN6XXX_INTR_DMA0_FORCE BIT_ULL(32)
  289. #define CN6XXX_INTR_DMA1_FORCE BIT_ULL(33)
  290. #define CN6XXX_INTR_DMA0_COUNT BIT_ULL(34)
  291. #define CN6XXX_INTR_DMA1_COUNT BIT_ULL(35)
  292. #define CN6XXX_INTR_DMA0_TIME BIT_ULL(36)
  293. #define CN6XXX_INTR_DMA1_TIME BIT_ULL(37)
  294. #define CN6XXX_INTR_INSTR_DB_OF_ERR BIT_ULL(48)
  295. #define CN6XXX_INTR_SLIST_DB_OF_ERR BIT_ULL(49)
  296. #define CN6XXX_INTR_POUT_ERR BIT_ULL(50)
  297. #define CN6XXX_INTR_PIN_BP_ERR BIT_ULL(51)
  298. #define CN6XXX_INTR_PGL_ERR BIT_ULL(52)
  299. #define CN6XXX_INTR_PDI_ERR BIT_ULL(53)
  300. #define CN6XXX_INTR_POP_ERR BIT_ULL(54)
  301. #define CN6XXX_INTR_PINS_ERR BIT_ULL(55)
  302. #define CN6XXX_INTR_SPRT0_ERR BIT_ULL(56)
  303. #define CN6XXX_INTR_SPRT1_ERR BIT_ULL(57)
  304. #define CN6XXX_INTR_ILL_PAD_ERR BIT_ULL(60)
  305. #define CN6XXX_INTR_DMA0_DATA (CN6XXX_INTR_DMA0_TIME)
  306. #define CN6XXX_INTR_DMA1_DATA (CN6XXX_INTR_DMA1_TIME)
  307. #define CN6XXX_INTR_DMA_DATA \
  308. (CN6XXX_INTR_DMA0_DATA | CN6XXX_INTR_DMA1_DATA)
  309. #define CN6XXX_INTR_PKT_DATA (CN6XXX_INTR_PKT_TIME | \
  310. CN6XXX_INTR_PKT_COUNT)
  311. /* Sum of interrupts for all PCI-Express Data Interrupts */
  312. #define CN6XXX_INTR_PCIE_DATA \
  313. (CN6XXX_INTR_DMA_DATA | CN6XXX_INTR_PKT_DATA)
  314. #define CN6XXX_INTR_MIO \
  315. (CN6XXX_INTR_MIO_INT0 | CN6XXX_INTR_MIO_INT1)
  316. #define CN6XXX_INTR_MAC \
  317. (CN6XXX_INTR_MAC_INT0 | CN6XXX_INTR_MAC_INT1)
  318. /* Sum of interrupts for error events */
  319. #define CN6XXX_INTR_ERR \
  320. (CN6XXX_INTR_BAR0_RW_TIMEOUT_ERR \
  321. | CN6XXX_INTR_IO2BIG_ERR \
  322. | CN6XXX_INTR_M0UPB0_ERR \
  323. | CN6XXX_INTR_M0UPWI_ERR \
  324. | CN6XXX_INTR_M0UNB0_ERR \
  325. | CN6XXX_INTR_M0UNWI_ERR \
  326. | CN6XXX_INTR_M1UPB0_ERR \
  327. | CN6XXX_INTR_M1UPWI_ERR \
  328. | CN6XXX_INTR_M1UPB0_ERR \
  329. | CN6XXX_INTR_M1UNWI_ERR \
  330. | CN6XXX_INTR_INSTR_DB_OF_ERR \
  331. | CN6XXX_INTR_SLIST_DB_OF_ERR \
  332. | CN6XXX_INTR_POUT_ERR \
  333. | CN6XXX_INTR_PIN_BP_ERR \
  334. | CN6XXX_INTR_PGL_ERR \
  335. | CN6XXX_INTR_PDI_ERR \
  336. | CN6XXX_INTR_POP_ERR \
  337. | CN6XXX_INTR_PINS_ERR \
  338. | CN6XXX_INTR_SPRT0_ERR \
  339. | CN6XXX_INTR_SPRT1_ERR \
  340. | CN6XXX_INTR_ILL_PAD_ERR)
  341. /* Programmed Mask for Interrupt Sum */
  342. #define CN6XXX_INTR_MASK \
  343. (CN6XXX_INTR_PCIE_DATA \
  344. | CN6XXX_INTR_DMA0_FORCE \
  345. | CN6XXX_INTR_DMA1_FORCE \
  346. | CN6XXX_INTR_MIO \
  347. | CN6XXX_INTR_MAC \
  348. | CN6XXX_INTR_ERR)
  349. #define CN6XXX_SLI_S2M_PORT0_CTL 0x3D80
  350. #define CN6XXX_SLI_S2M_PORT1_CTL 0x3D90
  351. #define CN6XXX_SLI_S2M_PORTX_CTL(port) \
  352. (CN6XXX_SLI_S2M_PORT0_CTL + (port * 0x10))
  353. #define CN6XXX_SLI_INT_ENB64(port) \
  354. (CN6XXX_SLI_INT_ENB64_PORT0 + (port * 0x10))
  355. #define CN6XXX_SLI_MAC_NUMBER 0x3E00
  356. /* CN6XXX BAR1 Index registers. */
  357. #define CN6XXX_PEM_BAR1_INDEX000 0x00011800C00000A8ULL
  358. #define CN6XXX_PEM_OFFSET 0x0000000001000000ULL
  359. #define CN6XXX_BAR1_INDEX_START CN6XXX_PEM_BAR1_INDEX000
  360. #define CN6XXX_PCI_BAR1_OFFSET 0x8
  361. #define CN6XXX_BAR1_REG(idx, port) \
  362. (CN6XXX_BAR1_INDEX_START + (port * CN6XXX_PEM_OFFSET) + \
  363. (CN6XXX_PCI_BAR1_OFFSET * (idx)))
  364. /*############################ DPI #########################*/
  365. #define CN6XXX_DPI_CTL 0x0001df0000000040ULL
  366. #define CN6XXX_DPI_DMA_CONTROL 0x0001df0000000048ULL
  367. #define CN6XXX_DPI_REQ_GBL_ENB 0x0001df0000000050ULL
  368. #define CN6XXX_DPI_REQ_ERR_RSP 0x0001df0000000058ULL
  369. #define CN6XXX_DPI_REQ_ERR_RST 0x0001df0000000060ULL
  370. #define CN6XXX_DPI_DMA_ENG0_ENB 0x0001df0000000080ULL
  371. #define CN6XXX_DPI_DMA_ENG_ENB(q_no) \
  372. (CN6XXX_DPI_DMA_ENG0_ENB + (q_no * 8))
  373. #define CN6XXX_DPI_DMA_ENG0_BUF 0x0001df0000000880ULL
  374. #define CN6XXX_DPI_DMA_ENG_BUF(q_no) \
  375. (CN6XXX_DPI_DMA_ENG0_BUF + (q_no * 8))
  376. #define CN6XXX_DPI_SLI_PRT0_CFG 0x0001df0000000900ULL
  377. #define CN6XXX_DPI_SLI_PRT1_CFG 0x0001df0000000908ULL
  378. #define CN6XXX_DPI_SLI_PRTX_CFG(port) \
  379. (CN6XXX_DPI_SLI_PRT0_CFG + (port * 0x10))
  380. #define CN6XXX_DPI_DMA_COMMIT_MODE BIT_ULL(58)
  381. #define CN6XXX_DPI_DMA_PKT_HP BIT_ULL(57)
  382. #define CN6XXX_DPI_DMA_PKT_EN BIT_ULL(56)
  383. #define CN6XXX_DPI_DMA_O_ES BIT_ULL(15)
  384. #define CN6XXX_DPI_DMA_O_MODE BIT_ULL(14)
  385. #define CN6XXX_DPI_DMA_CTL_MASK \
  386. (CN6XXX_DPI_DMA_COMMIT_MODE | \
  387. CN6XXX_DPI_DMA_PKT_HP | \
  388. CN6XXX_DPI_DMA_PKT_EN | \
  389. CN6XXX_DPI_DMA_O_ES | \
  390. CN6XXX_DPI_DMA_O_MODE)
  391. /*############################ CIU #########################*/
  392. #define CN6XXX_CIU_SOFT_BIST 0x0001070000000738ULL
  393. #define CN6XXX_CIU_SOFT_RST 0x0001070000000740ULL
  394. /*############################ MIO #########################*/
  395. #define CN6XXX_MIO_PTP_CLOCK_CFG 0x0001070000000f00ULL
  396. #define CN6XXX_MIO_PTP_CLOCK_LO 0x0001070000000f08ULL
  397. #define CN6XXX_MIO_PTP_CLOCK_HI 0x0001070000000f10ULL
  398. #define CN6XXX_MIO_PTP_CLOCK_COMP 0x0001070000000f18ULL
  399. #define CN6XXX_MIO_PTP_TIMESTAMP 0x0001070000000f20ULL
  400. #define CN6XXX_MIO_PTP_EVT_CNT 0x0001070000000f28ULL
  401. #define CN6XXX_MIO_PTP_CKOUT_THRESH_LO 0x0001070000000f30ULL
  402. #define CN6XXX_MIO_PTP_CKOUT_THRESH_HI 0x0001070000000f38ULL
  403. #define CN6XXX_MIO_PTP_CKOUT_HI_INCR 0x0001070000000f40ULL
  404. #define CN6XXX_MIO_PTP_CKOUT_LO_INCR 0x0001070000000f48ULL
  405. #define CN6XXX_MIO_PTP_PPS_THRESH_LO 0x0001070000000f50ULL
  406. #define CN6XXX_MIO_PTP_PPS_THRESH_HI 0x0001070000000f58ULL
  407. #define CN6XXX_MIO_PTP_PPS_HI_INCR 0x0001070000000f60ULL
  408. #define CN6XXX_MIO_PTP_PPS_LO_INCR 0x0001070000000f68ULL
  409. #define CN6XXX_MIO_QLM4_CFG 0x00011800000015B0ULL
  410. #define CN6XXX_MIO_RST_BOOT 0x0001180000001600ULL
  411. #define CN6XXX_MIO_QLM_CFG_MASK 0x7
  412. /*############################ LMC #########################*/
  413. #define CN6XXX_LMC0_RESET_CTL 0x0001180088000180ULL
  414. #define CN6XXX_LMC0_RESET_CTL_DDR3RST_MASK 0x0000000000000001ULL
  415. #endif