/drivers/net/ethernet/broadcom/tg3.h

http://github.com/mirrors/linux · C Header · 3449 lines · 2947 code · 256 blank · 246 comment · 47 complexity · f204653c23c1fa04b519a2c819e16e2a MD5 · raw file

Large files are truncated click here to view the full file

  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* $Id: tg3.h,v 1.37.2.32 2002/03/11 12:18:18 davem Exp $
  3. * tg3.h: Definitions for Broadcom Tigon3 ethernet driver.
  4. *
  5. * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com)
  6. * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com)
  7. * Copyright (C) 2004 Sun Microsystems Inc.
  8. * Copyright (C) 2007-2016 Broadcom Corporation.
  9. * Copyright (C) 2016-2017 Broadcom Limited.
  10. * Copyright (C) 2018 Broadcom. All Rights Reserved. The term "Broadcom"
  11. * refers to Broadcom Inc. and/or its subsidiaries.
  12. */
  13. #ifndef _T3_H
  14. #define _T3_H
  15. #define TG3_64BIT_REG_HIGH 0x00UL
  16. #define TG3_64BIT_REG_LOW 0x04UL
  17. /* Descriptor block info. */
  18. #define TG3_BDINFO_HOST_ADDR 0x0UL /* 64-bit */
  19. #define TG3_BDINFO_MAXLEN_FLAGS 0x8UL /* 32-bit */
  20. #define BDINFO_FLAGS_USE_EXT_RECV 0x00000001 /* ext rx_buffer_desc */
  21. #define BDINFO_FLAGS_DISABLED 0x00000002
  22. #define BDINFO_FLAGS_MAXLEN_MASK 0xffff0000
  23. #define BDINFO_FLAGS_MAXLEN_SHIFT 16
  24. #define TG3_BDINFO_NIC_ADDR 0xcUL /* 32-bit */
  25. #define TG3_BDINFO_SIZE 0x10UL
  26. #define TG3_RX_STD_MAX_SIZE_5700 512
  27. #define TG3_RX_STD_MAX_SIZE_5717 2048
  28. #define TG3_RX_JMB_MAX_SIZE_5700 256
  29. #define TG3_RX_JMB_MAX_SIZE_5717 1024
  30. #define TG3_RX_RET_MAX_SIZE_5700 1024
  31. #define TG3_RX_RET_MAX_SIZE_5705 512
  32. #define TG3_RX_RET_MAX_SIZE_5717 4096
  33. #define TG3_RSS_INDIR_TBL_SIZE 128
  34. /* First 256 bytes are a mirror of PCI config space. */
  35. #define TG3PCI_VENDOR 0x00000000
  36. #define TG3PCI_VENDOR_BROADCOM 0x14e4
  37. #define TG3PCI_DEVICE 0x00000002
  38. #define TG3PCI_DEVICE_TIGON3_1 0x1644 /* BCM5700 */
  39. #define TG3PCI_DEVICE_TIGON3_2 0x1645 /* BCM5701 */
  40. #define TG3PCI_DEVICE_TIGON3_3 0x1646 /* BCM5702 */
  41. #define TG3PCI_DEVICE_TIGON3_4 0x1647 /* BCM5703 */
  42. #define TG3PCI_DEVICE_TIGON3_5761S 0x1688
  43. #define TG3PCI_DEVICE_TIGON3_5761SE 0x1689
  44. #define TG3PCI_DEVICE_TIGON3_57780 0x1692
  45. #define TG3PCI_DEVICE_TIGON3_5787M 0x1693
  46. #define TG3PCI_DEVICE_TIGON3_57760 0x1690
  47. #define TG3PCI_DEVICE_TIGON3_57790 0x1694
  48. #define TG3PCI_DEVICE_TIGON3_57788 0x1691
  49. #define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */
  50. #define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */
  51. #define TG3PCI_DEVICE_TIGON3_5717 0x1655
  52. #define TG3PCI_DEVICE_TIGON3_5717_C 0x1665
  53. #define TG3PCI_DEVICE_TIGON3_5718 0x1656
  54. #define TG3PCI_DEVICE_TIGON3_57781 0x16b1
  55. #define TG3PCI_DEVICE_TIGON3_57785 0x16b5
  56. #define TG3PCI_DEVICE_TIGON3_57761 0x16b0
  57. #define TG3PCI_DEVICE_TIGON3_57765 0x16b4
  58. #define TG3PCI_DEVICE_TIGON3_57791 0x16b2
  59. #define TG3PCI_DEVICE_TIGON3_57795 0x16b6
  60. #define TG3PCI_DEVICE_TIGON3_5719 0x1657
  61. #define TG3PCI_DEVICE_TIGON3_5720 0x165f
  62. #define TG3PCI_DEVICE_TIGON3_57762 0x1682
  63. #define TG3PCI_DEVICE_TIGON3_57766 0x1686
  64. #define TG3PCI_DEVICE_TIGON3_57786 0x16b3
  65. #define TG3PCI_DEVICE_TIGON3_57782 0x16b7
  66. #define TG3PCI_DEVICE_TIGON3_5762 0x1687
  67. #define TG3PCI_DEVICE_TIGON3_5725 0x1643
  68. #define TG3PCI_DEVICE_TIGON3_5727 0x16f3
  69. #define TG3PCI_DEVICE_TIGON3_57764 0x1642
  70. #define TG3PCI_DEVICE_TIGON3_57767 0x1683
  71. #define TG3PCI_DEVICE_TIGON3_57787 0x1641
  72. /* 0x04 --> 0x2c unused */
  73. #define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM
  74. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644
  75. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A5 0x0001
  76. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95700T6 0x0002
  77. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A9 0x0003
  78. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95701T1 0x0005
  79. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95701T8 0x0006
  80. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A7 0x0007
  81. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A10 0x0008
  82. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95701A12 0x8008
  83. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX1 0x0009
  84. #define TG3PCI_SUBDEVICE_ID_BROADCOM_95703AX2 0x8009
  85. #define TG3PCI_SUBVENDOR_ID_3COM PCI_VENDOR_ID_3COM
  86. #define TG3PCI_SUBDEVICE_ID_3COM_3C996T 0x1000
  87. #define TG3PCI_SUBDEVICE_ID_3COM_3C996BT 0x1006
  88. #define TG3PCI_SUBDEVICE_ID_3COM_3C996SX 0x1004
  89. #define TG3PCI_SUBDEVICE_ID_3COM_3C1000T 0x1007
  90. #define TG3PCI_SUBDEVICE_ID_3COM_3C940BR01 0x1008
  91. #define TG3PCI_SUBVENDOR_ID_DELL PCI_VENDOR_ID_DELL
  92. #define TG3PCI_SUBDEVICE_ID_DELL_VIPER 0x00d1
  93. #define TG3PCI_SUBDEVICE_ID_DELL_JAGUAR 0x0106
  94. #define TG3PCI_SUBDEVICE_ID_DELL_MERLOT 0x0109
  95. #define TG3PCI_SUBDEVICE_ID_DELL_SLIM_MERLOT 0x010a
  96. #define TG3PCI_SUBDEVICE_ID_DELL_5762 0x07f0
  97. #define TG3PCI_SUBVENDOR_ID_COMPAQ PCI_VENDOR_ID_COMPAQ
  98. #define TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE 0x007c
  99. #define TG3PCI_SUBDEVICE_ID_COMPAQ_BANSHEE_2 0x009a
  100. #define TG3PCI_SUBDEVICE_ID_COMPAQ_CHANGELING 0x007d
  101. #define TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780 0x0085
  102. #define TG3PCI_SUBDEVICE_ID_COMPAQ_NC7780_2 0x0099
  103. #define TG3PCI_SUBVENDOR_ID_IBM PCI_VENDOR_ID_IBM
  104. #define TG3PCI_SUBDEVICE_ID_IBM_5703SAX2 0x0281
  105. #define TG3PCI_SUBDEVICE_ID_ACER_57780_A 0x0601
  106. #define TG3PCI_SUBDEVICE_ID_ACER_57780_B 0x0612
  107. #define TG3PCI_SUBDEVICE_ID_LENOVO_5787M 0x3056
  108. /* 0x30 --> 0x64 unused */
  109. #define TG3PCI_MSI_DATA 0x00000064
  110. /* 0x66 --> 0x68 unused */
  111. #define TG3PCI_MISC_HOST_CTRL 0x00000068
  112. #define MISC_HOST_CTRL_CLEAR_INT 0x00000001
  113. #define MISC_HOST_CTRL_MASK_PCI_INT 0x00000002
  114. #define MISC_HOST_CTRL_BYTE_SWAP 0x00000004
  115. #define MISC_HOST_CTRL_WORD_SWAP 0x00000008
  116. #define MISC_HOST_CTRL_PCISTATE_RW 0x00000010
  117. #define MISC_HOST_CTRL_CLKREG_RW 0x00000020
  118. #define MISC_HOST_CTRL_REGWORD_SWAP 0x00000040
  119. #define MISC_HOST_CTRL_INDIR_ACCESS 0x00000080
  120. #define MISC_HOST_CTRL_IRQ_MASK_MODE 0x00000100
  121. #define MISC_HOST_CTRL_TAGGED_STATUS 0x00000200
  122. #define MISC_HOST_CTRL_CHIPREV 0xffff0000
  123. #define MISC_HOST_CTRL_CHIPREV_SHIFT 16
  124. #define CHIPREV_ID_5700_A0 0x7000
  125. #define CHIPREV_ID_5700_A1 0x7001
  126. #define CHIPREV_ID_5700_B0 0x7100
  127. #define CHIPREV_ID_5700_B1 0x7101
  128. #define CHIPREV_ID_5700_B3 0x7102
  129. #define CHIPREV_ID_5700_ALTIMA 0x7104
  130. #define CHIPREV_ID_5700_C0 0x7200
  131. #define CHIPREV_ID_5701_A0 0x0000
  132. #define CHIPREV_ID_5701_B0 0x0100
  133. #define CHIPREV_ID_5701_B2 0x0102
  134. #define CHIPREV_ID_5701_B5 0x0105
  135. #define CHIPREV_ID_5703_A0 0x1000
  136. #define CHIPREV_ID_5703_A1 0x1001
  137. #define CHIPREV_ID_5703_A2 0x1002
  138. #define CHIPREV_ID_5703_A3 0x1003
  139. #define CHIPREV_ID_5704_A0 0x2000
  140. #define CHIPREV_ID_5704_A1 0x2001
  141. #define CHIPREV_ID_5704_A2 0x2002
  142. #define CHIPREV_ID_5704_A3 0x2003
  143. #define CHIPREV_ID_5705_A0 0x3000
  144. #define CHIPREV_ID_5705_A1 0x3001
  145. #define CHIPREV_ID_5705_A2 0x3002
  146. #define CHIPREV_ID_5705_A3 0x3003
  147. #define CHIPREV_ID_5750_A0 0x4000
  148. #define CHIPREV_ID_5750_A1 0x4001
  149. #define CHIPREV_ID_5750_A3 0x4003
  150. #define CHIPREV_ID_5750_C2 0x4202
  151. #define CHIPREV_ID_5752_A0_HW 0x5000
  152. #define CHIPREV_ID_5752_A0 0x6000
  153. #define CHIPREV_ID_5752_A1 0x6001
  154. #define CHIPREV_ID_5714_A2 0x9002
  155. #define CHIPREV_ID_5906_A1 0xc001
  156. #define CHIPREV_ID_57780_A0 0x57780000
  157. #define CHIPREV_ID_57780_A1 0x57780001
  158. #define CHIPREV_ID_5717_A0 0x05717000
  159. #define CHIPREV_ID_5717_C0 0x05717200
  160. #define CHIPREV_ID_57765_A0 0x57785000
  161. #define CHIPREV_ID_5719_A0 0x05719000
  162. #define CHIPREV_ID_5720_A0 0x05720000
  163. #define CHIPREV_ID_5762_A0 0x05762000
  164. #define ASIC_REV_5700 0x07
  165. #define ASIC_REV_5701 0x00
  166. #define ASIC_REV_5703 0x01
  167. #define ASIC_REV_5704 0x02
  168. #define ASIC_REV_5705 0x03
  169. #define ASIC_REV_5750 0x04
  170. #define ASIC_REV_5752 0x06
  171. #define ASIC_REV_5780 0x08
  172. #define ASIC_REV_5714 0x09
  173. #define ASIC_REV_5755 0x0a
  174. #define ASIC_REV_5787 0x0b
  175. #define ASIC_REV_5906 0x0c
  176. #define ASIC_REV_USE_PROD_ID_REG 0x0f
  177. #define ASIC_REV_5784 0x5784
  178. #define ASIC_REV_5761 0x5761
  179. #define ASIC_REV_5785 0x5785
  180. #define ASIC_REV_57780 0x57780
  181. #define ASIC_REV_5717 0x5717
  182. #define ASIC_REV_57765 0x57785
  183. #define ASIC_REV_5719 0x5719
  184. #define ASIC_REV_5720 0x5720
  185. #define ASIC_REV_57766 0x57766
  186. #define ASIC_REV_5762 0x5762
  187. #define CHIPREV_5700_AX 0x70
  188. #define CHIPREV_5700_BX 0x71
  189. #define CHIPREV_5700_CX 0x72
  190. #define CHIPREV_5701_AX 0x00
  191. #define CHIPREV_5703_AX 0x10
  192. #define CHIPREV_5704_AX 0x20
  193. #define CHIPREV_5704_BX 0x21
  194. #define CHIPREV_5750_AX 0x40
  195. #define CHIPREV_5750_BX 0x41
  196. #define CHIPREV_5784_AX 0x57840
  197. #define CHIPREV_5761_AX 0x57610
  198. #define CHIPREV_57765_AX 0x577650
  199. #define METAL_REV_A0 0x00
  200. #define METAL_REV_A1 0x01
  201. #define METAL_REV_B0 0x00
  202. #define METAL_REV_B1 0x01
  203. #define METAL_REV_B2 0x02
  204. #define TG3PCI_DMA_RW_CTRL 0x0000006c
  205. #define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001
  206. #define DMA_RWCTRL_TAGGED_STAT_WA 0x00000080
  207. #define DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK 0x00000380
  208. #define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700
  209. #define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000
  210. #define DMA_RWCTRL_READ_BNDRY_16 0x00000100
  211. #define DMA_RWCTRL_READ_BNDRY_128_PCIX 0x00000100
  212. #define DMA_RWCTRL_READ_BNDRY_32 0x00000200
  213. #define DMA_RWCTRL_READ_BNDRY_256_PCIX 0x00000200
  214. #define DMA_RWCTRL_READ_BNDRY_64 0x00000300
  215. #define DMA_RWCTRL_READ_BNDRY_384_PCIX 0x00000300
  216. #define DMA_RWCTRL_READ_BNDRY_128 0x00000400
  217. #define DMA_RWCTRL_READ_BNDRY_256 0x00000500
  218. #define DMA_RWCTRL_READ_BNDRY_512 0x00000600
  219. #define DMA_RWCTRL_READ_BNDRY_1024 0x00000700
  220. #define DMA_RWCTRL_WRITE_BNDRY_MASK 0x00003800
  221. #define DMA_RWCTRL_WRITE_BNDRY_DISAB 0x00000000
  222. #define DMA_RWCTRL_WRITE_BNDRY_16 0x00000800
  223. #define DMA_RWCTRL_WRITE_BNDRY_128_PCIX 0x00000800
  224. #define DMA_RWCTRL_WRITE_BNDRY_32 0x00001000
  225. #define DMA_RWCTRL_WRITE_BNDRY_256_PCIX 0x00001000
  226. #define DMA_RWCTRL_WRITE_BNDRY_64 0x00001800
  227. #define DMA_RWCTRL_WRITE_BNDRY_384_PCIX 0x00001800
  228. #define DMA_RWCTRL_WRITE_BNDRY_128 0x00002000
  229. #define DMA_RWCTRL_WRITE_BNDRY_256 0x00002800
  230. #define DMA_RWCTRL_WRITE_BNDRY_512 0x00003000
  231. #define DMA_RWCTRL_WRITE_BNDRY_1024 0x00003800
  232. #define DMA_RWCTRL_ONE_DMA 0x00004000
  233. #define DMA_RWCTRL_READ_WATER 0x00070000
  234. #define DMA_RWCTRL_READ_WATER_SHIFT 16
  235. #define DMA_RWCTRL_WRITE_WATER 0x00380000
  236. #define DMA_RWCTRL_WRITE_WATER_SHIFT 19
  237. #define DMA_RWCTRL_USE_MEM_READ_MULT 0x00400000
  238. #define DMA_RWCTRL_ASSERT_ALL_BE 0x00800000
  239. #define DMA_RWCTRL_PCI_READ_CMD 0x0f000000
  240. #define DMA_RWCTRL_PCI_READ_CMD_SHIFT 24
  241. #define DMA_RWCTRL_PCI_WRITE_CMD 0xf0000000
  242. #define DMA_RWCTRL_PCI_WRITE_CMD_SHIFT 28
  243. #define DMA_RWCTRL_WRITE_BNDRY_64_PCIE 0x10000000
  244. #define DMA_RWCTRL_WRITE_BNDRY_128_PCIE 0x30000000
  245. #define DMA_RWCTRL_WRITE_BNDRY_DISAB_PCIE 0x70000000
  246. #define TG3PCI_PCISTATE 0x00000070
  247. #define PCISTATE_FORCE_RESET 0x00000001
  248. #define PCISTATE_INT_NOT_ACTIVE 0x00000002
  249. #define PCISTATE_CONV_PCI_MODE 0x00000004
  250. #define PCISTATE_BUS_SPEED_HIGH 0x00000008
  251. #define PCISTATE_BUS_32BIT 0x00000010
  252. #define PCISTATE_ROM_ENABLE 0x00000020
  253. #define PCISTATE_ROM_RETRY_ENABLE 0x00000040
  254. #define PCISTATE_FLAT_VIEW 0x00000100
  255. #define PCISTATE_RETRY_SAME_DMA 0x00002000
  256. #define PCISTATE_ALLOW_APE_CTLSPC_WR 0x00010000
  257. #define PCISTATE_ALLOW_APE_SHMEM_WR 0x00020000
  258. #define PCISTATE_ALLOW_APE_PSPACE_WR 0x00040000
  259. #define TG3PCI_CLOCK_CTRL 0x00000074
  260. #define CLOCK_CTRL_CORECLK_DISABLE 0x00000200
  261. #define CLOCK_CTRL_RXCLK_DISABLE 0x00000400
  262. #define CLOCK_CTRL_TXCLK_DISABLE 0x00000800
  263. #define CLOCK_CTRL_ALTCLK 0x00001000
  264. #define CLOCK_CTRL_PWRDOWN_PLL133 0x00008000
  265. #define CLOCK_CTRL_44MHZ_CORE 0x00040000
  266. #define CLOCK_CTRL_625_CORE 0x00100000
  267. #define CLOCK_CTRL_FORCE_CLKRUN 0x00200000
  268. #define CLOCK_CTRL_CLKRUN_OENABLE 0x00400000
  269. #define CLOCK_CTRL_DELAY_PCI_GRANT 0x80000000
  270. #define TG3PCI_REG_BASE_ADDR 0x00000078
  271. #define TG3PCI_MEM_WIN_BASE_ADDR 0x0000007c
  272. #define TG3PCI_REG_DATA 0x00000080
  273. #define TG3PCI_MEM_WIN_DATA 0x00000084
  274. #define TG3PCI_MISC_LOCAL_CTRL 0x00000090
  275. /* 0x94 --> 0x98 unused */
  276. #define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */
  277. #define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */
  278. /* 0xa8 --> 0xb8 unused */
  279. #define TG3PCI_DEV_STATUS_CTRL 0x000000b4
  280. #define MAX_READ_REQ_SIZE_2048 0x00004000
  281. #define MAX_READ_REQ_MASK 0x00007000
  282. #define TG3PCI_DUAL_MAC_CTRL 0x000000b8
  283. #define DUAL_MAC_CTRL_CH_MASK 0x00000003
  284. #define DUAL_MAC_CTRL_ID 0x00000004
  285. #define TG3PCI_PRODID_ASICREV 0x000000bc
  286. #define PROD_ID_ASIC_REV_MASK 0x0fffffff
  287. /* 0xc0 --> 0xf4 unused */
  288. #define TG3PCI_GEN2_PRODID_ASICREV 0x000000f4
  289. #define TG3PCI_GEN15_PRODID_ASICREV 0x000000fc
  290. /* 0xf8 --> 0x200 unused */
  291. #define TG3_CORR_ERR_STAT 0x00000110
  292. #define TG3_CORR_ERR_STAT_CLEAR 0xffffffff
  293. /* 0x114 --> 0x200 unused */
  294. /* Mailbox registers */
  295. #define MAILBOX_INTERRUPT_0 0x00000200 /* 64-bit */
  296. #define MAILBOX_INTERRUPT_1 0x00000208 /* 64-bit */
  297. #define MAILBOX_INTERRUPT_2 0x00000210 /* 64-bit */
  298. #define MAILBOX_INTERRUPT_3 0x00000218 /* 64-bit */
  299. #define MAILBOX_GENERAL_0 0x00000220 /* 64-bit */
  300. #define MAILBOX_GENERAL_1 0x00000228 /* 64-bit */
  301. #define MAILBOX_GENERAL_2 0x00000230 /* 64-bit */
  302. #define MAILBOX_GENERAL_3 0x00000238 /* 64-bit */
  303. #define MAILBOX_GENERAL_4 0x00000240 /* 64-bit */
  304. #define MAILBOX_GENERAL_5 0x00000248 /* 64-bit */
  305. #define MAILBOX_GENERAL_6 0x00000250 /* 64-bit */
  306. #define MAILBOX_GENERAL_7 0x00000258 /* 64-bit */
  307. #define MAILBOX_RELOAD_STAT 0x00000260 /* 64-bit */
  308. #define MAILBOX_RCV_STD_PROD_IDX 0x00000268 /* 64-bit */
  309. #define TG3_RX_STD_PROD_IDX_REG (MAILBOX_RCV_STD_PROD_IDX + \
  310. TG3_64BIT_REG_LOW)
  311. #define MAILBOX_RCV_JUMBO_PROD_IDX 0x00000270 /* 64-bit */
  312. #define TG3_RX_JMB_PROD_IDX_REG (MAILBOX_RCV_JUMBO_PROD_IDX + \
  313. TG3_64BIT_REG_LOW)
  314. #define MAILBOX_RCV_MINI_PROD_IDX 0x00000278 /* 64-bit */
  315. #define MAILBOX_RCVRET_CON_IDX_0 0x00000280 /* 64-bit */
  316. #define MAILBOX_RCVRET_CON_IDX_1 0x00000288 /* 64-bit */
  317. #define MAILBOX_RCVRET_CON_IDX_2 0x00000290 /* 64-bit */
  318. #define MAILBOX_RCVRET_CON_IDX_3 0x00000298 /* 64-bit */
  319. #define MAILBOX_RCVRET_CON_IDX_4 0x000002a0 /* 64-bit */
  320. #define MAILBOX_RCVRET_CON_IDX_5 0x000002a8 /* 64-bit */
  321. #define MAILBOX_RCVRET_CON_IDX_6 0x000002b0 /* 64-bit */
  322. #define MAILBOX_RCVRET_CON_IDX_7 0x000002b8 /* 64-bit */
  323. #define MAILBOX_RCVRET_CON_IDX_8 0x000002c0 /* 64-bit */
  324. #define MAILBOX_RCVRET_CON_IDX_9 0x000002c8 /* 64-bit */
  325. #define MAILBOX_RCVRET_CON_IDX_10 0x000002d0 /* 64-bit */
  326. #define MAILBOX_RCVRET_CON_IDX_11 0x000002d8 /* 64-bit */
  327. #define MAILBOX_RCVRET_CON_IDX_12 0x000002e0 /* 64-bit */
  328. #define MAILBOX_RCVRET_CON_IDX_13 0x000002e8 /* 64-bit */
  329. #define MAILBOX_RCVRET_CON_IDX_14 0x000002f0 /* 64-bit */
  330. #define MAILBOX_RCVRET_CON_IDX_15 0x000002f8 /* 64-bit */
  331. #define MAILBOX_SNDHOST_PROD_IDX_0 0x00000300 /* 64-bit */
  332. #define MAILBOX_SNDHOST_PROD_IDX_1 0x00000308 /* 64-bit */
  333. #define MAILBOX_SNDHOST_PROD_IDX_2 0x00000310 /* 64-bit */
  334. #define MAILBOX_SNDHOST_PROD_IDX_3 0x00000318 /* 64-bit */
  335. #define MAILBOX_SNDHOST_PROD_IDX_4 0x00000320 /* 64-bit */
  336. #define MAILBOX_SNDHOST_PROD_IDX_5 0x00000328 /* 64-bit */
  337. #define MAILBOX_SNDHOST_PROD_IDX_6 0x00000330 /* 64-bit */
  338. #define MAILBOX_SNDHOST_PROD_IDX_7 0x00000338 /* 64-bit */
  339. #define MAILBOX_SNDHOST_PROD_IDX_8 0x00000340 /* 64-bit */
  340. #define MAILBOX_SNDHOST_PROD_IDX_9 0x00000348 /* 64-bit */
  341. #define MAILBOX_SNDHOST_PROD_IDX_10 0x00000350 /* 64-bit */
  342. #define MAILBOX_SNDHOST_PROD_IDX_11 0x00000358 /* 64-bit */
  343. #define MAILBOX_SNDHOST_PROD_IDX_12 0x00000360 /* 64-bit */
  344. #define MAILBOX_SNDHOST_PROD_IDX_13 0x00000368 /* 64-bit */
  345. #define MAILBOX_SNDHOST_PROD_IDX_14 0x00000370 /* 64-bit */
  346. #define MAILBOX_SNDHOST_PROD_IDX_15 0x00000378 /* 64-bit */
  347. #define MAILBOX_SNDNIC_PROD_IDX_0 0x00000380 /* 64-bit */
  348. #define MAILBOX_SNDNIC_PROD_IDX_1 0x00000388 /* 64-bit */
  349. #define MAILBOX_SNDNIC_PROD_IDX_2 0x00000390 /* 64-bit */
  350. #define MAILBOX_SNDNIC_PROD_IDX_3 0x00000398 /* 64-bit */
  351. #define MAILBOX_SNDNIC_PROD_IDX_4 0x000003a0 /* 64-bit */
  352. #define MAILBOX_SNDNIC_PROD_IDX_5 0x000003a8 /* 64-bit */
  353. #define MAILBOX_SNDNIC_PROD_IDX_6 0x000003b0 /* 64-bit */
  354. #define MAILBOX_SNDNIC_PROD_IDX_7 0x000003b8 /* 64-bit */
  355. #define MAILBOX_SNDNIC_PROD_IDX_8 0x000003c0 /* 64-bit */
  356. #define MAILBOX_SNDNIC_PROD_IDX_9 0x000003c8 /* 64-bit */
  357. #define MAILBOX_SNDNIC_PROD_IDX_10 0x000003d0 /* 64-bit */
  358. #define MAILBOX_SNDNIC_PROD_IDX_11 0x000003d8 /* 64-bit */
  359. #define MAILBOX_SNDNIC_PROD_IDX_12 0x000003e0 /* 64-bit */
  360. #define MAILBOX_SNDNIC_PROD_IDX_13 0x000003e8 /* 64-bit */
  361. #define MAILBOX_SNDNIC_PROD_IDX_14 0x000003f0 /* 64-bit */
  362. #define MAILBOX_SNDNIC_PROD_IDX_15 0x000003f8 /* 64-bit */
  363. /* MAC control registers */
  364. #define MAC_MODE 0x00000400
  365. #define MAC_MODE_RESET 0x00000001
  366. #define MAC_MODE_HALF_DUPLEX 0x00000002
  367. #define MAC_MODE_PORT_MODE_MASK 0x0000000c
  368. #define MAC_MODE_PORT_MODE_TBI 0x0000000c
  369. #define MAC_MODE_PORT_MODE_GMII 0x00000008
  370. #define MAC_MODE_PORT_MODE_MII 0x00000004
  371. #define MAC_MODE_PORT_MODE_NONE 0x00000000
  372. #define MAC_MODE_PORT_INT_LPBACK 0x00000010
  373. #define MAC_MODE_TAGGED_MAC_CTRL 0x00000080
  374. #define MAC_MODE_TX_BURSTING 0x00000100
  375. #define MAC_MODE_MAX_DEFER 0x00000200
  376. #define MAC_MODE_LINK_POLARITY 0x00000400
  377. #define MAC_MODE_RXSTAT_ENABLE 0x00000800
  378. #define MAC_MODE_RXSTAT_CLEAR 0x00001000
  379. #define MAC_MODE_RXSTAT_FLUSH 0x00002000
  380. #define MAC_MODE_TXSTAT_ENABLE 0x00004000
  381. #define MAC_MODE_TXSTAT_CLEAR 0x00008000
  382. #define MAC_MODE_TXSTAT_FLUSH 0x00010000
  383. #define MAC_MODE_SEND_CONFIGS 0x00020000
  384. #define MAC_MODE_MAGIC_PKT_ENABLE 0x00040000
  385. #define MAC_MODE_ACPI_ENABLE 0x00080000
  386. #define MAC_MODE_MIP_ENABLE 0x00100000
  387. #define MAC_MODE_TDE_ENABLE 0x00200000
  388. #define MAC_MODE_RDE_ENABLE 0x00400000
  389. #define MAC_MODE_FHDE_ENABLE 0x00800000
  390. #define MAC_MODE_KEEP_FRAME_IN_WOL 0x01000000
  391. #define MAC_MODE_APE_RX_EN 0x08000000
  392. #define MAC_MODE_APE_TX_EN 0x10000000
  393. #define MAC_STATUS 0x00000404
  394. #define MAC_STATUS_PCS_SYNCED 0x00000001
  395. #define MAC_STATUS_SIGNAL_DET 0x00000002
  396. #define MAC_STATUS_RCVD_CFG 0x00000004
  397. #define MAC_STATUS_CFG_CHANGED 0x00000008
  398. #define MAC_STATUS_SYNC_CHANGED 0x00000010
  399. #define MAC_STATUS_PORT_DEC_ERR 0x00000400
  400. #define MAC_STATUS_LNKSTATE_CHANGED 0x00001000
  401. #define MAC_STATUS_MI_COMPLETION 0x00400000
  402. #define MAC_STATUS_MI_INTERRUPT 0x00800000
  403. #define MAC_STATUS_AP_ERROR 0x01000000
  404. #define MAC_STATUS_ODI_ERROR 0x02000000
  405. #define MAC_STATUS_RXSTAT_OVERRUN 0x04000000
  406. #define MAC_STATUS_TXSTAT_OVERRUN 0x08000000
  407. #define MAC_EVENT 0x00000408
  408. #define MAC_EVENT_PORT_DECODE_ERR 0x00000400
  409. #define MAC_EVENT_LNKSTATE_CHANGED 0x00001000
  410. #define MAC_EVENT_MI_COMPLETION 0x00400000
  411. #define MAC_EVENT_MI_INTERRUPT 0x00800000
  412. #define MAC_EVENT_AP_ERROR 0x01000000
  413. #define MAC_EVENT_ODI_ERROR 0x02000000
  414. #define MAC_EVENT_RXSTAT_OVERRUN 0x04000000
  415. #define MAC_EVENT_TXSTAT_OVERRUN 0x08000000
  416. #define MAC_LED_CTRL 0x0000040c
  417. #define LED_CTRL_LNKLED_OVERRIDE 0x00000001
  418. #define LED_CTRL_1000MBPS_ON 0x00000002
  419. #define LED_CTRL_100MBPS_ON 0x00000004
  420. #define LED_CTRL_10MBPS_ON 0x00000008
  421. #define LED_CTRL_TRAFFIC_OVERRIDE 0x00000010
  422. #define LED_CTRL_TRAFFIC_BLINK 0x00000020
  423. #define LED_CTRL_TRAFFIC_LED 0x00000040
  424. #define LED_CTRL_1000MBPS_STATUS 0x00000080
  425. #define LED_CTRL_100MBPS_STATUS 0x00000100
  426. #define LED_CTRL_10MBPS_STATUS 0x00000200
  427. #define LED_CTRL_TRAFFIC_STATUS 0x00000400
  428. #define LED_CTRL_MODE_MAC 0x00000000
  429. #define LED_CTRL_MODE_PHY_1 0x00000800
  430. #define LED_CTRL_MODE_PHY_2 0x00001000
  431. #define LED_CTRL_MODE_SHASTA_MAC 0x00002000
  432. #define LED_CTRL_MODE_SHARED 0x00004000
  433. #define LED_CTRL_MODE_COMBO 0x00008000
  434. #define LED_CTRL_BLINK_RATE_MASK 0x7ff80000
  435. #define LED_CTRL_BLINK_RATE_SHIFT 19
  436. #define LED_CTRL_BLINK_PER_OVERRIDE 0x00080000
  437. #define LED_CTRL_BLINK_RATE_OVERRIDE 0x80000000
  438. #define MAC_ADDR_0_HIGH 0x00000410 /* upper 2 bytes */
  439. #define MAC_ADDR_0_LOW 0x00000414 /* lower 4 bytes */
  440. #define MAC_ADDR_1_HIGH 0x00000418 /* upper 2 bytes */
  441. #define MAC_ADDR_1_LOW 0x0000041c /* lower 4 bytes */
  442. #define MAC_ADDR_2_HIGH 0x00000420 /* upper 2 bytes */
  443. #define MAC_ADDR_2_LOW 0x00000424 /* lower 4 bytes */
  444. #define MAC_ADDR_3_HIGH 0x00000428 /* upper 2 bytes */
  445. #define MAC_ADDR_3_LOW 0x0000042c /* lower 4 bytes */
  446. #define MAC_ACPI_MBUF_PTR 0x00000430
  447. #define MAC_ACPI_LEN_OFFSET 0x00000434
  448. #define ACPI_LENOFF_LEN_MASK 0x0000ffff
  449. #define ACPI_LENOFF_LEN_SHIFT 0
  450. #define ACPI_LENOFF_OFF_MASK 0x0fff0000
  451. #define ACPI_LENOFF_OFF_SHIFT 16
  452. #define MAC_TX_BACKOFF_SEED 0x00000438
  453. #define TX_BACKOFF_SEED_MASK 0x000003ff
  454. #define MAC_RX_MTU_SIZE 0x0000043c
  455. #define RX_MTU_SIZE_MASK 0x0000ffff
  456. #define MAC_PCS_TEST 0x00000440
  457. #define PCS_TEST_PATTERN_MASK 0x000fffff
  458. #define PCS_TEST_PATTERN_SHIFT 0
  459. #define PCS_TEST_ENABLE 0x00100000
  460. #define MAC_TX_AUTO_NEG 0x00000444
  461. #define TX_AUTO_NEG_MASK 0x0000ffff
  462. #define TX_AUTO_NEG_SHIFT 0
  463. #define MAC_RX_AUTO_NEG 0x00000448
  464. #define RX_AUTO_NEG_MASK 0x0000ffff
  465. #define RX_AUTO_NEG_SHIFT 0
  466. #define MAC_MI_COM 0x0000044c
  467. #define MI_COM_CMD_MASK 0x0c000000
  468. #define MI_COM_CMD_WRITE 0x04000000
  469. #define MI_COM_CMD_READ 0x08000000
  470. #define MI_COM_READ_FAILED 0x10000000
  471. #define MI_COM_START 0x20000000
  472. #define MI_COM_BUSY 0x20000000
  473. #define MI_COM_PHY_ADDR_MASK 0x03e00000
  474. #define MI_COM_PHY_ADDR_SHIFT 21
  475. #define MI_COM_REG_ADDR_MASK 0x001f0000
  476. #define MI_COM_REG_ADDR_SHIFT 16
  477. #define MI_COM_DATA_MASK 0x0000ffff
  478. #define MAC_MI_STAT 0x00000450
  479. #define MAC_MI_STAT_LNKSTAT_ATTN_ENAB 0x00000001
  480. #define MAC_MI_STAT_10MBPS_MODE 0x00000002
  481. #define MAC_MI_MODE 0x00000454
  482. #define MAC_MI_MODE_CLK_10MHZ 0x00000001
  483. #define MAC_MI_MODE_SHORT_PREAMBLE 0x00000002
  484. #define MAC_MI_MODE_AUTO_POLL 0x00000010
  485. #define MAC_MI_MODE_500KHZ_CONST 0x00008000
  486. #define MAC_MI_MODE_BASE 0x000c0000 /* XXX magic values XXX */
  487. #define MAC_AUTO_POLL_STATUS 0x00000458
  488. #define MAC_AUTO_POLL_ERROR 0x00000001
  489. #define MAC_TX_MODE 0x0000045c
  490. #define TX_MODE_RESET 0x00000001
  491. #define TX_MODE_ENABLE 0x00000002
  492. #define TX_MODE_FLOW_CTRL_ENABLE 0x00000010
  493. #define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020
  494. #define TX_MODE_LONG_PAUSE_ENABLE 0x00000040
  495. #define TX_MODE_MBUF_LOCKUP_FIX 0x00000100
  496. #define TX_MODE_JMB_FRM_LEN 0x00400000
  497. #define TX_MODE_CNT_DN_MODE 0x00800000
  498. #define MAC_TX_STATUS 0x00000460
  499. #define TX_STATUS_XOFFED 0x00000001
  500. #define TX_STATUS_SENT_XOFF 0x00000002
  501. #define TX_STATUS_SENT_XON 0x00000004
  502. #define TX_STATUS_LINK_UP 0x00000008
  503. #define TX_STATUS_ODI_UNDERRUN 0x00000010
  504. #define TX_STATUS_ODI_OVERRUN 0x00000020
  505. #define MAC_TX_LENGTHS 0x00000464
  506. #define TX_LENGTHS_SLOT_TIME_MASK 0x000000ff
  507. #define TX_LENGTHS_SLOT_TIME_SHIFT 0
  508. #define TX_LENGTHS_IPG_MASK 0x00000f00
  509. #define TX_LENGTHS_IPG_SHIFT 8
  510. #define TX_LENGTHS_IPG_CRS_MASK 0x00003000
  511. #define TX_LENGTHS_IPG_CRS_SHIFT 12
  512. #define TX_LENGTHS_JMB_FRM_LEN_MSK 0x00ff0000
  513. #define TX_LENGTHS_CNT_DWN_VAL_MSK 0xff000000
  514. #define MAC_RX_MODE 0x00000468
  515. #define RX_MODE_RESET 0x00000001
  516. #define RX_MODE_ENABLE 0x00000002
  517. #define RX_MODE_FLOW_CTRL_ENABLE 0x00000004
  518. #define RX_MODE_KEEP_MAC_CTRL 0x00000008
  519. #define RX_MODE_KEEP_PAUSE 0x00000010
  520. #define RX_MODE_ACCEPT_OVERSIZED 0x00000020
  521. #define RX_MODE_ACCEPT_RUNTS 0x00000040
  522. #define RX_MODE_LEN_CHECK 0x00000080
  523. #define RX_MODE_PROMISC 0x00000100
  524. #define RX_MODE_NO_CRC_CHECK 0x00000200
  525. #define RX_MODE_KEEP_VLAN_TAG 0x00000400
  526. #define RX_MODE_RSS_IPV4_HASH_EN 0x00010000
  527. #define RX_MODE_RSS_TCP_IPV4_HASH_EN 0x00020000
  528. #define RX_MODE_RSS_IPV6_HASH_EN 0x00040000
  529. #define RX_MODE_RSS_TCP_IPV6_HASH_EN 0x00080000
  530. #define RX_MODE_RSS_ITBL_HASH_BITS_7 0x00700000
  531. #define RX_MODE_RSS_ENABLE 0x00800000
  532. #define RX_MODE_IPV6_CSUM_ENABLE 0x01000000
  533. #define RX_MODE_IPV4_FRAG_FIX 0x02000000
  534. #define MAC_RX_STATUS 0x0000046c
  535. #define RX_STATUS_REMOTE_TX_XOFFED 0x00000001
  536. #define RX_STATUS_XOFF_RCVD 0x00000002
  537. #define RX_STATUS_XON_RCVD 0x00000004
  538. #define MAC_HASH_REG_0 0x00000470
  539. #define MAC_HASH_REG_1 0x00000474
  540. #define MAC_HASH_REG_2 0x00000478
  541. #define MAC_HASH_REG_3 0x0000047c
  542. #define MAC_RCV_RULE_0 0x00000480
  543. #define MAC_RCV_VALUE_0 0x00000484
  544. #define MAC_RCV_RULE_1 0x00000488
  545. #define MAC_RCV_VALUE_1 0x0000048c
  546. #define MAC_RCV_RULE_2 0x00000490
  547. #define MAC_RCV_VALUE_2 0x00000494
  548. #define MAC_RCV_RULE_3 0x00000498
  549. #define MAC_RCV_VALUE_3 0x0000049c
  550. #define MAC_RCV_RULE_4 0x000004a0
  551. #define MAC_RCV_VALUE_4 0x000004a4
  552. #define MAC_RCV_RULE_5 0x000004a8
  553. #define MAC_RCV_VALUE_5 0x000004ac
  554. #define MAC_RCV_RULE_6 0x000004b0
  555. #define MAC_RCV_VALUE_6 0x000004b4
  556. #define MAC_RCV_RULE_7 0x000004b8
  557. #define MAC_RCV_VALUE_7 0x000004bc
  558. #define MAC_RCV_RULE_8 0x000004c0
  559. #define MAC_RCV_VALUE_8 0x000004c4
  560. #define MAC_RCV_RULE_9 0x000004c8
  561. #define MAC_RCV_VALUE_9 0x000004cc
  562. #define MAC_RCV_RULE_10 0x000004d0
  563. #define MAC_RCV_VALUE_10 0x000004d4
  564. #define MAC_RCV_RULE_11 0x000004d8
  565. #define MAC_RCV_VALUE_11 0x000004dc
  566. #define MAC_RCV_RULE_12 0x000004e0
  567. #define MAC_RCV_VALUE_12 0x000004e4
  568. #define MAC_RCV_RULE_13 0x000004e8
  569. #define MAC_RCV_VALUE_13 0x000004ec
  570. #define MAC_RCV_RULE_14 0x000004f0
  571. #define MAC_RCV_VALUE_14 0x000004f4
  572. #define MAC_RCV_RULE_15 0x000004f8
  573. #define MAC_RCV_VALUE_15 0x000004fc
  574. #define RCV_RULE_DISABLE_MASK 0x7fffffff
  575. #define MAC_RCV_RULE_CFG 0x00000500
  576. #define RCV_RULE_CFG_DEFAULT_CLASS 0x00000008
  577. #define MAC_LOW_WMARK_MAX_RX_FRAME 0x00000504
  578. /* 0x508 --> 0x520 unused */
  579. #define MAC_HASHREGU_0 0x00000520
  580. #define MAC_HASHREGU_1 0x00000524
  581. #define MAC_HASHREGU_2 0x00000528
  582. #define MAC_HASHREGU_3 0x0000052c
  583. #define MAC_EXTADDR_0_HIGH 0x00000530
  584. #define MAC_EXTADDR_0_LOW 0x00000534
  585. #define MAC_EXTADDR_1_HIGH 0x00000538
  586. #define MAC_EXTADDR_1_LOW 0x0000053c
  587. #define MAC_EXTADDR_2_HIGH 0x00000540
  588. #define MAC_EXTADDR_2_LOW 0x00000544
  589. #define MAC_EXTADDR_3_HIGH 0x00000548
  590. #define MAC_EXTADDR_3_LOW 0x0000054c
  591. #define MAC_EXTADDR_4_HIGH 0x00000550
  592. #define MAC_EXTADDR_4_LOW 0x00000554
  593. #define MAC_EXTADDR_5_HIGH 0x00000558
  594. #define MAC_EXTADDR_5_LOW 0x0000055c
  595. #define MAC_EXTADDR_6_HIGH 0x00000560
  596. #define MAC_EXTADDR_6_LOW 0x00000564
  597. #define MAC_EXTADDR_7_HIGH 0x00000568
  598. #define MAC_EXTADDR_7_LOW 0x0000056c
  599. #define MAC_EXTADDR_8_HIGH 0x00000570
  600. #define MAC_EXTADDR_8_LOW 0x00000574
  601. #define MAC_EXTADDR_9_HIGH 0x00000578
  602. #define MAC_EXTADDR_9_LOW 0x0000057c
  603. #define MAC_EXTADDR_10_HIGH 0x00000580
  604. #define MAC_EXTADDR_10_LOW 0x00000584
  605. #define MAC_EXTADDR_11_HIGH 0x00000588
  606. #define MAC_EXTADDR_11_LOW 0x0000058c
  607. #define MAC_SERDES_CFG 0x00000590
  608. #define MAC_SERDES_CFG_EDGE_SELECT 0x00001000
  609. #define MAC_SERDES_STAT 0x00000594
  610. /* 0x598 --> 0x5a0 unused */
  611. #define MAC_PHYCFG1 0x000005a0
  612. #define MAC_PHYCFG1_RGMII_INT 0x00000001
  613. #define MAC_PHYCFG1_RXCLK_TO_MASK 0x00001ff0
  614. #define MAC_PHYCFG1_RXCLK_TIMEOUT 0x00001000
  615. #define MAC_PHYCFG1_TXCLK_TO_MASK 0x01ff0000
  616. #define MAC_PHYCFG1_TXCLK_TIMEOUT 0x01000000
  617. #define MAC_PHYCFG1_RGMII_EXT_RX_DEC 0x02000000
  618. #define MAC_PHYCFG1_RGMII_SND_STAT_EN 0x04000000
  619. #define MAC_PHYCFG1_TXC_DRV 0x20000000
  620. #define MAC_PHYCFG2 0x000005a4
  621. #define MAC_PHYCFG2_INBAND_ENABLE 0x00000001
  622. #define MAC_PHYCFG2_EMODE_MASK_MASK 0x000001c0
  623. #define MAC_PHYCFG2_EMODE_MASK_AC131 0x000000c0
  624. #define MAC_PHYCFG2_EMODE_MASK_50610 0x00000100
  625. #define MAC_PHYCFG2_EMODE_MASK_RT8211 0x00000000
  626. #define MAC_PHYCFG2_EMODE_MASK_RT8201 0x000001c0
  627. #define MAC_PHYCFG2_EMODE_COMP_MASK 0x00000e00
  628. #define MAC_PHYCFG2_EMODE_COMP_AC131 0x00000600
  629. #define MAC_PHYCFG2_EMODE_COMP_50610 0x00000400
  630. #define MAC_PHYCFG2_EMODE_COMP_RT8211 0x00000800
  631. #define MAC_PHYCFG2_EMODE_COMP_RT8201 0x00000000
  632. #define MAC_PHYCFG2_FMODE_MASK_MASK 0x00007000
  633. #define MAC_PHYCFG2_FMODE_MASK_AC131 0x00006000
  634. #define MAC_PHYCFG2_FMODE_MASK_50610 0x00004000
  635. #define MAC_PHYCFG2_FMODE_MASK_RT8211 0x00000000
  636. #define MAC_PHYCFG2_FMODE_MASK_RT8201 0x00007000
  637. #define MAC_PHYCFG2_FMODE_COMP_MASK 0x00038000
  638. #define MAC_PHYCFG2_FMODE_COMP_AC131 0x00030000
  639. #define MAC_PHYCFG2_FMODE_COMP_50610 0x00008000
  640. #define MAC_PHYCFG2_FMODE_COMP_RT8211 0x00038000
  641. #define MAC_PHYCFG2_FMODE_COMP_RT8201 0x00000000
  642. #define MAC_PHYCFG2_GMODE_MASK_MASK 0x001c0000
  643. #define MAC_PHYCFG2_GMODE_MASK_AC131 0x001c0000
  644. #define MAC_PHYCFG2_GMODE_MASK_50610 0x00100000
  645. #define MAC_PHYCFG2_GMODE_MASK_RT8211 0x00000000
  646. #define MAC_PHYCFG2_GMODE_MASK_RT8201 0x001c0000
  647. #define MAC_PHYCFG2_GMODE_COMP_MASK 0x00e00000
  648. #define MAC_PHYCFG2_GMODE_COMP_AC131 0x00e00000
  649. #define MAC_PHYCFG2_GMODE_COMP_50610 0x00000000
  650. #define MAC_PHYCFG2_GMODE_COMP_RT8211 0x00200000
  651. #define MAC_PHYCFG2_GMODE_COMP_RT8201 0x00000000
  652. #define MAC_PHYCFG2_ACT_MASK_MASK 0x03000000
  653. #define MAC_PHYCFG2_ACT_MASK_AC131 0x03000000
  654. #define MAC_PHYCFG2_ACT_MASK_50610 0x01000000
  655. #define MAC_PHYCFG2_ACT_MASK_RT8211 0x03000000
  656. #define MAC_PHYCFG2_ACT_MASK_RT8201 0x01000000
  657. #define MAC_PHYCFG2_ACT_COMP_MASK 0x0c000000
  658. #define MAC_PHYCFG2_ACT_COMP_AC131 0x00000000
  659. #define MAC_PHYCFG2_ACT_COMP_50610 0x00000000
  660. #define MAC_PHYCFG2_ACT_COMP_RT8211 0x00000000
  661. #define MAC_PHYCFG2_ACT_COMP_RT8201 0x08000000
  662. #define MAC_PHYCFG2_QUAL_MASK_MASK 0x30000000
  663. #define MAC_PHYCFG2_QUAL_MASK_AC131 0x30000000
  664. #define MAC_PHYCFG2_QUAL_MASK_50610 0x30000000
  665. #define MAC_PHYCFG2_QUAL_MASK_RT8211 0x30000000
  666. #define MAC_PHYCFG2_QUAL_MASK_RT8201 0x30000000
  667. #define MAC_PHYCFG2_QUAL_COMP_MASK 0xc0000000
  668. #define MAC_PHYCFG2_QUAL_COMP_AC131 0x00000000
  669. #define MAC_PHYCFG2_QUAL_COMP_50610 0x00000000
  670. #define MAC_PHYCFG2_QUAL_COMP_RT8211 0x00000000
  671. #define MAC_PHYCFG2_QUAL_COMP_RT8201 0x00000000
  672. #define MAC_PHYCFG2_50610_LED_MODES \
  673. (MAC_PHYCFG2_EMODE_MASK_50610 | \
  674. MAC_PHYCFG2_EMODE_COMP_50610 | \
  675. MAC_PHYCFG2_FMODE_MASK_50610 | \
  676. MAC_PHYCFG2_FMODE_COMP_50610 | \
  677. MAC_PHYCFG2_GMODE_MASK_50610 | \
  678. MAC_PHYCFG2_GMODE_COMP_50610 | \
  679. MAC_PHYCFG2_ACT_MASK_50610 | \
  680. MAC_PHYCFG2_ACT_COMP_50610 | \
  681. MAC_PHYCFG2_QUAL_MASK_50610 | \
  682. MAC_PHYCFG2_QUAL_COMP_50610)
  683. #define MAC_PHYCFG2_AC131_LED_MODES \
  684. (MAC_PHYCFG2_EMODE_MASK_AC131 | \
  685. MAC_PHYCFG2_EMODE_COMP_AC131 | \
  686. MAC_PHYCFG2_FMODE_MASK_AC131 | \
  687. MAC_PHYCFG2_FMODE_COMP_AC131 | \
  688. MAC_PHYCFG2_GMODE_MASK_AC131 | \
  689. MAC_PHYCFG2_GMODE_COMP_AC131 | \
  690. MAC_PHYCFG2_ACT_MASK_AC131 | \
  691. MAC_PHYCFG2_ACT_COMP_AC131 | \
  692. MAC_PHYCFG2_QUAL_MASK_AC131 | \
  693. MAC_PHYCFG2_QUAL_COMP_AC131)
  694. #define MAC_PHYCFG2_RTL8211C_LED_MODES \
  695. (MAC_PHYCFG2_EMODE_MASK_RT8211 | \
  696. MAC_PHYCFG2_EMODE_COMP_RT8211 | \
  697. MAC_PHYCFG2_FMODE_MASK_RT8211 | \
  698. MAC_PHYCFG2_FMODE_COMP_RT8211 | \
  699. MAC_PHYCFG2_GMODE_MASK_RT8211 | \
  700. MAC_PHYCFG2_GMODE_COMP_RT8211 | \
  701. MAC_PHYCFG2_ACT_MASK_RT8211 | \
  702. MAC_PHYCFG2_ACT_COMP_RT8211 | \
  703. MAC_PHYCFG2_QUAL_MASK_RT8211 | \
  704. MAC_PHYCFG2_QUAL_COMP_RT8211)
  705. #define MAC_PHYCFG2_RTL8201E_LED_MODES \
  706. (MAC_PHYCFG2_EMODE_MASK_RT8201 | \
  707. MAC_PHYCFG2_EMODE_COMP_RT8201 | \
  708. MAC_PHYCFG2_FMODE_MASK_RT8201 | \
  709. MAC_PHYCFG2_FMODE_COMP_RT8201 | \
  710. MAC_PHYCFG2_GMODE_MASK_RT8201 | \
  711. MAC_PHYCFG2_GMODE_COMP_RT8201 | \
  712. MAC_PHYCFG2_ACT_MASK_RT8201 | \
  713. MAC_PHYCFG2_ACT_COMP_RT8201 | \
  714. MAC_PHYCFG2_QUAL_MASK_RT8201 | \
  715. MAC_PHYCFG2_QUAL_COMP_RT8201)
  716. #define MAC_EXT_RGMII_MODE 0x000005a8
  717. #define MAC_RGMII_MODE_TX_ENABLE 0x00000001
  718. #define MAC_RGMII_MODE_TX_LOWPWR 0x00000002
  719. #define MAC_RGMII_MODE_TX_RESET 0x00000004
  720. #define MAC_RGMII_MODE_RX_INT_B 0x00000100
  721. #define MAC_RGMII_MODE_RX_QUALITY 0x00000200
  722. #define MAC_RGMII_MODE_RX_ACTIVITY 0x00000400
  723. #define MAC_RGMII_MODE_RX_ENG_DET 0x00000800
  724. /* 0x5ac --> 0x5b0 unused */
  725. #define SERDES_RX_CTRL 0x000005b0 /* 5780/5714 only */
  726. #define SERDES_RX_SIG_DETECT 0x00000400
  727. #define SG_DIG_CTRL 0x000005b0
  728. #define SG_DIG_USING_HW_AUTONEG 0x80000000
  729. #define SG_DIG_SOFT_RESET 0x40000000
  730. #define SG_DIG_DISABLE_LINKRDY 0x20000000
  731. #define SG_DIG_CRC16_CLEAR_N 0x01000000
  732. #define SG_DIG_EN10B 0x00800000
  733. #define SG_DIG_CLEAR_STATUS 0x00400000
  734. #define SG_DIG_LOCAL_DUPLEX_STATUS 0x00200000
  735. #define SG_DIG_LOCAL_LINK_STATUS 0x00100000
  736. #define SG_DIG_SPEED_STATUS_MASK 0x000c0000
  737. #define SG_DIG_SPEED_STATUS_SHIFT 18
  738. #define SG_DIG_JUMBO_PACKET_DISABLE 0x00020000
  739. #define SG_DIG_RESTART_AUTONEG 0x00010000
  740. #define SG_DIG_FIBER_MODE 0x00008000
  741. #define SG_DIG_REMOTE_FAULT_MASK 0x00006000
  742. #define SG_DIG_PAUSE_MASK 0x00001800
  743. #define SG_DIG_PAUSE_CAP 0x00000800
  744. #define SG_DIG_ASYM_PAUSE 0x00001000
  745. #define SG_DIG_GBIC_ENABLE 0x00000400
  746. #define SG_DIG_CHECK_END_ENABLE 0x00000200
  747. #define SG_DIG_SGMII_AUTONEG_TIMER 0x00000100
  748. #define SG_DIG_CLOCK_PHASE_SELECT 0x00000080
  749. #define SG_DIG_GMII_INPUT_SELECT 0x00000040
  750. #define SG_DIG_MRADV_CRC16_SELECT 0x00000020
  751. #define SG_DIG_COMMA_DETECT_ENABLE 0x00000010
  752. #define SG_DIG_AUTONEG_TIMER_REDUCE 0x00000008
  753. #define SG_DIG_AUTONEG_LOW_ENABLE 0x00000004
  754. #define SG_DIG_REMOTE_LOOPBACK 0x00000002
  755. #define SG_DIG_LOOPBACK 0x00000001
  756. #define SG_DIG_COMMON_SETUP (SG_DIG_CRC16_CLEAR_N | \
  757. SG_DIG_LOCAL_DUPLEX_STATUS | \
  758. SG_DIG_LOCAL_LINK_STATUS | \
  759. (0x2 << SG_DIG_SPEED_STATUS_SHIFT) | \
  760. SG_DIG_FIBER_MODE | SG_DIG_GBIC_ENABLE)
  761. #define SG_DIG_STATUS 0x000005b4
  762. #define SG_DIG_CRC16_BUS_MASK 0xffff0000
  763. #define SG_DIG_PARTNER_FAULT_MASK 0x00600000 /* If !MRADV_CRC16_SELECT */
  764. #define SG_DIG_PARTNER_ASYM_PAUSE 0x00100000 /* If !MRADV_CRC16_SELECT */
  765. #define SG_DIG_PARTNER_PAUSE_CAPABLE 0x00080000 /* If !MRADV_CRC16_SELECT */
  766. #define SG_DIG_PARTNER_HALF_DUPLEX 0x00040000 /* If !MRADV_CRC16_SELECT */
  767. #define SG_DIG_PARTNER_FULL_DUPLEX 0x00020000 /* If !MRADV_CRC16_SELECT */
  768. #define SG_DIG_PARTNER_NEXT_PAGE 0x00010000 /* If !MRADV_CRC16_SELECT */
  769. #define SG_DIG_AUTONEG_STATE_MASK 0x00000ff0
  770. #define SG_DIG_IS_SERDES 0x00000100
  771. #define SG_DIG_COMMA_DETECTOR 0x00000008
  772. #define SG_DIG_MAC_ACK_STATUS 0x00000004
  773. #define SG_DIG_AUTONEG_COMPLETE 0x00000002
  774. #define SG_DIG_AUTONEG_ERROR 0x00000001
  775. #define TG3_TX_TSTAMP_LSB 0x000005c0
  776. #define TG3_TX_TSTAMP_MSB 0x000005c4
  777. #define TG3_TSTAMP_MASK 0x7fffffffffffffffLL
  778. /* 0x5c8 --> 0x600 unused */
  779. #define MAC_TX_MAC_STATE_BASE 0x00000600 /* 16 bytes */
  780. #define MAC_RX_MAC_STATE_BASE 0x00000610 /* 20 bytes */
  781. /* 0x624 --> 0x670 unused */
  782. #define MAC_RSS_INDIR_TBL_0 0x00000630
  783. #define MAC_RSS_HASH_KEY_0 0x00000670
  784. #define MAC_RSS_HASH_KEY_1 0x00000674
  785. #define MAC_RSS_HASH_KEY_2 0x00000678
  786. #define MAC_RSS_HASH_KEY_3 0x0000067c
  787. #define MAC_RSS_HASH_KEY_4 0x00000680
  788. #define MAC_RSS_HASH_KEY_5 0x00000684
  789. #define MAC_RSS_HASH_KEY_6 0x00000688
  790. #define MAC_RSS_HASH_KEY_7 0x0000068c
  791. #define MAC_RSS_HASH_KEY_8 0x00000690
  792. #define MAC_RSS_HASH_KEY_9 0x00000694
  793. /* 0x698 --> 0x6b0 unused */
  794. #define TG3_RX_TSTAMP_LSB 0x000006b0
  795. #define TG3_RX_TSTAMP_MSB 0x000006b4
  796. /* 0x6b8 --> 0x6c8 unused */
  797. #define TG3_RX_PTP_CTL 0x000006c8
  798. #define TG3_RX_PTP_CTL_SYNC_EVNT 0x00000001
  799. #define TG3_RX_PTP_CTL_DELAY_REQ 0x00000002
  800. #define TG3_RX_PTP_CTL_PDLAY_REQ 0x00000004
  801. #define TG3_RX_PTP_CTL_PDLAY_RES 0x00000008
  802. #define TG3_RX_PTP_CTL_ALL_V1_EVENTS (TG3_RX_PTP_CTL_SYNC_EVNT | \
  803. TG3_RX_PTP_CTL_DELAY_REQ)
  804. #define TG3_RX_PTP_CTL_ALL_V2_EVENTS (TG3_RX_PTP_CTL_SYNC_EVNT | \
  805. TG3_RX_PTP_CTL_DELAY_REQ | \
  806. TG3_RX_PTP_CTL_PDLAY_REQ | \
  807. TG3_RX_PTP_CTL_PDLAY_RES)
  808. #define TG3_RX_PTP_CTL_FOLLOW_UP 0x00000100
  809. #define TG3_RX_PTP_CTL_DELAY_RES 0x00000200
  810. #define TG3_RX_PTP_CTL_PDRES_FLW_UP 0x00000400
  811. #define TG3_RX_PTP_CTL_ANNOUNCE 0x00000800
  812. #define TG3_RX_PTP_CTL_SIGNALING 0x00001000
  813. #define TG3_RX_PTP_CTL_MANAGEMENT 0x00002000
  814. #define TG3_RX_PTP_CTL_RX_PTP_V2_L2_EN 0x00800000
  815. #define TG3_RX_PTP_CTL_RX_PTP_V2_L4_EN 0x01000000
  816. #define TG3_RX_PTP_CTL_RX_PTP_V2_EN (TG3_RX_PTP_CTL_RX_PTP_V2_L2_EN | \
  817. TG3_RX_PTP_CTL_RX_PTP_V2_L4_EN)
  818. #define TG3_RX_PTP_CTL_RX_PTP_V1_EN 0x02000000
  819. #define TG3_RX_PTP_CTL_HWTS_INTERLOCK 0x04000000
  820. /* 0x6cc --> 0x800 unused */
  821. #define MAC_TX_STATS_OCTETS 0x00000800
  822. #define MAC_TX_STATS_RESV1 0x00000804
  823. #define MAC_TX_STATS_COLLISIONS 0x00000808
  824. #define MAC_TX_STATS_XON_SENT 0x0000080c
  825. #define MAC_TX_STATS_XOFF_SENT 0x00000810
  826. #define MAC_TX_STATS_RESV2 0x00000814
  827. #define MAC_TX_STATS_MAC_ERRORS 0x00000818
  828. #define MAC_TX_STATS_SINGLE_COLLISIONS 0x0000081c
  829. #define MAC_TX_STATS_MULT_COLLISIONS 0x00000820
  830. #define MAC_TX_STATS_DEFERRED 0x00000824
  831. #define MAC_TX_STATS_RESV3 0x00000828
  832. #define MAC_TX_STATS_EXCESSIVE_COL 0x0000082c
  833. #define MAC_TX_STATS_LATE_COL 0x00000830
  834. #define MAC_TX_STATS_RESV4_1 0x00000834
  835. #define MAC_TX_STATS_RESV4_2 0x00000838
  836. #define MAC_TX_STATS_RESV4_3 0x0000083c
  837. #define MAC_TX_STATS_RESV4_4 0x00000840
  838. #define MAC_TX_STATS_RESV4_5 0x00000844
  839. #define MAC_TX_STATS_RESV4_6 0x00000848
  840. #define MAC_TX_STATS_RESV4_7 0x0000084c
  841. #define MAC_TX_STATS_RESV4_8 0x00000850
  842. #define MAC_TX_STATS_RESV4_9 0x00000854
  843. #define MAC_TX_STATS_RESV4_10 0x00000858
  844. #define MAC_TX_STATS_RESV4_11 0x0000085c
  845. #define MAC_TX_STATS_RESV4_12 0x00000860
  846. #define MAC_TX_STATS_RESV4_13 0x00000864
  847. #define MAC_TX_STATS_RESV4_14 0x00000868
  848. #define MAC_TX_STATS_UCAST 0x0000086c
  849. #define MAC_TX_STATS_MCAST 0x00000870
  850. #define MAC_TX_STATS_BCAST 0x00000874
  851. #define MAC_TX_STATS_RESV5_1 0x00000878
  852. #define MAC_TX_STATS_RESV5_2 0x0000087c
  853. #define MAC_RX_STATS_OCTETS 0x00000880
  854. #define MAC_RX_STATS_RESV1 0x00000884
  855. #define MAC_RX_STATS_FRAGMENTS 0x00000888
  856. #define MAC_RX_STATS_UCAST 0x0000088c
  857. #define MAC_RX_STATS_MCAST 0x00000890
  858. #define MAC_RX_STATS_BCAST 0x00000894
  859. #define MAC_RX_STATS_FCS_ERRORS 0x00000898
  860. #define MAC_RX_STATS_ALIGN_ERRORS 0x0000089c
  861. #define MAC_RX_STATS_XON_PAUSE_RECVD 0x000008a0
  862. #define MAC_RX_STATS_XOFF_PAUSE_RECVD 0x000008a4
  863. #define MAC_RX_STATS_MAC_CTRL_RECVD 0x000008a8
  864. #define MAC_RX_STATS_XOFF_ENTERED 0x000008ac
  865. #define MAC_RX_STATS_FRAME_TOO_LONG 0x000008b0
  866. #define MAC_RX_STATS_JABBERS 0x000008b4
  867. #define MAC_RX_STATS_UNDERSIZE 0x000008b8
  868. /* 0x8bc --> 0xc00 unused */
  869. /* Send data initiator control registers */
  870. #define SNDDATAI_MODE 0x00000c00
  871. #define SNDDATAI_MODE_RESET 0x00000001
  872. #define SNDDATAI_MODE_ENABLE 0x00000002
  873. #define SNDDATAI_MODE_STAT_OFLOW_ENAB 0x00000004
  874. #define SNDDATAI_STATUS 0x00000c04
  875. #define SNDDATAI_STATUS_STAT_OFLOW 0x00000004
  876. #define SNDDATAI_STATSCTRL 0x00000c08
  877. #define SNDDATAI_SCTRL_ENABLE 0x00000001
  878. #define SNDDATAI_SCTRL_FASTUPD 0x00000002
  879. #define SNDDATAI_SCTRL_CLEAR 0x00000004
  880. #define SNDDATAI_SCTRL_FLUSH 0x00000008
  881. #define SNDDATAI_SCTRL_FORCE_ZERO 0x00000010
  882. #define SNDDATAI_STATSENAB 0x00000c0c
  883. #define SNDDATAI_STATSINCMASK 0x00000c10
  884. #define ISO_PKT_TX 0x00000c20
  885. /* 0xc24 --> 0xc80 unused */
  886. #define SNDDATAI_COS_CNT_0 0x00000c80
  887. #define SNDDATAI_COS_CNT_1 0x00000c84
  888. #define SNDDATAI_COS_CNT_2 0x00000c88
  889. #define SNDDATAI_COS_CNT_3 0x00000c8c
  890. #define SNDDATAI_COS_CNT_4 0x00000c90
  891. #define SNDDATAI_COS_CNT_5 0x00000c94
  892. #define SNDDATAI_COS_CNT_6 0x00000c98
  893. #define SNDDATAI_COS_CNT_7 0x00000c9c
  894. #define SNDDATAI_COS_CNT_8 0x00000ca0
  895. #define SNDDATAI_COS_CNT_9 0x00000ca4
  896. #define SNDDATAI_COS_CNT_10 0x00000ca8
  897. #define SNDDATAI_COS_CNT_11 0x00000cac
  898. #define SNDDATAI_COS_CNT_12 0x00000cb0
  899. #define SNDDATAI_COS_CNT_13 0x00000cb4
  900. #define SNDDATAI_COS_CNT_14 0x00000cb8
  901. #define SNDDATAI_COS_CNT_15 0x00000cbc
  902. #define SNDDATAI_DMA_RDQ_FULL_CNT 0x00000cc0
  903. #define SNDDATAI_DMA_PRIO_RDQ_FULL_CNT 0x00000cc4
  904. #define SNDDATAI_SDCQ_FULL_CNT 0x00000cc8
  905. #define SNDDATAI_NICRNG_SSND_PIDX_CNT 0x00000ccc
  906. #define SNDDATAI_STATS_UPDATED_CNT 0x00000cd0
  907. #define SNDDATAI_INTERRUPTS_CNT 0x00000cd4
  908. #define SNDDATAI_AVOID_INTERRUPTS_CNT 0x00000cd8
  909. #define SNDDATAI_SND_THRESH_HIT_CNT 0x00000cdc
  910. /* 0xce0 --> 0x1000 unused */
  911. /* Send data completion control registers */
  912. #define SNDDATAC_MODE 0x00001000
  913. #define SNDDATAC_MODE_RESET 0x00000001
  914. #define SNDDATAC_MODE_ENABLE 0x00000002
  915. #define SNDDATAC_MODE_CDELAY 0x00000010
  916. /* 0x1004 --> 0x1400 unused */
  917. /* Send BD ring selector */
  918. #define SNDBDS_MODE 0x00001400
  919. #define SNDBDS_MODE_RESET 0x00000001
  920. #define SNDBDS_MODE_ENABLE 0x00000002
  921. #define SNDBDS_MODE_ATTN_ENABLE 0x00000004
  922. #define SNDBDS_STATUS 0x00001404
  923. #define SNDBDS_STATUS_ERROR_ATTN 0x00000004
  924. #define SNDBDS_HWDIAG 0x00001408
  925. /* 0x140c --> 0x1440 */
  926. #define SNDBDS_SEL_CON_IDX_0 0x00001440
  927. #define SNDBDS_SEL_CON_IDX_1 0x00001444
  928. #define SNDBDS_SEL_CON_IDX_2 0x00001448
  929. #define SNDBDS_SEL_CON_IDX_3 0x0000144c
  930. #define SNDBDS_SEL_CON_IDX_4 0x00001450
  931. #define SNDBDS_SEL_CON_IDX_5 0x00001454
  932. #define SNDBDS_SEL_CON_IDX_6 0x00001458
  933. #define SNDBDS_SEL_CON_IDX_7 0x0000145c
  934. #define SNDBDS_SEL_CON_IDX_8 0x00001460
  935. #define SNDBDS_SEL_CON_IDX_9 0x00001464
  936. #define SNDBDS_SEL_CON_IDX_10 0x00001468
  937. #define SNDBDS_SEL_CON_IDX_11 0x0000146c
  938. #define SNDBDS_SEL_CON_IDX_12 0x00001470
  939. #define SNDBDS_SEL_CON_IDX_13 0x00001474
  940. #define SNDBDS_SEL_CON_IDX_14 0x00001478
  941. #define SNDBDS_SEL_CON_IDX_15 0x0000147c
  942. /* 0x1480 --> 0x1800 unused */
  943. /* Send BD initiator control registers */
  944. #define SNDBDI_MODE 0x00001800
  945. #define SNDBDI_MODE_RESET 0x00000001
  946. #define SNDBDI_MODE_ENABLE 0x00000002
  947. #define SNDBDI_MODE_ATTN_ENABLE 0x00000004
  948. #define SNDBDI_MODE_MULTI_TXQ_EN 0x00000020
  949. #define SNDBDI_STATUS 0x00001804
  950. #define SNDBDI_STATUS_ERROR_ATTN 0x00000004
  951. #define SNDBDI_IN_PROD_IDX_0 0x00001808
  952. #define SNDBDI_IN_PROD_IDX_1 0x0000180c
  953. #define SNDBDI_IN_PROD_IDX_2 0x00001810
  954. #define SNDBDI_IN_PROD_IDX_3 0x00001814
  955. #define SNDBDI_IN_PROD_IDX_4 0x00001818
  956. #define SNDBDI_IN_PROD_IDX_5 0x0000181c
  957. #define SNDBDI_IN_PROD_IDX_6 0x00001820
  958. #define SNDBDI_IN_PROD_IDX_7 0x00001824
  959. #define SNDBDI_IN_PROD_IDX_8 0x00001828
  960. #define SNDBDI_IN_PROD_IDX_9 0x0000182c
  961. #define SNDBDI_IN_PROD_IDX_10 0x00001830
  962. #define SNDBDI_IN_PROD_IDX_11 0x00001834
  963. #define SNDBDI_IN_PROD_IDX_12 0x00001838
  964. #define SNDBDI_IN_PROD_IDX_13 0x0000183c
  965. #define SNDBDI_IN_PROD_IDX_14 0x00001840
  966. #define SNDBDI_IN_PROD_IDX_15 0x00001844
  967. /* 0x1848 --> 0x1c00 unused */
  968. /* Send BD completion control registers */
  969. #define SNDBDC_MODE 0x00001c00
  970. #define SNDBDC_MODE_RESET 0x00000001
  971. #define SNDBDC_MODE_ENABLE 0x00000002
  972. #define SNDBDC_MODE_ATTN_ENABLE 0x00000004
  973. /* 0x1c04 --> 0x2000 unused */
  974. /* Receive list placement control registers */
  975. #define RCVLPC_MODE 0x00002000
  976. #define RCVLPC_MODE_RESET 0x00000001
  977. #define RCVLPC_MODE_ENABLE 0x00000002
  978. #define RCVLPC_MODE_CLASS0_ATTN_ENAB 0x00000004
  979. #define RCVLPC_MODE_MAPOOR_AATTN_ENAB 0x00000008
  980. #define RCVLPC_MODE_STAT_OFLOW_ENAB 0x00000010
  981. #define RCVLPC_STATUS 0x00002004
  982. #define RCVLPC_STATUS_CLASS0 0x00000004
  983. #define RCVLPC_STATUS_MAPOOR 0x00000008
  984. #define RCVLPC_STATUS_STAT_OFLOW 0x00000010
  985. #define RCVLPC_LOCK 0x00002008
  986. #define RCVLPC_LOCK_REQ_MASK 0x0000ffff
  987. #define RCVLPC_LOCK_REQ_SHIFT 0
  988. #define RCVLPC_LOCK_GRANT_MASK 0xffff0000
  989. #define RCVLPC_LOCK_GRANT_SHIFT 16
  990. #define RCVLPC_NON_EMPTY_BITS 0x0000200c
  991. #define RCVLPC_NON_EMPTY_BITS_MASK 0x0000ffff
  992. #define RCVLPC_CONFIG 0x00002010
  993. #define RCVLPC_STATSCTRL 0x00002014
  994. #define RCVLPC_STATSCTRL_ENABLE 0x00000001
  995. #define RCVLPC_STATSCTRL_FASTUPD 0x00000002
  996. #define RCVLPC_STATS_ENABLE 0x00002018
  997. #define RCVLPC_STATSENAB_ASF_FIX 0x00000002
  998. #define RCVLPC_STATSENAB_DACK_FIX 0x00040000
  999. #define RCVLPC_STATSENAB_LNGBRST_RFIX 0x00400000
  1000. #define RCVLPC_STATS_INCMASK 0x0000201c
  1001. /* 0x2020 --> 0x2100 unused */
  1002. #define RCVLPC_SELLST_BASE 0x00002100 /* 16 16-byte entries */
  1003. #define SELLST_TAIL 0x00000004
  1004. #define SELLST_CONT 0x00000008
  1005. #define SELLST_UNUSED 0x0000000c
  1006. #define RCVLPC_COS_CNTL_BASE 0x00002200 /* 16 4-byte entries */
  1007. #define RCVLPC_DROP_FILTER_CNT 0x00002240
  1008. #define RCVLPC_DMA_WQ_FULL_CNT 0x00002244
  1009. #define RCVLPC_DMA_HIPRIO_WQ_FULL_CNT 0x00002248
  1010. #define RCVLPC_NO_RCV_BD_CNT 0x0000224c
  1011. #define RCVLPC_IN_DISCARDS_CNT 0x00002250
  1012. #define RCVLPC_IN_ERRORS_CNT 0x00002254
  1013. #define RCVLPC_RCV_THRESH_HIT_CNT 0x00002258
  1014. /* 0x225c --> 0x2400 unused */
  1015. /* Receive Data and Receive BD Initiator Control */
  1016. #define RCVDBDI_MODE 0x00002400
  1017. #define RCVDBDI_MODE_RESET 0x00000001
  1018. #define RCVDBDI_MODE_ENABLE 0x00000002
  1019. #define RCVDBDI_MODE_JUMBOBD_NEEDED 0x00000004
  1020. #define RCVDBDI_MODE_FRM_TOO_BIG 0x00000008
  1021. #define RCVDBDI_MODE_INV_RING_SZ 0x00000010
  1022. #define RCVDBDI_MODE_LRG_RING_SZ 0x00010000
  1023. #define RCVDBDI_STATUS 0x00002404
  1024. #define RCVDBDI_STATUS_JUMBOBD_NEEDED 0x00000004
  1025. #define RCVDBDI_STATUS_FRM_TOO_BIG 0x00000008
  1026. #define RCVDBDI_STATUS_INV_RING_SZ 0x00000010
  1027. #define RCVDBDI_SPLIT_FRAME_MINSZ 0x00002408
  1028. /* 0x240c --> 0x2440 unused */
  1029. #define RCVDBDI_JUMBO_BD 0x00002440 /* TG3_BDINFO_... */
  1030. #define RCVDBDI_STD_BD 0x00002450 /* TG3_BDINFO_... */
  1031. #define RCVDBDI_MINI_BD 0x00002460 /* TG3_BDINFO_... */
  1032. #define RCVDBDI_JUMBO_CON_IDX 0x00002470
  1033. #define RCVDBDI_STD_CON_IDX 0x00002474
  1034. #define RCVDBDI_MINI_CON_IDX 0x00002478
  1035. /* 0x247c --> 0x2480 unused */
  1036. #define RCVDBDI_BD_PROD_IDX_0 0x00002480
  1037. #define RCVDBDI_BD_PROD_IDX_1 0x00002484
  1038. #define RCVDBDI_BD_PROD_IDX_2 0x00002488
  1039. #define RCVDBDI_BD_PROD_IDX_3 0x0000248c
  1040. #define RCVDBDI_BD_PROD_IDX_4 0x00002490
  1041. #define RCVDBDI_BD_PROD_IDX_5 0x00002494
  1042. #define RCVDBDI_BD_PROD_IDX_6 0x00002498
  1043. #define RCVDBDI_BD_PROD_IDX_7 0x0000249c
  1044. #define RCVDBDI_BD_PROD_IDX_8 0x000024a0
  1045. #define RCVDBDI_BD_PROD_IDX_9 0x000024a4
  1046. #define RCVDBDI_BD_PROD_IDX_10 0x000024a8
  1047. #define RCVDBDI_BD_PROD_IDX_11 0x000024ac
  1048. #define RCVDBDI_BD_PROD_IDX_12 0x000024b0
  1049. #define RCVDBDI_BD_PROD_IDX_13 0x000024b4
  1050. #define RCVDBDI_BD_PROD_IDX_14 0x000024b8
  1051. #define RCVDBDI_BD_PROD_IDX_15 0x000024bc
  1052. #define RCVDBDI_HWDIAG 0x000024c0
  1053. /* 0x24c4 --> 0x2800 unused */
  1054. /* Receive Data Completion Control */
  1055. #define RCVDCC_MODE 0x00002800
  1056. #define RCVDCC_MODE_RESET 0x00000001
  1057. #define RCVDCC_MODE_ENABLE 0x00000002
  1058. #define RCVDCC_MODE_ATTN_ENABLE 0x00000004
  1059. /* 0x2804 --> 0x2c00 unused */
  1060. /* Receive BD Initiator Control Registers */
  1061. #define RCVBDI_MODE 0x00002c00
  1062. #define RCVBDI_MODE_RESET 0x00000001
  1063. #define RCVBDI_MODE_ENABLE 0x00000002
  1064. #define RCVBDI_MODE_RCB_ATTN_ENAB 0x00000004
  1065. #define RCVBDI_STATUS 0x00002c04
  1066. #define RCVBDI_STATUS_RCB_ATTN 0x00000004
  1067. #define RCVBDI_JUMBO_PROD_IDX 0x00002c08
  1068. #define RCVBDI_STD_PROD_IDX 0x00002c0c
  1069. #define RCVBDI_MINI_PROD_IDX 0x00002c10
  1070. #define RCVBDI_MINI_THRESH 0x00002c14
  1071. #define RCVBDI_STD_THRESH 0x00002c18
  1072. #define RCVBDI_JUMBO_THRESH 0x00002c1c
  1073. /* 0x2c20 --> 0x2d00 unused */
  1074. #define STD_REPLENISH_LWM 0x00002d00
  1075. #define JMB_REPLENISH_LWM 0x00002d04
  1076. /* 0x2d08 --> 0x3000 unused */
  1077. /* Receive BD Completion Control Registers */
  1078. #define RCVCC_MODE 0x00003000
  1079. #define RCVCC_MODE_RESET 0x00000001
  1080. #define RCVCC_MODE_ENABLE 0x00000002
  1081. #define RCVCC_MODE_ATTN_ENABLE 0x00000004
  1082. #define RCVCC_STATUS 0x00003004
  1083. #define RCVCC_STATUS_ERROR_ATTN 0x00000004
  1084. #define RCVCC_JUMP_PROD_IDX 0x00003008
  1085. #define RCVCC_STD_PROD_IDX 0x0000300c
  1086. #define RCVCC_MINI_PROD_IDX 0x00003010
  1087. /* 0x3014 --> 0x3400 unused */
  1088. /* Receive list selector control registers */
  1089. #define RCVLSC_MODE 0x00003400
  1090. #define RCVLSC_MODE_RESET 0x00000001
  1091. #define RCVLSC_MODE_ENABLE 0x00000002
  1092. #define RCVLSC_MODE_ATTN_ENABLE 0x00000004
  1093. #define RCVLSC_STATUS 0x00003404
  1094. #define RCVLSC_STATUS_ERROR_ATTN 0x00000004
  1095. /* 0x3408 --> 0x3600 unused */
  1096. #define TG3_CPMU_DRV_STATUS 0x0000344c
  1097. /* CPMU registers */
  1098. #define TG3_CPMU_CTRL 0x00003600
  1099. #define CPMU_CTRL_LINK_IDLE_MODE 0x00000200
  1100. #define CPMU_CTRL_LINK_AWARE_MODE 0x00000400
  1101. #define CPMU_CTRL_LINK_SPEED_MODE 0x00004000
  1102. #define CPMU_CTRL_GPHY_10MB_RXONLY 0x00010000
  1103. #define TG3_CPMU_LSPD_10MB_CLK 0x00003604
  1104. #define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000
  1105. #define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000
  1106. /* 0x3608 --> 0x360c unused */
  1107. #define TG3_CPMU_LSPD_1000MB_CLK 0x0000360c
  1108. #define CPMU_LSPD_1000MB_MACCLK_62_5 0x00000000
  1109. #define CPMU_LSPD_1000MB_MACCLK_12_5 0x00110000
  1110. #define CPMU_LSPD_1000MB_MACCLK_MASK 0x001f0000
  1111. #define TG3_CPMU_LNK_AWARE_PWRMD 0x00003610
  1112. #define CPMU_LNK_AWARE_MACCLK_MASK 0x001f0000
  1113. #define CPMU_LNK_AWARE_MACCLK_6_25 0x00130000
  1114. /* 0x3614 --> 0x361c unused */
  1115. #define TG3_CPMU_HST_ACC 0x0000361c
  1116. #define CPMU_HST_ACC_MACCLK_MASK 0x001f0000
  1117. #define CPMU_HST_ACC_MACCLK_6_25 0x00130000
  1118. /* 0x3620 --> 0x3630 unused */
  1119. #define TG3_CPMU_CLCK_ORIDE 0x00003624
  1120. #define CPMU_CLCK_ORIDE_MAC_ORIDE_EN 0x80000000
  1121. #define TG3_CPMU_CLCK_ORIDE_ENABLE 0x00003628
  1122. #define TG3_CPMU_MAC_ORIDE_ENABLE (1 << 13)
  1123. #define TG3_CPMU_STATUS 0x0000362c
  1124. #define TG3_CPMU_STATUS_FMSK_5717 0x20000000
  1125. #define TG3_CPMU_STATUS_FMSK_5719 0xc0000000
  1126. #define TG3_CPMU_STATUS_FSHFT_5719 30
  1127. #define TG3_CPMU_STATUS_LINK_MASK 0x180000
  1128. #define TG3_CPMU_CLCK_STAT 0x00003630
  1129. #define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000
  1130. #define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000
  1131. #define CPMU_CLCK_STAT_MAC_CLCK_12_5 0x00110000
  1132. #define CPMU_CLCK_STAT_MAC_CLCK_6_25 0x00130000
  1133. /* 0x3634 --> 0x365c unused */
  1134. #define TG3_CPMU_MUTEX_REQ 0x0000365c
  1135. #define CPMU_MUTEX_REQ_DRIVER 0x00001000
  1136. #define TG3_CPMU_MUTEX_GNT 0x00003660
  1137. #define CPMU_MUTEX_GNT_DRIVER 0x00001000
  1138. #define TG3_CPMU_PHY_STRAP 0x00003664
  1139. #define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020
  1140. #define TG3_CPMU_PADRNG_CTL 0x00003668
  1141. #define TG3_CPMU_PADRNG_CTL_RDIV2 0x00040000
  1142. /* 0x3664 --> 0x36b0 unused */
  1143. #define TG3_CPMU_EEE_MODE 0x000036b0
  1144. #define TG3_CPMU_EEEMD_APE_TX_DET_EN 0x00000004
  1145. #define TG3_CPMU_EEEMD_ERLY_L1_XIT_DET 0x00000008
  1146. #define TG3_CPMU_EEEMD_SND_IDX_DET_EN 0x00000040
  1147. #define TG3_CPMU_EEEMD_LPI_ENABLE 0x00000080
  1148. #define TG3_CPMU_EEEMD_LPI_IN_TX 0x00000100
  1149. #define TG3_CPMU_EEEMD_LPI_IN_RX 0x00000200
  1150. #define TG3_CPMU_EEEMD_EEE_ENABLE 0x00100000
  1151. #define TG3_CPMU_EEE_DBTMR1 0x000036b4
  1152. #define TG3_CPMU_DBTMR1_PCIEXIT_2047US 0x07ff0000
  1153. #define TG3_CPMU_DBTMR1_LNKIDLE_2047US 0x000007ff
  1154. #define TG3_CPMU_DBTMR1_LNKIDLE_MAX 0x0000ffff
  1155. #define TG3_CPMU_EEE_DBTMR2 0x000036b8
  1156. #define TG3_CPMU_DBTMR2_APE_TX_2047US 0x07ff0000
  1157. #define TG3_CPMU_DBTMR2_TXIDXEQ_2047US 0x000007ff
  1158. #define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc
  1159. #define TG3_CPMU_EEE_LNKI