s2io-regs.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  1. /************************************************************************
  2. * regs.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC
  3. * Copyright(c) 2002-2010 Exar Corp.
  4. * This software may be used and distributed according to the terms of
  5. * the GNU General Public License (GPL), incorporated herein by reference.
  6. * Drivers based on or derived from this code fall under the GPL and must
  7. * retain the authorship, copyright and license notice. This file is not
  8. * a complete program and may only be used when the entire operating
  9. * system is licensed under the GPL.
  10. * See the file COPYING in this distribution for more information.
  11. ************************************************************************/
  12. #ifndef _REGS_H
  13. #define _REGS_H
  14. #define TBD 0
  15. struct XENA_dev_config {
  16. /* Convention: mHAL_XXX is mask, vHAL_XXX is value */
  17. /* General Control-Status Registers */
  18. u64 general_int_status;
  19. #define GEN_INTR_TXPIC s2BIT(0)
  20. #define GEN_INTR_TXDMA s2BIT(1)
  21. #define GEN_INTR_TXMAC s2BIT(2)
  22. #define GEN_INTR_TXXGXS s2BIT(3)
  23. #define GEN_INTR_TXTRAFFIC s2BIT(8)
  24. #define GEN_INTR_RXPIC s2BIT(32)
  25. #define GEN_INTR_RXDMA s2BIT(33)
  26. #define GEN_INTR_RXMAC s2BIT(34)
  27. #define GEN_INTR_MC s2BIT(35)
  28. #define GEN_INTR_RXXGXS s2BIT(36)
  29. #define GEN_INTR_RXTRAFFIC s2BIT(40)
  30. #define GEN_ERROR_INTR GEN_INTR_TXPIC | GEN_INTR_RXPIC | \
  31. GEN_INTR_TXDMA | GEN_INTR_RXDMA | \
  32. GEN_INTR_TXMAC | GEN_INTR_RXMAC | \
  33. GEN_INTR_TXXGXS| GEN_INTR_RXXGXS| \
  34. GEN_INTR_MC
  35. u64 general_int_mask;
  36. u8 unused0[0x100 - 0x10];
  37. u64 sw_reset;
  38. /* XGXS must be removed from reset only once. */
  39. #define SW_RESET_XENA vBIT(0xA5,0,8)
  40. #define SW_RESET_FLASH vBIT(0xA5,8,8)
  41. #define SW_RESET_EOI vBIT(0xA5,16,8)
  42. #define SW_RESET_ALL (SW_RESET_XENA | \
  43. SW_RESET_FLASH | \
  44. SW_RESET_EOI)
  45. /* The SW_RESET register must read this value after a successful reset. */
  46. #define SW_RESET_RAW_VAL 0xA5000000
  47. u64 adapter_status;
  48. #define ADAPTER_STATUS_TDMA_READY s2BIT(0)
  49. #define ADAPTER_STATUS_RDMA_READY s2BIT(1)
  50. #define ADAPTER_STATUS_PFC_READY s2BIT(2)
  51. #define ADAPTER_STATUS_TMAC_BUF_EMPTY s2BIT(3)
  52. #define ADAPTER_STATUS_PIC_QUIESCENT s2BIT(5)
  53. #define ADAPTER_STATUS_RMAC_REMOTE_FAULT s2BIT(6)
  54. #define ADAPTER_STATUS_RMAC_LOCAL_FAULT s2BIT(7)
  55. #define ADAPTER_STATUS_RMAC_PCC_IDLE vBIT(0xFF,8,8)
  56. #define ADAPTER_STATUS_RMAC_PCC_FOUR_IDLE vBIT(0x0F,8,8)
  57. #define ADAPTER_STATUS_RC_PRC_QUIESCENT vBIT(0xFF,16,8)
  58. #define ADAPTER_STATUS_MC_DRAM_READY s2BIT(24)
  59. #define ADAPTER_STATUS_MC_QUEUES_READY s2BIT(25)
  60. #define ADAPTER_STATUS_RIC_RUNNING s2BIT(26)
  61. #define ADAPTER_STATUS_M_PLL_LOCK s2BIT(30)
  62. #define ADAPTER_STATUS_P_PLL_LOCK s2BIT(31)
  63. u64 adapter_control;
  64. #define ADAPTER_CNTL_EN s2BIT(7)
  65. #define ADAPTER_EOI_TX_ON s2BIT(15)
  66. #define ADAPTER_LED_ON s2BIT(23)
  67. #define ADAPTER_UDPI(val) vBIT(val,36,4)
  68. #define ADAPTER_WAIT_INT s2BIT(48)
  69. #define ADAPTER_ECC_EN s2BIT(55)
  70. u64 serr_source;
  71. #define SERR_SOURCE_PIC s2BIT(0)
  72. #define SERR_SOURCE_TXDMA s2BIT(1)
  73. #define SERR_SOURCE_RXDMA s2BIT(2)
  74. #define SERR_SOURCE_MAC s2BIT(3)
  75. #define SERR_SOURCE_MC s2BIT(4)
  76. #define SERR_SOURCE_XGXS s2BIT(5)
  77. #define SERR_SOURCE_ANY (SERR_SOURCE_PIC | \
  78. SERR_SOURCE_TXDMA | \
  79. SERR_SOURCE_RXDMA | \
  80. SERR_SOURCE_MAC | \
  81. SERR_SOURCE_MC | \
  82. SERR_SOURCE_XGXS)
  83. u64 pci_mode;
  84. #define GET_PCI_MODE(val) ((val & vBIT(0xF, 0, 4)) >> 60)
  85. #define PCI_MODE_PCI_33 0
  86. #define PCI_MODE_PCI_66 0x1
  87. #define PCI_MODE_PCIX_M1_66 0x2
  88. #define PCI_MODE_PCIX_M1_100 0x3
  89. #define PCI_MODE_PCIX_M1_133 0x4
  90. #define PCI_MODE_PCIX_M2_66 0x5
  91. #define PCI_MODE_PCIX_M2_100 0x6
  92. #define PCI_MODE_PCIX_M2_133 0x7
  93. #define PCI_MODE_UNSUPPORTED s2BIT(0)
  94. #define PCI_MODE_32_BITS s2BIT(8)
  95. #define PCI_MODE_UNKNOWN_MODE s2BIT(9)
  96. u8 unused_0[0x800 - 0x128];
  97. /* PCI-X Controller registers */
  98. u64 pic_int_status;
  99. u64 pic_int_mask;
  100. #define PIC_INT_TX s2BIT(0)
  101. #define PIC_INT_FLSH s2BIT(1)
  102. #define PIC_INT_MDIO s2BIT(2)
  103. #define PIC_INT_IIC s2BIT(3)
  104. #define PIC_INT_GPIO s2BIT(4)
  105. #define PIC_INT_RX s2BIT(32)
  106. u64 txpic_int_reg;
  107. u64 txpic_int_mask;
  108. #define PCIX_INT_REG_ECC_SG_ERR s2BIT(0)
  109. #define PCIX_INT_REG_ECC_DB_ERR s2BIT(1)
  110. #define PCIX_INT_REG_FLASHR_R_FSM_ERR s2BIT(8)
  111. #define PCIX_INT_REG_FLASHR_W_FSM_ERR s2BIT(9)
  112. #define PCIX_INT_REG_INI_TX_FSM_SERR s2BIT(10)
  113. #define PCIX_INT_REG_INI_TXO_FSM_ERR s2BIT(11)
  114. #define PCIX_INT_REG_TRT_FSM_SERR s2BIT(13)
  115. #define PCIX_INT_REG_SRT_FSM_SERR s2BIT(14)
  116. #define PCIX_INT_REG_PIFR_FSM_SERR s2BIT(15)
  117. #define PCIX_INT_REG_WRC_TX_SEND_FSM_SERR s2BIT(21)
  118. #define PCIX_INT_REG_RRC_TX_REQ_FSM_SERR s2BIT(23)
  119. #define PCIX_INT_REG_INI_RX_FSM_SERR s2BIT(48)
  120. #define PCIX_INT_REG_RA_RX_FSM_SERR s2BIT(50)
  121. /*
  122. #define PCIX_INT_REG_WRC_RX_SEND_FSM_SERR s2BIT(52)
  123. #define PCIX_INT_REG_RRC_RX_REQ_FSM_SERR s2BIT(54)
  124. #define PCIX_INT_REG_RRC_RX_SPLIT_FSM_SERR s2BIT(58)
  125. */
  126. u64 txpic_alarms;
  127. u64 rxpic_int_reg;
  128. u64 rxpic_int_mask;
  129. u64 rxpic_alarms;
  130. u64 flsh_int_reg;
  131. u64 flsh_int_mask;
  132. #define PIC_FLSH_INT_REG_CYCLE_FSM_ERR s2BIT(63)
  133. #define PIC_FLSH_INT_REG_ERR s2BIT(62)
  134. u64 flash_alarms;
  135. u64 mdio_int_reg;
  136. u64 mdio_int_mask;
  137. #define MDIO_INT_REG_MDIO_BUS_ERR s2BIT(0)
  138. #define MDIO_INT_REG_DTX_BUS_ERR s2BIT(8)
  139. #define MDIO_INT_REG_LASI s2BIT(39)
  140. u64 mdio_alarms;
  141. u64 iic_int_reg;
  142. u64 iic_int_mask;
  143. #define IIC_INT_REG_BUS_FSM_ERR s2BIT(4)
  144. #define IIC_INT_REG_BIT_FSM_ERR s2BIT(5)
  145. #define IIC_INT_REG_CYCLE_FSM_ERR s2BIT(6)
  146. #define IIC_INT_REG_REQ_FSM_ERR s2BIT(7)
  147. #define IIC_INT_REG_ACK_ERR s2BIT(8)
  148. u64 iic_alarms;
  149. u8 unused4[0x08];
  150. u64 gpio_int_reg;
  151. #define GPIO_INT_REG_DP_ERR_INT s2BIT(0)
  152. #define GPIO_INT_REG_LINK_DOWN s2BIT(1)
  153. #define GPIO_INT_REG_LINK_UP s2BIT(2)
  154. u64 gpio_int_mask;
  155. #define GPIO_INT_MASK_LINK_DOWN s2BIT(1)
  156. #define GPIO_INT_MASK_LINK_UP s2BIT(2)
  157. u64 gpio_alarms;
  158. u8 unused5[0x38];
  159. u64 tx_traffic_int;
  160. #define TX_TRAFFIC_INT_n(n) s2BIT(n)
  161. u64 tx_traffic_mask;
  162. u64 rx_traffic_int;
  163. #define RX_TRAFFIC_INT_n(n) s2BIT(n)
  164. u64 rx_traffic_mask;
  165. /* PIC Control registers */
  166. u64 pic_control;
  167. #define PIC_CNTL_RX_ALARM_MAP_1 s2BIT(0)
  168. #define PIC_CNTL_SHARED_SPLITS(n) vBIT(n,11,5)
  169. u64 swapper_ctrl;
  170. #define SWAPPER_CTRL_PIF_R_FE s2BIT(0)
  171. #define SWAPPER_CTRL_PIF_R_SE s2BIT(1)
  172. #define SWAPPER_CTRL_PIF_W_FE s2BIT(8)
  173. #define SWAPPER_CTRL_PIF_W_SE s2BIT(9)
  174. #define SWAPPER_CTRL_TXP_FE s2BIT(16)
  175. #define SWAPPER_CTRL_TXP_SE s2BIT(17)
  176. #define SWAPPER_CTRL_TXD_R_FE s2BIT(18)
  177. #define SWAPPER_CTRL_TXD_R_SE s2BIT(19)
  178. #define SWAPPER_CTRL_TXD_W_FE s2BIT(20)
  179. #define SWAPPER_CTRL_TXD_W_SE s2BIT(21)
  180. #define SWAPPER_CTRL_TXF_R_FE s2BIT(22)
  181. #define SWAPPER_CTRL_TXF_R_SE s2BIT(23)
  182. #define SWAPPER_CTRL_RXD_R_FE s2BIT(32)
  183. #define SWAPPER_CTRL_RXD_R_SE s2BIT(33)
  184. #define SWAPPER_CTRL_RXD_W_FE s2BIT(34)
  185. #define SWAPPER_CTRL_RXD_W_SE s2BIT(35)
  186. #define SWAPPER_CTRL_RXF_W_FE s2BIT(36)
  187. #define SWAPPER_CTRL_RXF_W_SE s2BIT(37)
  188. #define SWAPPER_CTRL_XMSI_FE s2BIT(40)
  189. #define SWAPPER_CTRL_XMSI_SE s2BIT(41)
  190. #define SWAPPER_CTRL_STATS_FE s2BIT(48)
  191. #define SWAPPER_CTRL_STATS_SE s2BIT(49)
  192. u64 pif_rd_swapper_fb;
  193. #define IF_RD_SWAPPER_FB 0x0123456789ABCDEF
  194. u64 scheduled_int_ctrl;
  195. #define SCHED_INT_CTRL_TIMER_EN s2BIT(0)
  196. #define SCHED_INT_CTRL_ONE_SHOT s2BIT(1)
  197. #define SCHED_INT_CTRL_INT2MSI(val) vBIT(val,10,6)
  198. #define SCHED_INT_PERIOD TBD
  199. u64 txreqtimeout;
  200. #define TXREQTO_VAL(val) vBIT(val,0,32)
  201. #define TXREQTO_EN s2BIT(63)
  202. u64 statsreqtimeout;
  203. #define STATREQTO_VAL(n) TBD
  204. #define STATREQTO_EN s2BIT(63)
  205. u64 read_retry_delay;
  206. u64 read_retry_acceleration;
  207. u64 write_retry_delay;
  208. u64 write_retry_acceleration;
  209. u64 xmsi_control;
  210. u64 xmsi_access;
  211. u64 xmsi_address;
  212. u64 xmsi_data;
  213. u64 rx_mat;
  214. #define RX_MAT_SET(ring, msi) vBIT(msi, (8 * ring), 8)
  215. u8 unused6[0x8];
  216. u64 tx_mat0_n[0x8];
  217. #define TX_MAT_SET(fifo, msi) vBIT(msi, (8 * fifo), 8)
  218. u64 xmsi_mask_reg;
  219. u64 stat_byte_cnt;
  220. #define STAT_BC(n) vBIT(n,4,12)
  221. /* Automated statistics collection */
  222. u64 stat_cfg;
  223. #define STAT_CFG_STAT_EN s2BIT(0)
  224. #define STAT_CFG_ONE_SHOT_EN s2BIT(1)
  225. #define STAT_CFG_STAT_NS_EN s2BIT(8)
  226. #define STAT_CFG_STAT_RO s2BIT(9)
  227. #define STAT_TRSF_PER(n) TBD
  228. #define PER_SEC 0x208d5
  229. #define SET_UPDT_PERIOD(n) vBIT((PER_SEC*n),32,32)
  230. #define SET_UPDT_CLICKS(val) vBIT(val, 32, 32)
  231. u64 stat_addr;
  232. /* General Configuration */
  233. u64 mdio_control;
  234. #define MDIO_MMD_INDX_ADDR(val) vBIT(val, 0, 16)
  235. #define MDIO_MMD_DEV_ADDR(val) vBIT(val, 19, 5)
  236. #define MDIO_MMS_PRT_ADDR(val) vBIT(val, 27, 5)
  237. #define MDIO_CTRL_START_TRANS(val) vBIT(val, 56, 4)
  238. #define MDIO_OP(val) vBIT(val, 60, 2)
  239. #define MDIO_OP_ADDR_TRANS 0x0
  240. #define MDIO_OP_WRITE_TRANS 0x1
  241. #define MDIO_OP_READ_POST_INC_TRANS 0x2
  242. #define MDIO_OP_READ_TRANS 0x3
  243. #define MDIO_MDIO_DATA(val) vBIT(val, 32, 16)
  244. u64 dtx_control;
  245. u64 i2c_control;
  246. #define I2C_CONTROL_DEV_ID(id) vBIT(id,1,3)
  247. #define I2C_CONTROL_ADDR(addr) vBIT(addr,5,11)
  248. #define I2C_CONTROL_BYTE_CNT(cnt) vBIT(cnt,22,2)
  249. #define I2C_CONTROL_READ s2BIT(24)
  250. #define I2C_CONTROL_NACK s2BIT(25)
  251. #define I2C_CONTROL_CNTL_START vBIT(0xE,28,4)
  252. #define I2C_CONTROL_CNTL_END(val) (val & vBIT(0x1,28,4))
  253. #define I2C_CONTROL_GET_DATA(val) (u32)(val & 0xFFFFFFFF)
  254. #define I2C_CONTROL_SET_DATA(val) vBIT(val,32,32)
  255. u64 gpio_control;
  256. #define GPIO_CTRL_GPIO_0 s2BIT(8)
  257. u64 misc_control;
  258. #define FAULT_BEHAVIOUR s2BIT(0)
  259. #define EXT_REQ_EN s2BIT(1)
  260. #define MISC_LINK_STABILITY_PRD(val) vBIT(val,29,3)
  261. u8 unused7_1[0x230 - 0x208];
  262. u64 pic_control2;
  263. u64 ini_dperr_ctrl;
  264. u64 wreq_split_mask;
  265. #define WREQ_SPLIT_MASK_SET_MASK(val) vBIT(val, 52, 12)
  266. u8 unused7_2[0x800 - 0x248];
  267. /* TxDMA registers */
  268. u64 txdma_int_status;
  269. u64 txdma_int_mask;
  270. #define TXDMA_PFC_INT s2BIT(0)
  271. #define TXDMA_TDA_INT s2BIT(1)
  272. #define TXDMA_PCC_INT s2BIT(2)
  273. #define TXDMA_TTI_INT s2BIT(3)
  274. #define TXDMA_LSO_INT s2BIT(4)
  275. #define TXDMA_TPA_INT s2BIT(5)
  276. #define TXDMA_SM_INT s2BIT(6)
  277. u64 pfc_err_reg;
  278. #define PFC_ECC_SG_ERR s2BIT(7)
  279. #define PFC_ECC_DB_ERR s2BIT(15)
  280. #define PFC_SM_ERR_ALARM s2BIT(23)
  281. #define PFC_MISC_0_ERR s2BIT(31)
  282. #define PFC_MISC_1_ERR s2BIT(32)
  283. #define PFC_PCIX_ERR s2BIT(39)
  284. u64 pfc_err_mask;
  285. u64 pfc_err_alarm;
  286. u64 tda_err_reg;
  287. #define TDA_Fn_ECC_SG_ERR vBIT(0xff,0,8)
  288. #define TDA_Fn_ECC_DB_ERR vBIT(0xff,8,8)
  289. #define TDA_SM0_ERR_ALARM s2BIT(22)
  290. #define TDA_SM1_ERR_ALARM s2BIT(23)
  291. #define TDA_PCIX_ERR s2BIT(39)
  292. u64 tda_err_mask;
  293. u64 tda_err_alarm;
  294. u64 pcc_err_reg;
  295. #define PCC_FB_ECC_SG_ERR vBIT(0xFF,0,8)
  296. #define PCC_TXB_ECC_SG_ERR vBIT(0xFF,8,8)
  297. #define PCC_FB_ECC_DB_ERR vBIT(0xFF,16, 8)
  298. #define PCC_TXB_ECC_DB_ERR vBIT(0xff,24,8)
  299. #define PCC_SM_ERR_ALARM vBIT(0xff,32,8)
  300. #define PCC_WR_ERR_ALARM vBIT(0xff,40,8)
  301. #define PCC_N_SERR vBIT(0xff,48,8)
  302. #define PCC_6_COF_OV_ERR s2BIT(56)
  303. #define PCC_7_COF_OV_ERR s2BIT(57)
  304. #define PCC_6_LSO_OV_ERR s2BIT(58)
  305. #define PCC_7_LSO_OV_ERR s2BIT(59)
  306. #define PCC_ENABLE_FOUR vBIT(0x0F,0,8)
  307. u64 pcc_err_mask;
  308. u64 pcc_err_alarm;
  309. u64 tti_err_reg;
  310. #define TTI_ECC_SG_ERR s2BIT(7)
  311. #define TTI_ECC_DB_ERR s2BIT(15)
  312. #define TTI_SM_ERR_ALARM s2BIT(23)
  313. u64 tti_err_mask;
  314. u64 tti_err_alarm;
  315. u64 lso_err_reg;
  316. #define LSO6_SEND_OFLOW s2BIT(12)
  317. #define LSO7_SEND_OFLOW s2BIT(13)
  318. #define LSO6_ABORT s2BIT(14)
  319. #define LSO7_ABORT s2BIT(15)
  320. #define LSO6_SM_ERR_ALARM s2BIT(22)
  321. #define LSO7_SM_ERR_ALARM s2BIT(23)
  322. u64 lso_err_mask;
  323. u64 lso_err_alarm;
  324. u64 tpa_err_reg;
  325. #define TPA_TX_FRM_DROP s2BIT(7)
  326. #define TPA_SM_ERR_ALARM s2BIT(23)
  327. u64 tpa_err_mask;
  328. u64 tpa_err_alarm;
  329. u64 sm_err_reg;
  330. #define SM_SM_ERR_ALARM s2BIT(15)
  331. u64 sm_err_mask;
  332. u64 sm_err_alarm;
  333. u8 unused8[0x100 - 0xB8];
  334. /* TxDMA arbiter */
  335. u64 tx_dma_wrap_stat;
  336. /* Tx FIFO controller */
  337. #define X_MAX_FIFOS 8
  338. #define X_FIFO_MAX_LEN 0x1FFF /*8191 */
  339. u64 tx_fifo_partition_0;
  340. #define TX_FIFO_PARTITION_EN s2BIT(0)
  341. #define TX_FIFO_PARTITION_0_PRI(val) vBIT(val,5,3)
  342. #define TX_FIFO_PARTITION_0_LEN(val) vBIT(val,19,13)
  343. #define TX_FIFO_PARTITION_1_PRI(val) vBIT(val,37,3)
  344. #define TX_FIFO_PARTITION_1_LEN(val) vBIT(val,51,13 )
  345. u64 tx_fifo_partition_1;
  346. #define TX_FIFO_PARTITION_2_PRI(val) vBIT(val,5,3)
  347. #define TX_FIFO_PARTITION_2_LEN(val) vBIT(val,19,13)
  348. #define TX_FIFO_PARTITION_3_PRI(val) vBIT(val,37,3)
  349. #define TX_FIFO_PARTITION_3_LEN(val) vBIT(val,51,13)
  350. u64 tx_fifo_partition_2;
  351. #define TX_FIFO_PARTITION_4_PRI(val) vBIT(val,5,3)
  352. #define TX_FIFO_PARTITION_4_LEN(val) vBIT(val,19,13)
  353. #define TX_FIFO_PARTITION_5_PRI(val) vBIT(val,37,3)
  354. #define TX_FIFO_PARTITION_5_LEN(val) vBIT(val,51,13)
  355. u64 tx_fifo_partition_3;
  356. #define TX_FIFO_PARTITION_6_PRI(val) vBIT(val,5,3)
  357. #define TX_FIFO_PARTITION_6_LEN(val) vBIT(val,19,13)
  358. #define TX_FIFO_PARTITION_7_PRI(val) vBIT(val,37,3)
  359. #define TX_FIFO_PARTITION_7_LEN(val) vBIT(val,51,13)
  360. #define TX_FIFO_PARTITION_PRI_0 0 /* highest */
  361. #define TX_FIFO_PARTITION_PRI_1 1
  362. #define TX_FIFO_PARTITION_PRI_2 2
  363. #define TX_FIFO_PARTITION_PRI_3 3
  364. #define TX_FIFO_PARTITION_PRI_4 4
  365. #define TX_FIFO_PARTITION_PRI_5 5
  366. #define TX_FIFO_PARTITION_PRI_6 6
  367. #define TX_FIFO_PARTITION_PRI_7 7 /* lowest */
  368. u64 tx_w_round_robin_0;
  369. u64 tx_w_round_robin_1;
  370. u64 tx_w_round_robin_2;
  371. u64 tx_w_round_robin_3;
  372. u64 tx_w_round_robin_4;
  373. u64 tti_command_mem;
  374. #define TTI_CMD_MEM_WE s2BIT(7)
  375. #define TTI_CMD_MEM_STROBE_NEW_CMD s2BIT(15)
  376. #define TTI_CMD_MEM_STROBE_BEING_EXECUTED s2BIT(15)
  377. #define TTI_CMD_MEM_OFFSET(n) vBIT(n,26,6)
  378. u64 tti_data1_mem;
  379. #define TTI_DATA1_MEM_TX_TIMER_VAL(n) vBIT(n,6,26)
  380. #define TTI_DATA1_MEM_TX_TIMER_AC_CI(n) vBIT(n,38,2)
  381. #define TTI_DATA1_MEM_TX_TIMER_AC_EN s2BIT(38)
  382. #define TTI_DATA1_MEM_TX_TIMER_CI_EN s2BIT(39)
  383. #define TTI_DATA1_MEM_TX_URNG_A(n) vBIT(n,41,7)
  384. #define TTI_DATA1_MEM_TX_URNG_B(n) vBIT(n,49,7)
  385. #define TTI_DATA1_MEM_TX_URNG_C(n) vBIT(n,57,7)
  386. u64 tti_data2_mem;
  387. #define TTI_DATA2_MEM_TX_UFC_A(n) vBIT(n,0,16)
  388. #define TTI_DATA2_MEM_TX_UFC_B(n) vBIT(n,16,16)
  389. #define TTI_DATA2_MEM_TX_UFC_C(n) vBIT(n,32,16)
  390. #define TTI_DATA2_MEM_TX_UFC_D(n) vBIT(n,48,16)
  391. /* Tx Protocol assist */
  392. u64 tx_pa_cfg;
  393. #define TX_PA_CFG_IGNORE_FRM_ERR s2BIT(1)
  394. #define TX_PA_CFG_IGNORE_SNAP_OUI s2BIT(2)
  395. #define TX_PA_CFG_IGNORE_LLC_CTRL s2BIT(3)
  396. #define TX_PA_CFG_IGNORE_L2_ERR s2BIT(6)
  397. #define RX_PA_CFG_STRIP_VLAN_TAG s2BIT(15)
  398. /* Recent add, used only debug purposes. */
  399. u64 pcc_enable;
  400. u8 unused9[0x700 - 0x178];
  401. u64 txdma_debug_ctrl;
  402. u8 unused10[0x1800 - 0x1708];
  403. /* RxDMA Registers */
  404. u64 rxdma_int_status;
  405. u64 rxdma_int_mask;
  406. #define RXDMA_INT_RC_INT_M s2BIT(0)
  407. #define RXDMA_INT_RPA_INT_M s2BIT(1)
  408. #define RXDMA_INT_RDA_INT_M s2BIT(2)
  409. #define RXDMA_INT_RTI_INT_M s2BIT(3)
  410. u64 rda_err_reg;
  411. #define RDA_RXDn_ECC_SG_ERR vBIT(0xFF,0,8)
  412. #define RDA_RXDn_ECC_DB_ERR vBIT(0xFF,8,8)
  413. #define RDA_FRM_ECC_SG_ERR s2BIT(23)
  414. #define RDA_FRM_ECC_DB_N_AERR s2BIT(31)
  415. #define RDA_SM1_ERR_ALARM s2BIT(38)
  416. #define RDA_SM0_ERR_ALARM s2BIT(39)
  417. #define RDA_MISC_ERR s2BIT(47)
  418. #define RDA_PCIX_ERR s2BIT(55)
  419. #define RDA_RXD_ECC_DB_SERR s2BIT(63)
  420. u64 rda_err_mask;
  421. u64 rda_err_alarm;
  422. u64 rc_err_reg;
  423. #define RC_PRCn_ECC_SG_ERR vBIT(0xFF,0,8)
  424. #define RC_PRCn_ECC_DB_ERR vBIT(0xFF,8,8)
  425. #define RC_FTC_ECC_SG_ERR s2BIT(23)
  426. #define RC_FTC_ECC_DB_ERR s2BIT(31)
  427. #define RC_PRCn_SM_ERR_ALARM vBIT(0xFF,32,8)
  428. #define RC_FTC_SM_ERR_ALARM s2BIT(47)
  429. #define RC_RDA_FAIL_WR_Rn vBIT(0xFF,48,8)
  430. u64 rc_err_mask;
  431. u64 rc_err_alarm;
  432. u64 prc_pcix_err_reg;
  433. #define PRC_PCI_AB_RD_Rn vBIT(0xFF,0,8)
  434. #define PRC_PCI_DP_RD_Rn vBIT(0xFF,8,8)
  435. #define PRC_PCI_AB_WR_Rn vBIT(0xFF,16,8)
  436. #define PRC_PCI_DP_WR_Rn vBIT(0xFF,24,8)
  437. #define PRC_PCI_AB_F_WR_Rn vBIT(0xFF,32,8)
  438. #define PRC_PCI_DP_F_WR_Rn vBIT(0xFF,40,8)
  439. u64 prc_pcix_err_mask;
  440. u64 prc_pcix_err_alarm;
  441. u64 rpa_err_reg;
  442. #define RPA_ECC_SG_ERR s2BIT(7)
  443. #define RPA_ECC_DB_ERR s2BIT(15)
  444. #define RPA_FLUSH_REQUEST s2BIT(22)
  445. #define RPA_SM_ERR_ALARM s2BIT(23)
  446. #define RPA_CREDIT_ERR s2BIT(31)
  447. u64 rpa_err_mask;
  448. u64 rpa_err_alarm;
  449. u64 rti_err_reg;
  450. #define RTI_ECC_SG_ERR s2BIT(7)
  451. #define RTI_ECC_DB_ERR s2BIT(15)
  452. #define RTI_SM_ERR_ALARM s2BIT(23)
  453. u64 rti_err_mask;
  454. u64 rti_err_alarm;
  455. u8 unused11[0x100 - 0x88];
  456. /* DMA arbiter */
  457. u64 rx_queue_priority;
  458. #define RX_QUEUE_0_PRIORITY(val) vBIT(val,5,3)
  459. #define RX_QUEUE_1_PRIORITY(val) vBIT(val,13,3)
  460. #define RX_QUEUE_2_PRIORITY(val) vBIT(val,21,3)
  461. #define RX_QUEUE_3_PRIORITY(val) vBIT(val,29,3)
  462. #define RX_QUEUE_4_PRIORITY(val) vBIT(val,37,3)
  463. #define RX_QUEUE_5_PRIORITY(val) vBIT(val,45,3)
  464. #define RX_QUEUE_6_PRIORITY(val) vBIT(val,53,3)
  465. #define RX_QUEUE_7_PRIORITY(val) vBIT(val,61,3)
  466. #define RX_QUEUE_PRI_0 0 /* highest */
  467. #define RX_QUEUE_PRI_1 1
  468. #define RX_QUEUE_PRI_2 2
  469. #define RX_QUEUE_PRI_3 3
  470. #define RX_QUEUE_PRI_4 4
  471. #define RX_QUEUE_PRI_5 5
  472. #define RX_QUEUE_PRI_6 6
  473. #define RX_QUEUE_PRI_7 7 /* lowest */
  474. u64 rx_w_round_robin_0;
  475. u64 rx_w_round_robin_1;
  476. u64 rx_w_round_robin_2;
  477. u64 rx_w_round_robin_3;
  478. u64 rx_w_round_robin_4;
  479. /* Per-ring controller regs */
  480. #define RX_MAX_RINGS 8
  481. #if 0
  482. #define RX_MAX_RINGS_SZ 0xFFFF /* 65536 */
  483. #define RX_MIN_RINGS_SZ 0x3F /* 63 */
  484. #endif
  485. u64 prc_rxd0_n[RX_MAX_RINGS];
  486. u64 prc_ctrl_n[RX_MAX_RINGS];
  487. #define PRC_CTRL_RC_ENABLED s2BIT(7)
  488. #define PRC_CTRL_RING_MODE (s2BIT(14)|s2BIT(15))
  489. #define PRC_CTRL_RING_MODE_1 vBIT(0,14,2)
  490. #define PRC_CTRL_RING_MODE_3 vBIT(1,14,2)
  491. #define PRC_CTRL_RING_MODE_5 vBIT(2,14,2)
  492. #define PRC_CTRL_RING_MODE_x vBIT(3,14,2)
  493. #define PRC_CTRL_NO_SNOOP (s2BIT(22)|s2BIT(23))
  494. #define PRC_CTRL_NO_SNOOP_DESC s2BIT(22)
  495. #define PRC_CTRL_NO_SNOOP_BUFF s2BIT(23)
  496. #define PRC_CTRL_BIMODAL_INTERRUPT s2BIT(37)
  497. #define PRC_CTRL_GROUP_READS s2BIT(38)
  498. #define PRC_CTRL_RXD_BACKOFF_INTERVAL(val) vBIT(val,40,24)
  499. u64 prc_alarm_action;
  500. #define PRC_ALARM_ACTION_RR_R0_STOP s2BIT(3)
  501. #define PRC_ALARM_ACTION_RW_R0_STOP s2BIT(7)
  502. #define PRC_ALARM_ACTION_RR_R1_STOP s2BIT(11)
  503. #define PRC_ALARM_ACTION_RW_R1_STOP s2BIT(15)
  504. #define PRC_ALARM_ACTION_RR_R2_STOP s2BIT(19)
  505. #define PRC_ALARM_ACTION_RW_R2_STOP s2BIT(23)
  506. #define PRC_ALARM_ACTION_RR_R3_STOP s2BIT(27)
  507. #define PRC_ALARM_ACTION_RW_R3_STOP s2BIT(31)
  508. #define PRC_ALARM_ACTION_RR_R4_STOP s2BIT(35)
  509. #define PRC_ALARM_ACTION_RW_R4_STOP s2BIT(39)
  510. #define PRC_ALARM_ACTION_RR_R5_STOP s2BIT(43)
  511. #define PRC_ALARM_ACTION_RW_R5_STOP s2BIT(47)
  512. #define PRC_ALARM_ACTION_RR_R6_STOP s2BIT(51)
  513. #define PRC_ALARM_ACTION_RW_R6_STOP s2BIT(55)
  514. #define PRC_ALARM_ACTION_RR_R7_STOP s2BIT(59)
  515. #define PRC_ALARM_ACTION_RW_R7_STOP s2BIT(63)
  516. /* Receive traffic interrupts */
  517. u64 rti_command_mem;
  518. #define RTI_CMD_MEM_WE s2BIT(7)
  519. #define RTI_CMD_MEM_STROBE s2BIT(15)
  520. #define RTI_CMD_MEM_STROBE_NEW_CMD s2BIT(15)
  521. #define RTI_CMD_MEM_STROBE_CMD_BEING_EXECUTED s2BIT(15)
  522. #define RTI_CMD_MEM_OFFSET(n) vBIT(n,29,3)
  523. u64 rti_data1_mem;
  524. #define RTI_DATA1_MEM_RX_TIMER_VAL(n) vBIT(n,3,29)
  525. #define RTI_DATA1_MEM_RX_TIMER_AC_EN s2BIT(38)
  526. #define RTI_DATA1_MEM_RX_TIMER_CI_EN s2BIT(39)
  527. #define RTI_DATA1_MEM_RX_URNG_A(n) vBIT(n,41,7)
  528. #define RTI_DATA1_MEM_RX_URNG_B(n) vBIT(n,49,7)
  529. #define RTI_DATA1_MEM_RX_URNG_C(n) vBIT(n,57,7)
  530. u64 rti_data2_mem;
  531. #define RTI_DATA2_MEM_RX_UFC_A(n) vBIT(n,0,16)
  532. #define RTI_DATA2_MEM_RX_UFC_B(n) vBIT(n,16,16)
  533. #define RTI_DATA2_MEM_RX_UFC_C(n) vBIT(n,32,16)
  534. #define RTI_DATA2_MEM_RX_UFC_D(n) vBIT(n,48,16)
  535. u64 rx_pa_cfg;
  536. #define RX_PA_CFG_IGNORE_FRM_ERR s2BIT(1)
  537. #define RX_PA_CFG_IGNORE_SNAP_OUI s2BIT(2)
  538. #define RX_PA_CFG_IGNORE_LLC_CTRL s2BIT(3)
  539. #define RX_PA_CFG_IGNORE_L2_ERR s2BIT(6)
  540. u64 unused_11_1;
  541. u64 ring_bump_counter1;
  542. u64 ring_bump_counter2;
  543. u8 unused12[0x700 - 0x1F0];
  544. u64 rxdma_debug_ctrl;
  545. u8 unused13[0x2000 - 0x1f08];
  546. /* Media Access Controller Register */
  547. u64 mac_int_status;
  548. u64 mac_int_mask;
  549. #define MAC_INT_STATUS_TMAC_INT s2BIT(0)
  550. #define MAC_INT_STATUS_RMAC_INT s2BIT(1)
  551. u64 mac_tmac_err_reg;
  552. #define TMAC_ECC_SG_ERR s2BIT(7)
  553. #define TMAC_ECC_DB_ERR s2BIT(15)
  554. #define TMAC_TX_BUF_OVRN s2BIT(23)
  555. #define TMAC_TX_CRI_ERR s2BIT(31)
  556. #define TMAC_TX_SM_ERR s2BIT(39)
  557. #define TMAC_DESC_ECC_SG_ERR s2BIT(47)
  558. #define TMAC_DESC_ECC_DB_ERR s2BIT(55)
  559. u64 mac_tmac_err_mask;
  560. u64 mac_tmac_err_alarm;
  561. u64 mac_rmac_err_reg;
  562. #define RMAC_RX_BUFF_OVRN s2BIT(0)
  563. #define RMAC_FRM_RCVD_INT s2BIT(1)
  564. #define RMAC_UNUSED_INT s2BIT(2)
  565. #define RMAC_RTS_PNUM_ECC_SG_ERR s2BIT(5)
  566. #define RMAC_RTS_DS_ECC_SG_ERR s2BIT(6)
  567. #define RMAC_RD_BUF_ECC_SG_ERR s2BIT(7)
  568. #define RMAC_RTH_MAP_ECC_SG_ERR s2BIT(8)
  569. #define RMAC_RTH_SPDM_ECC_SG_ERR s2BIT(9)
  570. #define RMAC_RTS_VID_ECC_SG_ERR s2BIT(10)
  571. #define RMAC_DA_SHADOW_ECC_SG_ERR s2BIT(11)
  572. #define RMAC_RTS_PNUM_ECC_DB_ERR s2BIT(13)
  573. #define RMAC_RTS_DS_ECC_DB_ERR s2BIT(14)
  574. #define RMAC_RD_BUF_ECC_DB_ERR s2BIT(15)
  575. #define RMAC_RTH_MAP_ECC_DB_ERR s2BIT(16)
  576. #define RMAC_RTH_SPDM_ECC_DB_ERR s2BIT(17)
  577. #define RMAC_RTS_VID_ECC_DB_ERR s2BIT(18)
  578. #define RMAC_DA_SHADOW_ECC_DB_ERR s2BIT(19)
  579. #define RMAC_LINK_STATE_CHANGE_INT s2BIT(31)
  580. #define RMAC_RX_SM_ERR s2BIT(39)
  581. #define RMAC_SINGLE_ECC_ERR (s2BIT(5) | s2BIT(6) | s2BIT(7) |\
  582. s2BIT(8) | s2BIT(9) | s2BIT(10)|\
  583. s2BIT(11))
  584. #define RMAC_DOUBLE_ECC_ERR (s2BIT(13) | s2BIT(14) | s2BIT(15) |\
  585. s2BIT(16) | s2BIT(17) | s2BIT(18)|\
  586. s2BIT(19))
  587. u64 mac_rmac_err_mask;
  588. u64 mac_rmac_err_alarm;
  589. u8 unused14[0x100 - 0x40];
  590. u64 mac_cfg;
  591. #define MAC_CFG_TMAC_ENABLE s2BIT(0)
  592. #define MAC_CFG_RMAC_ENABLE s2BIT(1)
  593. #define MAC_CFG_LAN_NOT_WAN s2BIT(2)
  594. #define MAC_CFG_TMAC_LOOPBACK s2BIT(3)
  595. #define MAC_CFG_TMAC_APPEND_PAD s2BIT(4)
  596. #define MAC_CFG_RMAC_STRIP_FCS s2BIT(5)
  597. #define MAC_CFG_RMAC_STRIP_PAD s2BIT(6)
  598. #define MAC_CFG_RMAC_PROM_ENABLE s2BIT(7)
  599. #define MAC_RMAC_DISCARD_PFRM s2BIT(8)
  600. #define MAC_RMAC_BCAST_ENABLE s2BIT(9)
  601. #define MAC_RMAC_ALL_ADDR_ENABLE s2BIT(10)
  602. #define MAC_RMAC_INVLD_IPG_THR(val) vBIT(val,16,8)
  603. u64 tmac_avg_ipg;
  604. #define TMAC_AVG_IPG(val) vBIT(val,0,8)
  605. u64 rmac_max_pyld_len;
  606. #define RMAC_MAX_PYLD_LEN(val) vBIT(val,2,14)
  607. #define RMAC_MAX_PYLD_LEN_DEF vBIT(1500,2,14)
  608. #define RMAC_MAX_PYLD_LEN_JUMBO_DEF vBIT(9600,2,14)
  609. u64 rmac_err_cfg;
  610. #define RMAC_ERR_FCS s2BIT(0)
  611. #define RMAC_ERR_FCS_ACCEPT s2BIT(1)
  612. #define RMAC_ERR_TOO_LONG s2BIT(1)
  613. #define RMAC_ERR_TOO_LONG_ACCEPT s2BIT(1)
  614. #define RMAC_ERR_RUNT s2BIT(2)
  615. #define RMAC_ERR_RUNT_ACCEPT s2BIT(2)
  616. #define RMAC_ERR_LEN_MISMATCH s2BIT(3)
  617. #define RMAC_ERR_LEN_MISMATCH_ACCEPT s2BIT(3)
  618. u64 rmac_cfg_key;
  619. #define RMAC_CFG_KEY(val) vBIT(val,0,16)
  620. #define S2IO_MAC_ADDR_START_OFFSET 0
  621. #define S2IO_XENA_MAX_MC_ADDRESSES 64 /* multicast addresses */
  622. #define S2IO_HERC_MAX_MC_ADDRESSES 256
  623. #define S2IO_XENA_MAX_MAC_ADDRESSES 16
  624. #define S2IO_HERC_MAX_MAC_ADDRESSES 64
  625. #define S2IO_XENA_MC_ADDR_START_OFFSET 16
  626. #define S2IO_HERC_MC_ADDR_START_OFFSET 64
  627. u64 rmac_addr_cmd_mem;
  628. #define RMAC_ADDR_CMD_MEM_WE s2BIT(7)
  629. #define RMAC_ADDR_CMD_MEM_RD 0
  630. #define RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD s2BIT(15)
  631. #define RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING s2BIT(15)
  632. #define RMAC_ADDR_CMD_MEM_OFFSET(n) vBIT(n,26,6)
  633. u64 rmac_addr_data0_mem;
  634. #define RMAC_ADDR_DATA0_MEM_ADDR(n) vBIT(n,0,48)
  635. #define RMAC_ADDR_DATA0_MEM_USER s2BIT(48)
  636. u64 rmac_addr_data1_mem;
  637. #define RMAC_ADDR_DATA1_MEM_MASK(n) vBIT(n,0,48)
  638. u8 unused15[0x8];
  639. /*
  640. u64 rmac_addr_cfg;
  641. #define RMAC_ADDR_UCASTn_EN(n) mBIT(0)_n(n)
  642. #define RMAC_ADDR_MCASTn_EN(n) mBIT(0)_n(n)
  643. #define RMAC_ADDR_BCAST_EN vBIT(0)_48
  644. #define RMAC_ADDR_ALL_ADDR_EN vBIT(0)_49
  645. */
  646. u64 tmac_ipg_cfg;
  647. u64 rmac_pause_cfg;
  648. #define RMAC_PAUSE_GEN s2BIT(0)
  649. #define RMAC_PAUSE_GEN_ENABLE s2BIT(0)
  650. #define RMAC_PAUSE_RX s2BIT(1)
  651. #define RMAC_PAUSE_RX_ENABLE s2BIT(1)
  652. #define RMAC_PAUSE_HG_PTIME_DEF vBIT(0xFFFF,16,16)
  653. #define RMAC_PAUSE_HG_PTIME(val) vBIT(val,16,16)
  654. u64 rmac_red_cfg;
  655. u64 rmac_red_rate_q0q3;
  656. u64 rmac_red_rate_q4q7;
  657. u64 mac_link_util;
  658. #define MAC_TX_LINK_UTIL vBIT(0xFE,1,7)
  659. #define MAC_TX_LINK_UTIL_DISABLE vBIT(0xF, 8,4)
  660. #define MAC_TX_LINK_UTIL_VAL( n ) vBIT(n,8,4)
  661. #define MAC_RX_LINK_UTIL vBIT(0xFE,33,7)
  662. #define MAC_RX_LINK_UTIL_DISABLE vBIT(0xF,40,4)
  663. #define MAC_RX_LINK_UTIL_VAL( n ) vBIT(n,40,4)
  664. #define MAC_LINK_UTIL_DISABLE MAC_TX_LINK_UTIL_DISABLE | \
  665. MAC_RX_LINK_UTIL_DISABLE
  666. u64 rmac_invalid_ipg;
  667. /* rx traffic steering */
  668. #define MAC_RTS_FRM_LEN_SET(len) vBIT(len,2,14)
  669. u64 rts_frm_len_n[8];
  670. u64 rts_qos_steering;
  671. #define MAX_DIX_MAP 4
  672. u64 rts_dix_map_n[MAX_DIX_MAP];
  673. #define RTS_DIX_MAP_ETYPE(val) vBIT(val,0,16)
  674. #define RTS_DIX_MAP_SCW(val) s2BIT(val,21)
  675. u64 rts_q_alternates;
  676. u64 rts_default_q;
  677. u64 rts_ctrl;
  678. #define RTS_CTRL_IGNORE_SNAP_OUI s2BIT(2)
  679. #define RTS_CTRL_IGNORE_LLC_CTRL s2BIT(3)
  680. u64 rts_pn_cam_ctrl;
  681. #define RTS_PN_CAM_CTRL_WE s2BIT(7)
  682. #define RTS_PN_CAM_CTRL_STROBE_NEW_CMD s2BIT(15)
  683. #define RTS_PN_CAM_CTRL_STROBE_BEING_EXECUTED s2BIT(15)
  684. #define RTS_PN_CAM_CTRL_OFFSET(n) vBIT(n,24,8)
  685. u64 rts_pn_cam_data;
  686. #define RTS_PN_CAM_DATA_TCP_SELECT s2BIT(7)
  687. #define RTS_PN_CAM_DATA_PORT(val) vBIT(val,8,16)
  688. #define RTS_PN_CAM_DATA_SCW(val) vBIT(val,24,8)
  689. u64 rts_ds_mem_ctrl;
  690. #define RTS_DS_MEM_CTRL_WE s2BIT(7)
  691. #define RTS_DS_MEM_CTRL_STROBE_NEW_CMD s2BIT(15)
  692. #define RTS_DS_MEM_CTRL_STROBE_CMD_BEING_EXECUTED s2BIT(15)
  693. #define RTS_DS_MEM_CTRL_OFFSET(n) vBIT(n,26,6)
  694. u64 rts_ds_mem_data;
  695. #define RTS_DS_MEM_DATA(n) vBIT(n,0,8)
  696. u8 unused16[0x700 - 0x220];
  697. u64 mac_debug_ctrl;
  698. #define MAC_DBG_ACTIVITY_VALUE 0x411040400000000ULL
  699. u8 unused17[0x2800 - 0x2708];
  700. /* memory controller registers */
  701. u64 mc_int_status;
  702. #define MC_INT_STATUS_MC_INT s2BIT(0)
  703. u64 mc_int_mask;
  704. #define MC_INT_MASK_MC_INT s2BIT(0)
  705. u64 mc_err_reg;
  706. #define MC_ERR_REG_ECC_DB_ERR_L s2BIT(14)
  707. #define MC_ERR_REG_ECC_DB_ERR_U s2BIT(15)
  708. #define MC_ERR_REG_MIRI_ECC_DB_ERR_0 s2BIT(18)
  709. #define MC_ERR_REG_MIRI_ECC_DB_ERR_1 s2BIT(20)
  710. #define MC_ERR_REG_MIRI_CRI_ERR_0 s2BIT(22)
  711. #define MC_ERR_REG_MIRI_CRI_ERR_1 s2BIT(23)
  712. #define MC_ERR_REG_SM_ERR s2BIT(31)
  713. #define MC_ERR_REG_ECC_ALL_SNG (s2BIT(2) | s2BIT(3) | s2BIT(4) | s2BIT(5) |\
  714. s2BIT(17) | s2BIT(19))
  715. #define MC_ERR_REG_ECC_ALL_DBL (s2BIT(10) | s2BIT(11) | s2BIT(12) |\
  716. s2BIT(13) | s2BIT(18) | s2BIT(20))
  717. #define PLL_LOCK_N s2BIT(39)
  718. u64 mc_err_mask;
  719. u64 mc_err_alarm;
  720. u8 unused18[0x100 - 0x28];
  721. /* MC configuration */
  722. u64 rx_queue_cfg;
  723. #define RX_QUEUE_CFG_Q0_SZ(n) vBIT(n,0,8)
  724. #define RX_QUEUE_CFG_Q1_SZ(n) vBIT(n,8,8)
  725. #define RX_QUEUE_CFG_Q2_SZ(n) vBIT(n,16,8)
  726. #define RX_QUEUE_CFG_Q3_SZ(n) vBIT(n,24,8)
  727. #define RX_QUEUE_CFG_Q4_SZ(n) vBIT(n,32,8)
  728. #define RX_QUEUE_CFG_Q5_SZ(n) vBIT(n,40,8)
  729. #define RX_QUEUE_CFG_Q6_SZ(n) vBIT(n,48,8)
  730. #define RX_QUEUE_CFG_Q7_SZ(n) vBIT(n,56,8)
  731. u64 mc_rldram_mrs;
  732. #define MC_RLDRAM_QUEUE_SIZE_ENABLE s2BIT(39)
  733. #define MC_RLDRAM_MRS_ENABLE s2BIT(47)
  734. u64 mc_rldram_interleave;
  735. u64 mc_pause_thresh_q0q3;
  736. u64 mc_pause_thresh_q4q7;
  737. u64 mc_red_thresh_q[8];
  738. u8 unused19[0x200 - 0x168];
  739. u64 mc_rldram_ref_per;
  740. u8 unused20[0x220 - 0x208];
  741. u64 mc_rldram_test_ctrl;
  742. #define MC_RLDRAM_TEST_MODE s2BIT(47)
  743. #define MC_RLDRAM_TEST_WRITE s2BIT(7)
  744. #define MC_RLDRAM_TEST_GO s2BIT(15)
  745. #define MC_RLDRAM_TEST_DONE s2BIT(23)
  746. #define MC_RLDRAM_TEST_PASS s2BIT(31)
  747. u8 unused21[0x240 - 0x228];
  748. u64 mc_rldram_test_add;
  749. u8 unused22[0x260 - 0x248];
  750. u64 mc_rldram_test_d0;
  751. u8 unused23[0x280 - 0x268];
  752. u64 mc_rldram_test_d1;
  753. u8 unused24[0x300 - 0x288];
  754. u64 mc_rldram_test_d2;
  755. u8 unused24_1[0x360 - 0x308];
  756. u64 mc_rldram_ctrl;
  757. #define MC_RLDRAM_ENABLE_ODT s2BIT(7)
  758. u8 unused24_2[0x640 - 0x368];
  759. u64 mc_rldram_ref_per_herc;
  760. #define MC_RLDRAM_SET_REF_PERIOD(val) vBIT(val, 0, 16)
  761. u8 unused24_3[0x660 - 0x648];
  762. u64 mc_rldram_mrs_herc;
  763. u8 unused25[0x700 - 0x668];
  764. u64 mc_debug_ctrl;
  765. u8 unused26[0x3000 - 0x2f08];
  766. /* XGXG */
  767. /* XGXS control registers */
  768. u64 xgxs_int_status;
  769. #define XGXS_INT_STATUS_TXGXS s2BIT(0)
  770. #define XGXS_INT_STATUS_RXGXS s2BIT(1)
  771. u64 xgxs_int_mask;
  772. #define XGXS_INT_MASK_TXGXS s2BIT(0)
  773. #define XGXS_INT_MASK_RXGXS s2BIT(1)
  774. u64 xgxs_txgxs_err_reg;
  775. #define TXGXS_ECC_SG_ERR s2BIT(7)
  776. #define TXGXS_ECC_DB_ERR s2BIT(15)
  777. #define TXGXS_ESTORE_UFLOW s2BIT(31)
  778. #define TXGXS_TX_SM_ERR s2BIT(39)
  779. u64 xgxs_txgxs_err_mask;
  780. u64 xgxs_txgxs_err_alarm;
  781. u64 xgxs_rxgxs_err_reg;
  782. #define RXGXS_ESTORE_OFLOW s2BIT(7)
  783. #define RXGXS_RX_SM_ERR s2BIT(39)
  784. u64 xgxs_rxgxs_err_mask;
  785. u64 xgxs_rxgxs_err_alarm;
  786. u8 unused27[0x100 - 0x40];
  787. u64 xgxs_cfg;
  788. u64 xgxs_status;
  789. u64 xgxs_cfg_key;
  790. u64 xgxs_efifo_cfg; /* CHANGED */
  791. u64 rxgxs_ber_0; /* CHANGED */
  792. u64 rxgxs_ber_1; /* CHANGED */
  793. u64 spi_control;
  794. #define SPI_CONTROL_KEY(key) vBIT(key,0,4)
  795. #define SPI_CONTROL_BYTECNT(cnt) vBIT(cnt,29,3)
  796. #define SPI_CONTROL_CMD(cmd) vBIT(cmd,32,8)
  797. #define SPI_CONTROL_ADDR(addr) vBIT(addr,40,24)
  798. #define SPI_CONTROL_SEL1 s2BIT(4)
  799. #define SPI_CONTROL_REQ s2BIT(7)
  800. #define SPI_CONTROL_NACK s2BIT(5)
  801. #define SPI_CONTROL_DONE s2BIT(6)
  802. u64 spi_data;
  803. #define SPI_DATA_WRITE(data,len) vBIT(data,0,len)
  804. };
  805. #define XENA_REG_SPACE sizeof(struct XENA_dev_config)
  806. #define XENA_EEPROM_SPACE (0x01 << 11)
  807. #endif /* _REGS_H */