ef10_regs.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. /****************************************************************************
  2. * Driver for Solarflare network controllers and boards
  3. * Copyright 2012-2013 Solarflare Communications Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published
  7. * by the Free Software Foundation, incorporated herein by reference.
  8. */
  9. #ifndef EFX_EF10_REGS_H
  10. #define EFX_EF10_REGS_H
  11. /* EF10 hardware architecture definitions have a name prefix following
  12. * the format:
  13. *
  14. * E<type>_<min-rev><max-rev>_
  15. *
  16. * The following <type> strings are used:
  17. *
  18. * MMIO register Host memory structure
  19. * -------------------------------------------------------------
  20. * Address R
  21. * Bitfield RF SF
  22. * Enumerator FE SE
  23. *
  24. * <min-rev> is the first revision to which the definition applies:
  25. *
  26. * D: Huntington A0
  27. *
  28. * If the definition has been changed or removed in later revisions
  29. * then <max-rev> is the last revision to which the definition applies;
  30. * otherwise it is "Z".
  31. */
  32. /**************************************************************************
  33. *
  34. * EF10 registers and descriptors
  35. *
  36. **************************************************************************
  37. */
  38. /* BIU_HW_REV_ID_REG: */
  39. #define ER_DZ_BIU_HW_REV_ID 0x00000000
  40. #define ERF_DZ_HW_REV_ID_LBN 0
  41. #define ERF_DZ_HW_REV_ID_WIDTH 32
  42. /* BIU_MC_SFT_STATUS_REG: */
  43. #define ER_DZ_BIU_MC_SFT_STATUS 0x00000010
  44. #define ER_DZ_BIU_MC_SFT_STATUS_STEP 4
  45. #define ER_DZ_BIU_MC_SFT_STATUS_ROWS 8
  46. #define ERF_DZ_MC_SFT_STATUS_LBN 0
  47. #define ERF_DZ_MC_SFT_STATUS_WIDTH 32
  48. /* BIU_INT_ISR_REG: */
  49. #define ER_DZ_BIU_INT_ISR 0x00000090
  50. #define ERF_DZ_ISR_REG_LBN 0
  51. #define ERF_DZ_ISR_REG_WIDTH 32
  52. /* MC_DB_LWRD_REG: */
  53. #define ER_DZ_MC_DB_LWRD 0x00000200
  54. #define ERF_DZ_MC_DOORBELL_L_LBN 0
  55. #define ERF_DZ_MC_DOORBELL_L_WIDTH 32
  56. /* MC_DB_HWRD_REG: */
  57. #define ER_DZ_MC_DB_HWRD 0x00000204
  58. #define ERF_DZ_MC_DOORBELL_H_LBN 0
  59. #define ERF_DZ_MC_DOORBELL_H_WIDTH 32
  60. /* EVQ_RPTR_REG: */
  61. #define ER_DZ_EVQ_RPTR 0x00000400
  62. #define ER_DZ_EVQ_RPTR_STEP 8192
  63. #define ER_DZ_EVQ_RPTR_ROWS 2048
  64. #define ERF_DZ_EVQ_RPTR_VLD_LBN 15
  65. #define ERF_DZ_EVQ_RPTR_VLD_WIDTH 1
  66. #define ERF_DZ_EVQ_RPTR_LBN 0
  67. #define ERF_DZ_EVQ_RPTR_WIDTH 15
  68. /* EVQ_TMR_REG: */
  69. #define ER_DZ_EVQ_TMR 0x00000420
  70. #define ER_DZ_EVQ_TMR_STEP 8192
  71. #define ER_DZ_EVQ_TMR_ROWS 2048
  72. #define ERF_DZ_TC_TIMER_MODE_LBN 14
  73. #define ERF_DZ_TC_TIMER_MODE_WIDTH 2
  74. #define ERF_DZ_TC_TIMER_VAL_LBN 0
  75. #define ERF_DZ_TC_TIMER_VAL_WIDTH 14
  76. /* RX_DESC_UPD_REG: */
  77. #define ER_DZ_RX_DESC_UPD 0x00000830
  78. #define ER_DZ_RX_DESC_UPD_STEP 8192
  79. #define ER_DZ_RX_DESC_UPD_ROWS 2048
  80. #define ERF_DZ_RX_DESC_WPTR_LBN 0
  81. #define ERF_DZ_RX_DESC_WPTR_WIDTH 12
  82. /* TX_DESC_UPD_REG: */
  83. #define ER_DZ_TX_DESC_UPD 0x00000a10
  84. #define ER_DZ_TX_DESC_UPD_STEP 8192
  85. #define ER_DZ_TX_DESC_UPD_ROWS 2048
  86. #define ERF_DZ_RSVD_LBN 76
  87. #define ERF_DZ_RSVD_WIDTH 20
  88. #define ERF_DZ_TX_DESC_WPTR_LBN 64
  89. #define ERF_DZ_TX_DESC_WPTR_WIDTH 12
  90. #define ERF_DZ_TX_DESC_HWORD_LBN 32
  91. #define ERF_DZ_TX_DESC_HWORD_WIDTH 32
  92. #define ERF_DZ_TX_DESC_LWORD_LBN 0
  93. #define ERF_DZ_TX_DESC_LWORD_WIDTH 32
  94. /* DRIVER_EV */
  95. #define ESF_DZ_DRV_CODE_LBN 60
  96. #define ESF_DZ_DRV_CODE_WIDTH 4
  97. #define ESF_DZ_DRV_SUB_CODE_LBN 56
  98. #define ESF_DZ_DRV_SUB_CODE_WIDTH 4
  99. #define ESE_DZ_DRV_TIMER_EV 3
  100. #define ESE_DZ_DRV_START_UP_EV 2
  101. #define ESE_DZ_DRV_WAKE_UP_EV 1
  102. #define ESF_DZ_DRV_SUB_DATA_LBN 0
  103. #define ESF_DZ_DRV_SUB_DATA_WIDTH 56
  104. #define ESF_DZ_DRV_EVQ_ID_LBN 0
  105. #define ESF_DZ_DRV_EVQ_ID_WIDTH 14
  106. #define ESF_DZ_DRV_TMR_ID_LBN 0
  107. #define ESF_DZ_DRV_TMR_ID_WIDTH 14
  108. /* EVENT_ENTRY */
  109. #define ESF_DZ_EV_CODE_LBN 60
  110. #define ESF_DZ_EV_CODE_WIDTH 4
  111. #define ESE_DZ_EV_CODE_MCDI_EV 12
  112. #define ESE_DZ_EV_CODE_DRIVER_EV 5
  113. #define ESE_DZ_EV_CODE_TX_EV 2
  114. #define ESE_DZ_EV_CODE_RX_EV 0
  115. #define ESE_DZ_OTHER other
  116. #define ESF_DZ_EV_DATA_LBN 0
  117. #define ESF_DZ_EV_DATA_WIDTH 60
  118. /* MC_EVENT */
  119. #define ESF_DZ_MC_CODE_LBN 60
  120. #define ESF_DZ_MC_CODE_WIDTH 4
  121. #define ESF_DZ_MC_OVERRIDE_HOLDOFF_LBN 59
  122. #define ESF_DZ_MC_OVERRIDE_HOLDOFF_WIDTH 1
  123. #define ESF_DZ_MC_DROP_EVENT_LBN 58
  124. #define ESF_DZ_MC_DROP_EVENT_WIDTH 1
  125. #define ESF_DZ_MC_SOFT_LBN 0
  126. #define ESF_DZ_MC_SOFT_WIDTH 58
  127. /* RX_EVENT */
  128. #define ESF_DZ_RX_CODE_LBN 60
  129. #define ESF_DZ_RX_CODE_WIDTH 4
  130. #define ESF_DZ_RX_OVERRIDE_HOLDOFF_LBN 59
  131. #define ESF_DZ_RX_OVERRIDE_HOLDOFF_WIDTH 1
  132. #define ESF_DZ_RX_DROP_EVENT_LBN 58
  133. #define ESF_DZ_RX_DROP_EVENT_WIDTH 1
  134. #define ESF_DZ_RX_EV_RSVD2_LBN 54
  135. #define ESF_DZ_RX_EV_RSVD2_WIDTH 4
  136. #define ESF_DZ_RX_EV_SOFT2_LBN 52
  137. #define ESF_DZ_RX_EV_SOFT2_WIDTH 2
  138. #define ESF_DZ_RX_DSC_PTR_LBITS_LBN 48
  139. #define ESF_DZ_RX_DSC_PTR_LBITS_WIDTH 4
  140. #define ESF_DZ_RX_L4_CLASS_LBN 45
  141. #define ESF_DZ_RX_L4_CLASS_WIDTH 3
  142. #define ESE_DZ_L4_CLASS_RSVD7 7
  143. #define ESE_DZ_L4_CLASS_RSVD6 6
  144. #define ESE_DZ_L4_CLASS_RSVD5 5
  145. #define ESE_DZ_L4_CLASS_RSVD4 4
  146. #define ESE_DZ_L4_CLASS_RSVD3 3
  147. #define ESE_DZ_L4_CLASS_UDP 2
  148. #define ESE_DZ_L4_CLASS_TCP 1
  149. #define ESE_DZ_L4_CLASS_UNKNOWN 0
  150. #define ESF_DZ_RX_L3_CLASS_LBN 42
  151. #define ESF_DZ_RX_L3_CLASS_WIDTH 3
  152. #define ESE_DZ_L3_CLASS_RSVD7 7
  153. #define ESE_DZ_L3_CLASS_IP6_FRAG 6
  154. #define ESE_DZ_L3_CLASS_ARP 5
  155. #define ESE_DZ_L3_CLASS_IP4_FRAG 4
  156. #define ESE_DZ_L3_CLASS_FCOE 3
  157. #define ESE_DZ_L3_CLASS_IP6 2
  158. #define ESE_DZ_L3_CLASS_IP4 1
  159. #define ESE_DZ_L3_CLASS_UNKNOWN 0
  160. #define ESF_DZ_RX_ETH_TAG_CLASS_LBN 39
  161. #define ESF_DZ_RX_ETH_TAG_CLASS_WIDTH 3
  162. #define ESE_DZ_ETH_TAG_CLASS_RSVD7 7
  163. #define ESE_DZ_ETH_TAG_CLASS_RSVD6 6
  164. #define ESE_DZ_ETH_TAG_CLASS_RSVD5 5
  165. #define ESE_DZ_ETH_TAG_CLASS_RSVD4 4
  166. #define ESE_DZ_ETH_TAG_CLASS_RSVD3 3
  167. #define ESE_DZ_ETH_TAG_CLASS_VLAN2 2
  168. #define ESE_DZ_ETH_TAG_CLASS_VLAN1 1
  169. #define ESE_DZ_ETH_TAG_CLASS_NONE 0
  170. #define ESF_DZ_RX_ETH_BASE_CLASS_LBN 36
  171. #define ESF_DZ_RX_ETH_BASE_CLASS_WIDTH 3
  172. #define ESE_DZ_ETH_BASE_CLASS_LLC_SNAP 2
  173. #define ESE_DZ_ETH_BASE_CLASS_LLC 1
  174. #define ESE_DZ_ETH_BASE_CLASS_ETH2 0
  175. #define ESF_DZ_RX_MAC_CLASS_LBN 35
  176. #define ESF_DZ_RX_MAC_CLASS_WIDTH 1
  177. #define ESE_DZ_MAC_CLASS_MCAST 1
  178. #define ESE_DZ_MAC_CLASS_UCAST 0
  179. #define ESF_DZ_RX_EV_SOFT1_LBN 32
  180. #define ESF_DZ_RX_EV_SOFT1_WIDTH 3
  181. #define ESF_DZ_RX_EV_RSVD1_LBN 31
  182. #define ESF_DZ_RX_EV_RSVD1_WIDTH 1
  183. #define ESF_DZ_RX_ABORT_LBN 30
  184. #define ESF_DZ_RX_ABORT_WIDTH 1
  185. #define ESF_DZ_RX_ECC_ERR_LBN 29
  186. #define ESF_DZ_RX_ECC_ERR_WIDTH 1
  187. #define ESF_DZ_RX_CRC1_ERR_LBN 28
  188. #define ESF_DZ_RX_CRC1_ERR_WIDTH 1
  189. #define ESF_DZ_RX_CRC0_ERR_LBN 27
  190. #define ESF_DZ_RX_CRC0_ERR_WIDTH 1
  191. #define ESF_DZ_RX_TCPUDP_CKSUM_ERR_LBN 26
  192. #define ESF_DZ_RX_TCPUDP_CKSUM_ERR_WIDTH 1
  193. #define ESF_DZ_RX_IPCKSUM_ERR_LBN 25
  194. #define ESF_DZ_RX_IPCKSUM_ERR_WIDTH 1
  195. #define ESF_DZ_RX_ECRC_ERR_LBN 24
  196. #define ESF_DZ_RX_ECRC_ERR_WIDTH 1
  197. #define ESF_DZ_RX_QLABEL_LBN 16
  198. #define ESF_DZ_RX_QLABEL_WIDTH 5
  199. #define ESF_DZ_RX_PARSE_INCOMPLETE_LBN 15
  200. #define ESF_DZ_RX_PARSE_INCOMPLETE_WIDTH 1
  201. #define ESF_DZ_RX_CONT_LBN 14
  202. #define ESF_DZ_RX_CONT_WIDTH 1
  203. #define ESF_DZ_RX_BYTES_LBN 0
  204. #define ESF_DZ_RX_BYTES_WIDTH 14
  205. /* RX_KER_DESC */
  206. #define ESF_DZ_RX_KER_RESERVED_LBN 62
  207. #define ESF_DZ_RX_KER_RESERVED_WIDTH 2
  208. #define ESF_DZ_RX_KER_BYTE_CNT_LBN 48
  209. #define ESF_DZ_RX_KER_BYTE_CNT_WIDTH 14
  210. #define ESF_DZ_RX_KER_BUF_ADDR_LBN 0
  211. #define ESF_DZ_RX_KER_BUF_ADDR_WIDTH 48
  212. /* TX_CSUM_TSTAMP_DESC */
  213. #define ESF_DZ_TX_DESC_IS_OPT_LBN 63
  214. #define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1
  215. #define ESF_DZ_TX_OPTION_TYPE_LBN 60
  216. #define ESF_DZ_TX_OPTION_TYPE_WIDTH 3
  217. #define ESE_DZ_TX_OPTION_DESC_TSO 7
  218. #define ESE_DZ_TX_OPTION_DESC_VLAN 6
  219. #define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0
  220. #define ESF_DZ_TX_TIMESTAMP_LBN 5
  221. #define ESF_DZ_TX_TIMESTAMP_WIDTH 1
  222. #define ESF_DZ_TX_OPTION_CRC_MODE_LBN 2
  223. #define ESF_DZ_TX_OPTION_CRC_MODE_WIDTH 3
  224. #define ESE_DZ_TX_OPTION_CRC_FCOIP_MPA 5
  225. #define ESE_DZ_TX_OPTION_CRC_FCOIP_FCOE 4
  226. #define ESE_DZ_TX_OPTION_CRC_ISCSI_HDR_AND_PYLD 3
  227. #define ESE_DZ_TX_OPTION_CRC_ISCSI_HDR 2
  228. #define ESE_DZ_TX_OPTION_CRC_FCOE 1
  229. #define ESE_DZ_TX_OPTION_CRC_OFF 0
  230. #define ESF_DZ_TX_OPTION_UDP_TCP_CSUM_LBN 1
  231. #define ESF_DZ_TX_OPTION_UDP_TCP_CSUM_WIDTH 1
  232. #define ESF_DZ_TX_OPTION_IP_CSUM_LBN 0
  233. #define ESF_DZ_TX_OPTION_IP_CSUM_WIDTH 1
  234. /* TX_EVENT */
  235. #define ESF_DZ_TX_CODE_LBN 60
  236. #define ESF_DZ_TX_CODE_WIDTH 4
  237. #define ESF_DZ_TX_OVERRIDE_HOLDOFF_LBN 59
  238. #define ESF_DZ_TX_OVERRIDE_HOLDOFF_WIDTH 1
  239. #define ESF_DZ_TX_DROP_EVENT_LBN 58
  240. #define ESF_DZ_TX_DROP_EVENT_WIDTH 1
  241. #define ESF_DZ_TX_EV_RSVD_LBN 48
  242. #define ESF_DZ_TX_EV_RSVD_WIDTH 10
  243. #define ESF_DZ_TX_SOFT2_LBN 32
  244. #define ESF_DZ_TX_SOFT2_WIDTH 16
  245. #define ESF_DZ_TX_CAN_MERGE_LBN 31
  246. #define ESF_DZ_TX_CAN_MERGE_WIDTH 1
  247. #define ESF_DZ_TX_SOFT1_LBN 24
  248. #define ESF_DZ_TX_SOFT1_WIDTH 7
  249. #define ESF_DZ_TX_QLABEL_LBN 16
  250. #define ESF_DZ_TX_QLABEL_WIDTH 5
  251. #define ESF_DZ_TX_DESCR_INDX_LBN 0
  252. #define ESF_DZ_TX_DESCR_INDX_WIDTH 16
  253. /* TX_KER_DESC */
  254. #define ESF_DZ_TX_KER_TYPE_LBN 63
  255. #define ESF_DZ_TX_KER_TYPE_WIDTH 1
  256. #define ESF_DZ_TX_KER_CONT_LBN 62
  257. #define ESF_DZ_TX_KER_CONT_WIDTH 1
  258. #define ESF_DZ_TX_KER_BYTE_CNT_LBN 48
  259. #define ESF_DZ_TX_KER_BYTE_CNT_WIDTH 14
  260. #define ESF_DZ_TX_KER_BUF_ADDR_LBN 0
  261. #define ESF_DZ_TX_KER_BUF_ADDR_WIDTH 48
  262. /* TX_PIO_DESC */
  263. #define ESF_DZ_TX_PIO_TYPE_LBN 63
  264. #define ESF_DZ_TX_PIO_TYPE_WIDTH 1
  265. #define ESF_DZ_TX_PIO_OPT_LBN 60
  266. #define ESF_DZ_TX_PIO_OPT_WIDTH 3
  267. #define ESE_DZ_TX_OPTION_DESC_PIO 1
  268. #define ESF_DZ_TX_PIO_CONT_LBN 59
  269. #define ESF_DZ_TX_PIO_CONT_WIDTH 1
  270. #define ESF_DZ_TX_PIO_BYTE_CNT_LBN 32
  271. #define ESF_DZ_TX_PIO_BYTE_CNT_WIDTH 12
  272. #define ESF_DZ_TX_PIO_BUF_ADDR_LBN 0
  273. #define ESF_DZ_TX_PIO_BUF_ADDR_WIDTH 12
  274. /* TX_TSO_DESC */
  275. #define ESF_DZ_TX_DESC_IS_OPT_LBN 63
  276. #define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1
  277. #define ESF_DZ_TX_OPTION_TYPE_LBN 60
  278. #define ESF_DZ_TX_OPTION_TYPE_WIDTH 3
  279. #define ESE_DZ_TX_OPTION_DESC_TSO 7
  280. #define ESE_DZ_TX_OPTION_DESC_VLAN 6
  281. #define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0
  282. #define ESF_DZ_TX_TSO_TCP_FLAGS_LBN 48
  283. #define ESF_DZ_TX_TSO_TCP_FLAGS_WIDTH 8
  284. #define ESF_DZ_TX_TSO_IP_ID_LBN 32
  285. #define ESF_DZ_TX_TSO_IP_ID_WIDTH 16
  286. #define ESF_DZ_TX_TSO_TCP_SEQNO_LBN 0
  287. #define ESF_DZ_TX_TSO_TCP_SEQNO_WIDTH 32
  288. /*************************************************************************/
  289. /* TX_DESC_UPD_REG: Transmit descriptor update register.
  290. * We may write just one dword of these registers.
  291. */
  292. #define ER_DZ_TX_DESC_UPD_DWORD (ER_DZ_TX_DESC_UPD + 2 * 4)
  293. #define ERF_DZ_TX_DESC_WPTR_DWORD_LBN (ERF_DZ_TX_DESC_WPTR_LBN - 2 * 32)
  294. #define ERF_DZ_TX_DESC_WPTR_DWORD_WIDTH ERF_DZ_TX_DESC_WPTR_WIDTH
  295. /* The workaround for bug 35388 requires multiplexing writes through
  296. * the TX_DESC_UPD_DWORD address.
  297. * TX_DESC_UPD: 0ppppppppppp (bit 11 lost)
  298. * EVQ_RPTR: 1000hhhhhhhh, 1001llllllll (split into high and low bits)
  299. * EVQ_TMR: 11mmvvvvvvvv (bits 8:13 of value lost)
  300. */
  301. #define ER_DD_EVQ_INDIRECT ER_DZ_TX_DESC_UPD_DWORD
  302. #define ERF_DD_EVQ_IND_RPTR_FLAGS_LBN 8
  303. #define ERF_DD_EVQ_IND_RPTR_FLAGS_WIDTH 4
  304. #define EFE_DD_EVQ_IND_RPTR_FLAGS_HIGH 8
  305. #define EFE_DD_EVQ_IND_RPTR_FLAGS_LOW 9
  306. #define ERF_DD_EVQ_IND_RPTR_LBN 0
  307. #define ERF_DD_EVQ_IND_RPTR_WIDTH 8
  308. #define ERF_DD_EVQ_IND_TIMER_FLAGS_LBN 10
  309. #define ERF_DD_EVQ_IND_TIMER_FLAGS_WIDTH 2
  310. #define EFE_DD_EVQ_IND_TIMER_FLAGS 3
  311. #define ERF_DD_EVQ_IND_TIMER_MODE_LBN 8
  312. #define ERF_DD_EVQ_IND_TIMER_MODE_WIDTH 2
  313. #define ERF_DD_EVQ_IND_TIMER_VAL_LBN 0
  314. #define ERF_DD_EVQ_IND_TIMER_VAL_WIDTH 8
  315. /* TX_PIOBUF
  316. * PIO buffer aperture (paged)
  317. */
  318. #define ER_DZ_TX_PIOBUF 4096
  319. #define ER_DZ_TX_PIOBUF_SIZE 2048
  320. /* RX packet prefix */
  321. #define ES_DZ_RX_PREFIX_HASH_OFST 0
  322. #define ES_DZ_RX_PREFIX_VLAN1_OFST 4
  323. #define ES_DZ_RX_PREFIX_VLAN2_OFST 6
  324. #define ES_DZ_RX_PREFIX_PKTLEN_OFST 8
  325. #define ES_DZ_RX_PREFIX_TSTAMP_OFST 10
  326. #define ES_DZ_RX_PREFIX_SIZE 14
  327. #endif /* EFX_EF10_REGS_H */