atl1c_hw.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  1. /*
  2. * Copyright(c) 2008 - 2009 Atheros Corporation. All rights reserved.
  3. *
  4. * Derived from Intel e1000 driver
  5. * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the Free
  9. * Software Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along with
  18. * this program; if not, write to the Free Software Foundation, Inc., 59
  19. * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef _ATL1C_HW_H_
  22. #define _ATL1C_HW_H_
  23. #include <linux/types.h>
  24. #include <linux/mii.h>
  25. struct atl1c_adapter;
  26. struct atl1c_hw;
  27. /* function prototype */
  28. void atl1c_phy_disable(struct atl1c_hw *hw);
  29. void atl1c_hw_set_mac_addr(struct atl1c_hw *hw);
  30. int atl1c_phy_reset(struct atl1c_hw *hw);
  31. int atl1c_read_mac_addr(struct atl1c_hw *hw);
  32. int atl1c_get_speed_and_duplex(struct atl1c_hw *hw, u16 *speed, u16 *duplex);
  33. u32 atl1c_hash_mc_addr(struct atl1c_hw *hw, u8 *mc_addr);
  34. void atl1c_hash_set(struct atl1c_hw *hw, u32 hash_value);
  35. int atl1c_read_phy_reg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data);
  36. int atl1c_write_phy_reg(struct atl1c_hw *hw, u32 reg_addr, u16 phy_data);
  37. bool atl1c_read_eeprom(struct atl1c_hw *hw, u32 offset, u32 *p_value);
  38. int atl1c_phy_init(struct atl1c_hw *hw);
  39. int atl1c_check_eeprom_exist(struct atl1c_hw *hw);
  40. int atl1c_restart_autoneg(struct atl1c_hw *hw);
  41. int atl1c_phy_power_saving(struct atl1c_hw *hw);
  42. /* register definition */
  43. #define REG_DEVICE_CAP 0x5C
  44. #define DEVICE_CAP_MAX_PAYLOAD_MASK 0x7
  45. #define DEVICE_CAP_MAX_PAYLOAD_SHIFT 0
  46. #define REG_DEVICE_CTRL 0x60
  47. #define DEVICE_CTRL_MAX_PAYLOAD_MASK 0x7
  48. #define DEVICE_CTRL_MAX_PAYLOAD_SHIFT 5
  49. #define DEVICE_CTRL_MAX_RREQ_SZ_MASK 0x7
  50. #define DEVICE_CTRL_MAX_RREQ_SZ_SHIFT 12
  51. #define REG_LINK_CTRL 0x68
  52. #define LINK_CTRL_L0S_EN 0x01
  53. #define LINK_CTRL_L1_EN 0x02
  54. #define LINK_CTRL_EXT_SYNC 0x80
  55. #define REG_VPD_CAP 0x6C
  56. #define VPD_CAP_ID_MASK 0xff
  57. #define VPD_CAP_ID_SHIFT 0
  58. #define VPD_CAP_NEXT_PTR_MASK 0xFF
  59. #define VPD_CAP_NEXT_PTR_SHIFT 8
  60. #define VPD_CAP_VPD_ADDR_MASK 0x7FFF
  61. #define VPD_CAP_VPD_ADDR_SHIFT 16
  62. #define VPD_CAP_VPD_FLAG 0x80000000
  63. #define REG_VPD_DATA 0x70
  64. #define REG_PCIE_UC_SEVERITY 0x10C
  65. #define PCIE_UC_SERVRITY_TRN 0x00000001
  66. #define PCIE_UC_SERVRITY_DLP 0x00000010
  67. #define PCIE_UC_SERVRITY_PSN_TLP 0x00001000
  68. #define PCIE_UC_SERVRITY_FCP 0x00002000
  69. #define PCIE_UC_SERVRITY_CPL_TO 0x00004000
  70. #define PCIE_UC_SERVRITY_CA 0x00008000
  71. #define PCIE_UC_SERVRITY_UC 0x00010000
  72. #define PCIE_UC_SERVRITY_ROV 0x00020000
  73. #define PCIE_UC_SERVRITY_MLFP 0x00040000
  74. #define PCIE_UC_SERVRITY_ECRC 0x00080000
  75. #define PCIE_UC_SERVRITY_UR 0x00100000
  76. #define REG_DEV_SERIALNUM_CTRL 0x200
  77. #define REG_DEV_MAC_SEL_MASK 0x0 /* 0:EUI; 1:MAC */
  78. #define REG_DEV_MAC_SEL_SHIFT 0
  79. #define REG_DEV_SERIAL_NUM_EN_MASK 0x1
  80. #define REG_DEV_SERIAL_NUM_EN_SHIFT 1
  81. #define REG_TWSI_CTRL 0x218
  82. #define TWSI_CTRL_LD_OFFSET_MASK 0xFF
  83. #define TWSI_CTRL_LD_OFFSET_SHIFT 0
  84. #define TWSI_CTRL_LD_SLV_ADDR_MASK 0x7
  85. #define TWSI_CTRL_LD_SLV_ADDR_SHIFT 8
  86. #define TWSI_CTRL_SW_LDSTART 0x800
  87. #define TWSI_CTRL_HW_LDSTART 0x1000
  88. #define TWSI_CTRL_SMB_SLV_ADDR_MASK 0x7F
  89. #define TWSI_CTRL_SMB_SLV_ADDR_SHIFT 15
  90. #define TWSI_CTRL_LD_EXIST 0x400000
  91. #define TWSI_CTRL_READ_FREQ_SEL_MASK 0x3
  92. #define TWSI_CTRL_READ_FREQ_SEL_SHIFT 23
  93. #define TWSI_CTRL_FREQ_SEL_100K 0
  94. #define TWSI_CTRL_FREQ_SEL_200K 1
  95. #define TWSI_CTRL_FREQ_SEL_300K 2
  96. #define TWSI_CTRL_FREQ_SEL_400K 3
  97. #define TWSI_CTRL_SMB_SLV_ADDR
  98. #define TWSI_CTRL_WRITE_FREQ_SEL_MASK 0x3
  99. #define TWSI_CTRL_WRITE_FREQ_SEL_SHIFT 24
  100. #define REG_PCIE_DEV_MISC_CTRL 0x21C
  101. #define PCIE_DEV_MISC_EXT_PIPE 0x2
  102. #define PCIE_DEV_MISC_RETRY_BUFDIS 0x1
  103. #define PCIE_DEV_MISC_SPIROM_EXIST 0x4
  104. #define PCIE_DEV_MISC_SERDES_ENDIAN 0x8
  105. #define PCIE_DEV_MISC_SERDES_SEL_DIN 0x10
  106. #define REG_PCIE_PHYMISC 0x1000
  107. #define PCIE_PHYMISC_FORCE_RCV_DET 0x4
  108. #define REG_PCIE_PHYMISC2 0x1004
  109. #define PCIE_PHYMISC2_SERDES_CDR_MASK 0x3
  110. #define PCIE_PHYMISC2_SERDES_CDR_SHIFT 16
  111. #define PCIE_PHYMISC2_SERDES_TH_MASK 0x3
  112. #define PCIE_PHYMISC2_SERDES_TH_SHIFT 18
  113. #define REG_TWSI_DEBUG 0x1108
  114. #define TWSI_DEBUG_DEV_EXIST 0x20000000
  115. #define REG_EEPROM_CTRL 0x12C0
  116. #define EEPROM_CTRL_DATA_HI_MASK 0xFFFF
  117. #define EEPROM_CTRL_DATA_HI_SHIFT 0
  118. #define EEPROM_CTRL_ADDR_MASK 0x3FF
  119. #define EEPROM_CTRL_ADDR_SHIFT 16
  120. #define EEPROM_CTRL_ACK 0x40000000
  121. #define EEPROM_CTRL_RW 0x80000000
  122. #define REG_EEPROM_DATA_LO 0x12C4
  123. #define REG_OTP_CTRL 0x12F0
  124. #define OTP_CTRL_CLK_EN 0x0002
  125. #define REG_PM_CTRL 0x12F8
  126. #define PM_CTRL_SDES_EN 0x00000001
  127. #define PM_CTRL_RBER_EN 0x00000002
  128. #define PM_CTRL_CLK_REQ_EN 0x00000004
  129. #define PM_CTRL_ASPM_L1_EN 0x00000008
  130. #define PM_CTRL_SERDES_L1_EN 0x00000010
  131. #define PM_CTRL_SERDES_PLL_L1_EN 0x00000020
  132. #define PM_CTRL_SERDES_PD_EX_L1 0x00000040
  133. #define PM_CTRL_SERDES_BUDS_RX_L1_EN 0x00000080
  134. #define PM_CTRL_L0S_ENTRY_TIMER_MASK 0xF
  135. #define PM_CTRL_L0S_ENTRY_TIMER_SHIFT 8
  136. #define PM_CTRL_ASPM_L0S_EN 0x00001000
  137. #define PM_CTRL_CLK_SWH_L1 0x00002000
  138. #define PM_CTRL_CLK_PWM_VER1_1 0x00004000
  139. #define PM_CTRL_RCVR_WT_TIMER 0x00008000
  140. #define PM_CTRL_L1_ENTRY_TIMER_MASK 0xF
  141. #define PM_CTRL_L1_ENTRY_TIMER_SHIFT 16
  142. #define PM_CTRL_PM_REQ_TIMER_MASK 0xF
  143. #define PM_CTRL_PM_REQ_TIMER_SHIFT 20
  144. #define PM_CTRL_LCKDET_TIMER_MASK 0xF
  145. #define PM_CTRL_LCKDET_TIMER_SHIFT 24
  146. #define PM_CTRL_EN_BUFS_RX_L0S 0x10000000
  147. #define PM_CTRL_SA_DLY_EN 0x20000000
  148. #define PM_CTRL_MAC_ASPM_CHK 0x40000000
  149. #define PM_CTRL_HOTRST 0x80000000
  150. #define REG_LTSSM_ID_CTRL 0x12FC
  151. #define LTSSM_ID_EN_WRO 0x1000
  152. /* Selene Master Control Register */
  153. #define REG_MASTER_CTRL 0x1400
  154. #define MASTER_CTRL_SOFT_RST 0x1
  155. #define MASTER_CTRL_TEST_MODE_MASK 0x3
  156. #define MASTER_CTRL_TEST_MODE_SHIFT 2
  157. #define MASTER_CTRL_BERT_START 0x10
  158. #define MASTER_CTRL_OOB_DIS_OFF 0x40
  159. #define MASTER_CTRL_SA_TIMER_EN 0x80
  160. #define MASTER_CTRL_MTIMER_EN 0x100
  161. #define MASTER_CTRL_MANUAL_INT 0x200
  162. #define MASTER_CTRL_TX_ITIMER_EN 0x400
  163. #define MASTER_CTRL_RX_ITIMER_EN 0x800
  164. #define MASTER_CTRL_CLK_SEL_DIS 0x1000
  165. #define MASTER_CTRL_CLK_SWH_MODE 0x2000
  166. #define MASTER_CTRL_INT_RDCLR 0x4000
  167. #define MASTER_CTRL_REV_NUM_SHIFT 16
  168. #define MASTER_CTRL_REV_NUM_MASK 0xff
  169. #define MASTER_CTRL_DEV_ID_SHIFT 24
  170. #define MASTER_CTRL_DEV_ID_MASK 0x7f
  171. #define MASTER_CTRL_OTP_SEL 0x80000000
  172. /* Timer Initial Value Register */
  173. #define REG_MANUAL_TIMER_INIT 0x1404
  174. /* IRQ ModeratorTimer Initial Value Register */
  175. #define REG_IRQ_MODRT_TIMER_INIT 0x1408
  176. #define IRQ_MODRT_TIMER_MASK 0xffff
  177. #define IRQ_MODRT_TX_TIMER_SHIFT 0
  178. #define IRQ_MODRT_RX_TIMER_SHIFT 16
  179. #define REG_GPHY_CTRL 0x140C
  180. #define GPHY_CTRL_EXT_RESET 0x1
  181. #define GPHY_CTRL_RTL_MODE 0x2
  182. #define GPHY_CTRL_LED_MODE 0x4
  183. #define GPHY_CTRL_ANEG_NOW 0x8
  184. #define GPHY_CTRL_REV_ANEG 0x10
  185. #define GPHY_CTRL_GATE_25M_EN 0x20
  186. #define GPHY_CTRL_LPW_EXIT 0x40
  187. #define GPHY_CTRL_PHY_IDDQ 0x80
  188. #define GPHY_CTRL_PHY_IDDQ_DIS 0x100
  189. #define GPHY_CTRL_GIGA_DIS 0x200
  190. #define GPHY_CTRL_HIB_EN 0x400
  191. #define GPHY_CTRL_HIB_PULSE 0x800
  192. #define GPHY_CTRL_SEL_ANA_RST 0x1000
  193. #define GPHY_CTRL_PHY_PLL_ON 0x2000
  194. #define GPHY_CTRL_PWDOWN_HW 0x4000
  195. #define GPHY_CTRL_PHY_PLL_BYPASS 0x8000
  196. #define GPHY_CTRL_DEFAULT ( \
  197. GPHY_CTRL_SEL_ANA_RST |\
  198. GPHY_CTRL_HIB_PULSE |\
  199. GPHY_CTRL_HIB_EN)
  200. #define GPHY_CTRL_PW_WOL_DIS ( \
  201. GPHY_CTRL_SEL_ANA_RST |\
  202. GPHY_CTRL_HIB_PULSE |\
  203. GPHY_CTRL_HIB_EN |\
  204. GPHY_CTRL_PWDOWN_HW |\
  205. GPHY_CTRL_PHY_IDDQ)
  206. #define GPHY_CTRL_POWER_SAVING ( \
  207. GPHY_CTRL_SEL_ANA_RST |\
  208. GPHY_CTRL_HIB_EN |\
  209. GPHY_CTRL_HIB_PULSE |\
  210. GPHY_CTRL_PWDOWN_HW |\
  211. GPHY_CTRL_PHY_IDDQ)
  212. /* Block IDLE Status Register */
  213. #define REG_IDLE_STATUS 0x1410
  214. #define IDLE_STATUS_MASK 0x00FF
  215. #define IDLE_STATUS_RXMAC_NO_IDLE 0x1
  216. #define IDLE_STATUS_TXMAC_NO_IDLE 0x2
  217. #define IDLE_STATUS_RXQ_NO_IDLE 0x4
  218. #define IDLE_STATUS_TXQ_NO_IDLE 0x8
  219. #define IDLE_STATUS_DMAR_NO_IDLE 0x10
  220. #define IDLE_STATUS_DMAW_NO_IDLE 0x20
  221. #define IDLE_STATUS_SMB_NO_IDLE 0x40
  222. #define IDLE_STATUS_CMB_NO_IDLE 0x80
  223. /* MDIO Control Register */
  224. #define REG_MDIO_CTRL 0x1414
  225. #define MDIO_DATA_MASK 0xffff /* On MDIO write, the 16-bit
  226. * control data to write to PHY
  227. * MII management register */
  228. #define MDIO_DATA_SHIFT 0 /* On MDIO read, the 16-bit
  229. * status data that was read
  230. * from the PHY MII management register */
  231. #define MDIO_REG_ADDR_MASK 0x1f /* MDIO register address */
  232. #define MDIO_REG_ADDR_SHIFT 16
  233. #define MDIO_RW 0x200000 /* 1: read, 0: write */
  234. #define MDIO_SUP_PREAMBLE 0x400000 /* Suppress preamble */
  235. #define MDIO_START 0x800000 /* Write 1 to initiate the MDIO
  236. * master. And this bit is self
  237. * cleared after one cycle */
  238. #define MDIO_CLK_SEL_SHIFT 24
  239. #define MDIO_CLK_25_4 0
  240. #define MDIO_CLK_25_6 2
  241. #define MDIO_CLK_25_8 3
  242. #define MDIO_CLK_25_10 4
  243. #define MDIO_CLK_25_14 5
  244. #define MDIO_CLK_25_20 6
  245. #define MDIO_CLK_25_28 7
  246. #define MDIO_BUSY 0x8000000
  247. #define MDIO_AP_EN 0x10000000
  248. #define MDIO_WAIT_TIMES 10
  249. /* MII PHY Status Register */
  250. #define REG_PHY_STATUS 0x1418
  251. #define PHY_GENERAL_STATUS_MASK 0xFFFF
  252. #define PHY_STATUS_RECV_ENABLE 0x0001
  253. #define PHY_OE_PWSP_STATUS_MASK 0x07FF
  254. #define PHY_OE_PWSP_STATUS_SHIFT 16
  255. #define PHY_STATUS_LPW_STATE 0x80000000
  256. /* BIST Control and Status Register0 (for the Packet Memory) */
  257. #define REG_BIST0_CTRL 0x141c
  258. #define BIST0_NOW 0x1
  259. #define BIST0_SRAM_FAIL 0x2 /* 1: The SRAM failure is
  260. * un-repairable because
  261. * it has address decoder
  262. * failure or more than 1 cell
  263. * stuck-to-x failure */
  264. #define BIST0_FUSE_FLAG 0x4
  265. /* BIST Control and Status Register1(for the retry buffer of PCI Express) */
  266. #define REG_BIST1_CTRL 0x1420
  267. #define BIST1_NOW 0x1
  268. #define BIST1_SRAM_FAIL 0x2
  269. #define BIST1_FUSE_FLAG 0x4
  270. /* SerDes Lock Detect Control and Status Register */
  271. #define REG_SERDES_LOCK 0x1424
  272. #define SERDES_LOCK_DETECT 0x1 /* SerDes lock detected. This signal
  273. * comes from Analog SerDes */
  274. #define SERDES_LOCK_DETECT_EN 0x2 /* 1: Enable SerDes Lock detect function */
  275. #define SERDES_LOCK_STS_SELFB_PLL_SHIFT 0xE
  276. #define SERDES_LOCK_STS_SELFB_PLL_MASK 0x3
  277. #define SERDES_OVCLK_18_25 0x0
  278. #define SERDES_OVCLK_12_18 0x1
  279. #define SERDES_OVCLK_0_4 0x2
  280. #define SERDES_OVCLK_4_12 0x3
  281. #define SERDES_MAC_CLK_SLOWDOWN 0x20000
  282. #define SERDES_PYH_CLK_SLOWDOWN 0x40000
  283. /* MAC Control Register */
  284. #define REG_MAC_CTRL 0x1480
  285. #define MAC_CTRL_TX_EN 0x1
  286. #define MAC_CTRL_RX_EN 0x2
  287. #define MAC_CTRL_TX_FLOW 0x4
  288. #define MAC_CTRL_RX_FLOW 0x8
  289. #define MAC_CTRL_LOOPBACK 0x10
  290. #define MAC_CTRL_DUPLX 0x20
  291. #define MAC_CTRL_ADD_CRC 0x40
  292. #define MAC_CTRL_PAD 0x80
  293. #define MAC_CTRL_LENCHK 0x100
  294. #define MAC_CTRL_HUGE_EN 0x200
  295. #define MAC_CTRL_PRMLEN_SHIFT 10
  296. #define MAC_CTRL_PRMLEN_MASK 0xf
  297. #define MAC_CTRL_RMV_VLAN 0x4000
  298. #define MAC_CTRL_PROMIS_EN 0x8000
  299. #define MAC_CTRL_TX_PAUSE 0x10000
  300. #define MAC_CTRL_SCNT 0x20000
  301. #define MAC_CTRL_SRST_TX 0x40000
  302. #define MAC_CTRL_TX_SIMURST 0x80000
  303. #define MAC_CTRL_SPEED_SHIFT 20
  304. #define MAC_CTRL_SPEED_MASK 0x3
  305. #define MAC_CTRL_DBG_TX_BKPRESURE 0x400000
  306. #define MAC_CTRL_TX_HUGE 0x800000
  307. #define MAC_CTRL_RX_CHKSUM_EN 0x1000000
  308. #define MAC_CTRL_MC_ALL_EN 0x2000000
  309. #define MAC_CTRL_BC_EN 0x4000000
  310. #define MAC_CTRL_DBG 0x8000000
  311. #define MAC_CTRL_SINGLE_PAUSE_EN 0x10000000
  312. #define MAC_CTRL_HASH_ALG_CRC32 0x20000000
  313. #define MAC_CTRL_SPEED_MODE_SW 0x40000000
  314. /* MAC IPG/IFG Control Register */
  315. #define REG_MAC_IPG_IFG 0x1484
  316. #define MAC_IPG_IFG_IPGT_SHIFT 0 /* Desired back to back
  317. * inter-packet gap. The
  318. * default is 96-bit time */
  319. #define MAC_IPG_IFG_IPGT_MASK 0x7f
  320. #define MAC_IPG_IFG_MIFG_SHIFT 8 /* Minimum number of IFG to
  321. * enforce in between RX frames */
  322. #define MAC_IPG_IFG_MIFG_MASK 0xff /* Frame gap below such IFP is dropped */
  323. #define MAC_IPG_IFG_IPGR1_SHIFT 16 /* 64bit Carrier-Sense window */
  324. #define MAC_IPG_IFG_IPGR1_MASK 0x7f
  325. #define MAC_IPG_IFG_IPGR2_SHIFT 24 /* 96-bit IPG window */
  326. #define MAC_IPG_IFG_IPGR2_MASK 0x7f
  327. /* MAC STATION ADDRESS */
  328. #define REG_MAC_STA_ADDR 0x1488
  329. /* Hash table for multicast address */
  330. #define REG_RX_HASH_TABLE 0x1490
  331. /* MAC Half-Duplex Control Register */
  332. #define REG_MAC_HALF_DUPLX_CTRL 0x1498
  333. #define MAC_HALF_DUPLX_CTRL_LCOL_SHIFT 0 /* Collision Window */
  334. #define MAC_HALF_DUPLX_CTRL_LCOL_MASK 0x3ff
  335. #define MAC_HALF_DUPLX_CTRL_RETRY_SHIFT 12
  336. #define MAC_HALF_DUPLX_CTRL_RETRY_MASK 0xf
  337. #define MAC_HALF_DUPLX_CTRL_EXC_DEF_EN 0x10000
  338. #define MAC_HALF_DUPLX_CTRL_NO_BACK_C 0x20000
  339. #define MAC_HALF_DUPLX_CTRL_NO_BACK_P 0x40000 /* No back-off on backpressure,
  340. * immediately start the
  341. * transmission after back pressure */
  342. #define MAC_HALF_DUPLX_CTRL_ABEBE 0x80000 /* 1: Alternative Binary Exponential Back-off Enabled */
  343. #define MAC_HALF_DUPLX_CTRL_ABEBT_SHIFT 20 /* Maximum binary exponential number */
  344. #define MAC_HALF_DUPLX_CTRL_ABEBT_MASK 0xf
  345. #define MAC_HALF_DUPLX_CTRL_JAMIPG_SHIFT 24 /* IPG to start JAM for collision based flow control in half-duplex */
  346. #define MAC_HALF_DUPLX_CTRL_JAMIPG_MASK 0xf /* mode. In unit of 8-bit time */
  347. /* Maximum Frame Length Control Register */
  348. #define REG_MTU 0x149c
  349. /* Wake-On-Lan control register */
  350. #define REG_WOL_CTRL 0x14a0
  351. #define WOL_PATTERN_EN 0x00000001
  352. #define WOL_PATTERN_PME_EN 0x00000002
  353. #define WOL_MAGIC_EN 0x00000004
  354. #define WOL_MAGIC_PME_EN 0x00000008
  355. #define WOL_LINK_CHG_EN 0x00000010
  356. #define WOL_LINK_CHG_PME_EN 0x00000020
  357. #define WOL_PATTERN_ST 0x00000100
  358. #define WOL_MAGIC_ST 0x00000200
  359. #define WOL_LINKCHG_ST 0x00000400
  360. #define WOL_CLK_SWITCH_EN 0x00008000
  361. #define WOL_PT0_EN 0x00010000
  362. #define WOL_PT1_EN 0x00020000
  363. #define WOL_PT2_EN 0x00040000
  364. #define WOL_PT3_EN 0x00080000
  365. #define WOL_PT4_EN 0x00100000
  366. #define WOL_PT5_EN 0x00200000
  367. #define WOL_PT6_EN 0x00400000
  368. /* WOL Length ( 2 DWORD ) */
  369. #define REG_WOL_PATTERN_LEN 0x14a4
  370. #define WOL_PT_LEN_MASK 0x7f
  371. #define WOL_PT0_LEN_SHIFT 0
  372. #define WOL_PT1_LEN_SHIFT 8
  373. #define WOL_PT2_LEN_SHIFT 16
  374. #define WOL_PT3_LEN_SHIFT 24
  375. #define WOL_PT4_LEN_SHIFT 0
  376. #define WOL_PT5_LEN_SHIFT 8
  377. #define WOL_PT6_LEN_SHIFT 16
  378. /* Internal SRAM Partition Register */
  379. #define RFDX_HEAD_ADDR_MASK 0x03FF
  380. #define RFDX_HARD_ADDR_SHIFT 0
  381. #define RFDX_TAIL_ADDR_MASK 0x03FF
  382. #define RFDX_TAIL_ADDR_SHIFT 16
  383. #define REG_SRAM_RFD0_INFO 0x1500
  384. #define REG_SRAM_RFD1_INFO 0x1504
  385. #define REG_SRAM_RFD2_INFO 0x1508
  386. #define REG_SRAM_RFD3_INFO 0x150C
  387. #define REG_RFD_NIC_LEN 0x1510 /* In 8-bytes */
  388. #define RFD_NIC_LEN_MASK 0x03FF
  389. #define REG_SRAM_TRD_ADDR 0x1518
  390. #define TPD_HEAD_ADDR_MASK 0x03FF
  391. #define TPD_HEAD_ADDR_SHIFT 0
  392. #define TPD_TAIL_ADDR_MASK 0x03FF
  393. #define TPD_TAIL_ADDR_SHIFT 16
  394. #define REG_SRAM_TRD_LEN 0x151C /* In 8-bytes */
  395. #define TPD_NIC_LEN_MASK 0x03FF
  396. #define REG_SRAM_RXF_ADDR 0x1520
  397. #define REG_SRAM_RXF_LEN 0x1524
  398. #define REG_SRAM_TXF_ADDR 0x1528
  399. #define REG_SRAM_TXF_LEN 0x152C
  400. #define REG_SRAM_TCPH_ADDR 0x1530
  401. #define REG_SRAM_PKTH_ADDR 0x1532
  402. /*
  403. * Load Ptr Register
  404. * Software sets this bit after the initialization of the head and tail */
  405. #define REG_LOAD_PTR 0x1534
  406. /*
  407. * addresses of all descriptors, as well as the following descriptor
  408. * control register, which triggers each function block to load the head
  409. * pointer to prepare for the operation. This bit is then self-cleared
  410. * after one cycle.
  411. */
  412. #define REG_RX_BASE_ADDR_HI 0x1540
  413. #define REG_TX_BASE_ADDR_HI 0x1544
  414. #define REG_SMB_BASE_ADDR_HI 0x1548
  415. #define REG_SMB_BASE_ADDR_LO 0x154C
  416. #define REG_RFD0_HEAD_ADDR_LO 0x1550
  417. #define REG_RFD1_HEAD_ADDR_LO 0x1554
  418. #define REG_RFD2_HEAD_ADDR_LO 0x1558
  419. #define REG_RFD3_HEAD_ADDR_LO 0x155C
  420. #define REG_RFD_RING_SIZE 0x1560
  421. #define RFD_RING_SIZE_MASK 0x0FFF
  422. #define REG_RX_BUF_SIZE 0x1564
  423. #define RX_BUF_SIZE_MASK 0xFFFF
  424. #define REG_RRD0_HEAD_ADDR_LO 0x1568
  425. #define REG_RRD1_HEAD_ADDR_LO 0x156C
  426. #define REG_RRD2_HEAD_ADDR_LO 0x1570
  427. #define REG_RRD3_HEAD_ADDR_LO 0x1574
  428. #define REG_RRD_RING_SIZE 0x1578
  429. #define RRD_RING_SIZE_MASK 0x0FFF
  430. #define REG_HTPD_HEAD_ADDR_LO 0x157C
  431. #define REG_NTPD_HEAD_ADDR_LO 0x1580
  432. #define REG_TPD_RING_SIZE 0x1584
  433. #define TPD_RING_SIZE_MASK 0xFFFF
  434. #define REG_CMB_BASE_ADDR_LO 0x1588
  435. /* RSS about */
  436. #define REG_RSS_KEY0 0x14B0
  437. #define REG_RSS_KEY1 0x14B4
  438. #define REG_RSS_KEY2 0x14B8
  439. #define REG_RSS_KEY3 0x14BC
  440. #define REG_RSS_KEY4 0x14C0
  441. #define REG_RSS_KEY5 0x14C4
  442. #define REG_RSS_KEY6 0x14C8
  443. #define REG_RSS_KEY7 0x14CC
  444. #define REG_RSS_KEY8 0x14D0
  445. #define REG_RSS_KEY9 0x14D4
  446. #define REG_IDT_TABLE0 0x14E0
  447. #define REG_IDT_TABLE1 0x14E4
  448. #define REG_IDT_TABLE2 0x14E8
  449. #define REG_IDT_TABLE3 0x14EC
  450. #define REG_IDT_TABLE4 0x14F0
  451. #define REG_IDT_TABLE5 0x14F4
  452. #define REG_IDT_TABLE6 0x14F8
  453. #define REG_IDT_TABLE7 0x14FC
  454. #define REG_IDT_TABLE REG_IDT_TABLE0
  455. #define REG_RSS_HASH_VALUE 0x15B0
  456. #define REG_RSS_HASH_FLAG 0x15B4
  457. #define REG_BASE_CPU_NUMBER 0x15B8
  458. /* TXQ Control Register */
  459. #define REG_TXQ_CTRL 0x1590
  460. #define TXQ_NUM_TPD_BURST_MASK 0xF
  461. #define TXQ_NUM_TPD_BURST_SHIFT 0
  462. #define TXQ_CTRL_IP_OPTION_EN 0x10
  463. #define TXQ_CTRL_EN 0x20
  464. #define TXQ_CTRL_ENH_MODE 0x40
  465. #define TXQ_CTRL_LS_8023_EN 0x80
  466. #define TXQ_TXF_BURST_NUM_SHIFT 16
  467. #define TXQ_TXF_BURST_NUM_MASK 0xFFFF
  468. /* Jumbo packet Threshold for task offload */
  469. #define REG_TX_TSO_OFFLOAD_THRESH 0x1594 /* In 8-bytes */
  470. #define TX_TSO_OFFLOAD_THRESH_MASK 0x07FF
  471. #define REG_TXF_WATER_MARK 0x1598 /* In 8-bytes */
  472. #define TXF_WATER_MARK_MASK 0x0FFF
  473. #define TXF_LOW_WATER_MARK_SHIFT 0
  474. #define TXF_HIGH_WATER_MARK_SHIFT 16
  475. #define TXQ_CTRL_BURST_MODE_EN 0x80000000
  476. #define REG_THRUPUT_MON_CTRL 0x159C
  477. #define THRUPUT_MON_RATE_MASK 0x3
  478. #define THRUPUT_MON_RATE_SHIFT 0
  479. #define THRUPUT_MON_EN 0x80
  480. /* RXQ Control Register */
  481. #define REG_RXQ_CTRL 0x15A0
  482. #define ASPM_THRUPUT_LIMIT_MASK 0x3
  483. #define ASPM_THRUPUT_LIMIT_SHIFT 0
  484. #define ASPM_THRUPUT_LIMIT_NO 0x00
  485. #define ASPM_THRUPUT_LIMIT_1M 0x01
  486. #define ASPM_THRUPUT_LIMIT_10M 0x02
  487. #define ASPM_THRUPUT_LIMIT_100M 0x04
  488. #define RXQ1_CTRL_EN 0x10
  489. #define RXQ2_CTRL_EN 0x20
  490. #define RXQ3_CTRL_EN 0x40
  491. #define IPV6_CHKSUM_CTRL_EN 0x80
  492. #define RSS_HASH_BITS_MASK 0x00FF
  493. #define RSS_HASH_BITS_SHIFT 8
  494. #define RSS_HASH_IPV4 0x10000
  495. #define RSS_HASH_IPV4_TCP 0x20000
  496. #define RSS_HASH_IPV6 0x40000
  497. #define RSS_HASH_IPV6_TCP 0x80000
  498. #define RXQ_RFD_BURST_NUM_MASK 0x003F
  499. #define RXQ_RFD_BURST_NUM_SHIFT 20
  500. #define RSS_MODE_MASK 0x0003
  501. #define RSS_MODE_SHIFT 26
  502. #define RSS_NIP_QUEUE_SEL_MASK 0x1
  503. #define RSS_NIP_QUEUE_SEL_SHIFT 28
  504. #define RRS_HASH_CTRL_EN 0x20000000
  505. #define RX_CUT_THRU_EN 0x40000000
  506. #define RXQ_CTRL_EN 0x80000000
  507. #define REG_RFD_FREE_THRESH 0x15A4
  508. #define RFD_FREE_THRESH_MASK 0x003F
  509. #define RFD_FREE_HI_THRESH_SHIFT 0
  510. #define RFD_FREE_LO_THRESH_SHIFT 6
  511. /* RXF flow control register */
  512. #define REG_RXQ_RXF_PAUSE_THRESH 0x15A8
  513. #define RXQ_RXF_PAUSE_TH_HI_SHIFT 0
  514. #define RXQ_RXF_PAUSE_TH_HI_MASK 0x0FFF
  515. #define RXQ_RXF_PAUSE_TH_LO_SHIFT 16
  516. #define RXQ_RXF_PAUSE_TH_LO_MASK 0x0FFF
  517. #define REG_RXD_DMA_CTRL 0x15AC
  518. #define RXD_DMA_THRESH_MASK 0x0FFF /* In 8-bytes */
  519. #define RXD_DMA_THRESH_SHIFT 0
  520. #define RXD_DMA_DOWN_TIMER_MASK 0xFFFF
  521. #define RXD_DMA_DOWN_TIMER_SHIFT 16
  522. /* DMA Engine Control Register */
  523. #define REG_DMA_CTRL 0x15C0
  524. #define DMA_CTRL_DMAR_IN_ORDER 0x1
  525. #define DMA_CTRL_DMAR_ENH_ORDER 0x2
  526. #define DMA_CTRL_DMAR_OUT_ORDER 0x4
  527. #define DMA_CTRL_RCB_VALUE 0x8
  528. #define DMA_CTRL_DMAR_BURST_LEN_MASK 0x0007
  529. #define DMA_CTRL_DMAR_BURST_LEN_SHIFT 4
  530. #define DMA_CTRL_DMAW_BURST_LEN_MASK 0x0007
  531. #define DMA_CTRL_DMAW_BURST_LEN_SHIFT 7
  532. #define DMA_CTRL_DMAR_REQ_PRI 0x400
  533. #define DMA_CTRL_DMAR_DLY_CNT_MASK 0x001F
  534. #define DMA_CTRL_DMAR_DLY_CNT_SHIFT 11
  535. #define DMA_CTRL_DMAW_DLY_CNT_MASK 0x000F
  536. #define DMA_CTRL_DMAW_DLY_CNT_SHIFT 16
  537. #define DMA_CTRL_CMB_EN 0x100000
  538. #define DMA_CTRL_SMB_EN 0x200000
  539. #define DMA_CTRL_CMB_NOW 0x400000
  540. #define MAC_CTRL_SMB_DIS 0x1000000
  541. #define DMA_CTRL_SMB_NOW 0x80000000
  542. /* CMB/SMB Control Register */
  543. #define REG_SMB_STAT_TIMER 0x15C4 /* 2us resolution */
  544. #define SMB_STAT_TIMER_MASK 0xFFFFFF
  545. #define REG_CMB_TPD_THRESH 0x15C8
  546. #define CMB_TPD_THRESH_MASK 0xFFFF
  547. #define REG_CMB_TX_TIMER 0x15CC /* 2us resolution */
  548. #define CMB_TX_TIMER_MASK 0xFFFF
  549. /* Mail box */
  550. #define MB_RFDX_PROD_IDX_MASK 0xFFFF
  551. #define REG_MB_RFD0_PROD_IDX 0x15E0
  552. #define REG_MB_RFD1_PROD_IDX 0x15E4
  553. #define REG_MB_RFD2_PROD_IDX 0x15E8
  554. #define REG_MB_RFD3_PROD_IDX 0x15EC
  555. #define MB_PRIO_PROD_IDX_MASK 0xFFFF
  556. #define REG_MB_PRIO_PROD_IDX 0x15F0
  557. #define MB_HTPD_PROD_IDX_SHIFT 0
  558. #define MB_NTPD_PROD_IDX_SHIFT 16
  559. #define MB_PRIO_CONS_IDX_MASK 0xFFFF
  560. #define REG_MB_PRIO_CONS_IDX 0x15F4
  561. #define MB_HTPD_CONS_IDX_SHIFT 0
  562. #define MB_NTPD_CONS_IDX_SHIFT 16
  563. #define REG_MB_RFD01_CONS_IDX 0x15F8
  564. #define MB_RFD0_CONS_IDX_MASK 0x0000FFFF
  565. #define MB_RFD1_CONS_IDX_MASK 0xFFFF0000
  566. #define REG_MB_RFD23_CONS_IDX 0x15FC
  567. #define MB_RFD2_CONS_IDX_MASK 0x0000FFFF
  568. #define MB_RFD3_CONS_IDX_MASK 0xFFFF0000
  569. /* Interrupt Status Register */
  570. #define REG_ISR 0x1600
  571. #define ISR_SMB 0x00000001
  572. #define ISR_TIMER 0x00000002
  573. /*
  574. * Software manual interrupt, for debug. Set when SW_MAN_INT_EN is set
  575. * in Table 51 Selene Master Control Register (Offset 0x1400).
  576. */
  577. #define ISR_MANUAL 0x00000004
  578. #define ISR_HW_RXF_OV 0x00000008 /* RXF overflow interrupt */
  579. #define ISR_RFD0_UR 0x00000010 /* RFD0 under run */
  580. #define ISR_RFD1_UR 0x00000020
  581. #define ISR_RFD2_UR 0x00000040
  582. #define ISR_RFD3_UR 0x00000080
  583. #define ISR_TXF_UR 0x00000100
  584. #define ISR_DMAR_TO_RST 0x00000200
  585. #define ISR_DMAW_TO_RST 0x00000400
  586. #define ISR_TX_CREDIT 0x00000800
  587. #define ISR_GPHY 0x00001000
  588. /* GPHY low power state interrupt */
  589. #define ISR_GPHY_LPW 0x00002000
  590. #define ISR_TXQ_TO_RST 0x00004000
  591. #define ISR_TX_PKT 0x00008000
  592. #define ISR_RX_PKT_0 0x00010000
  593. #define ISR_RX_PKT_1 0x00020000
  594. #define ISR_RX_PKT_2 0x00040000
  595. #define ISR_RX_PKT_3 0x00080000
  596. #define ISR_MAC_RX 0x00100000
  597. #define ISR_MAC_TX 0x00200000
  598. #define ISR_UR_DETECTED 0x00400000
  599. #define ISR_FERR_DETECTED 0x00800000
  600. #define ISR_NFERR_DETECTED 0x01000000
  601. #define ISR_CERR_DETECTED 0x02000000
  602. #define ISR_PHY_LINKDOWN 0x04000000
  603. #define ISR_DIS_INT 0x80000000
  604. /* Interrupt Mask Register */
  605. #define REG_IMR 0x1604
  606. #define IMR_NORMAL_MASK (\
  607. ISR_MANUAL |\
  608. ISR_HW_RXF_OV |\
  609. ISR_RFD0_UR |\
  610. ISR_TXF_UR |\
  611. ISR_DMAR_TO_RST |\
  612. ISR_TXQ_TO_RST |\
  613. ISR_DMAW_TO_RST |\
  614. ISR_GPHY |\
  615. ISR_TX_PKT |\
  616. ISR_RX_PKT_0 |\
  617. ISR_GPHY_LPW |\
  618. ISR_PHY_LINKDOWN)
  619. #define ISR_RX_PKT (\
  620. ISR_RX_PKT_0 |\
  621. ISR_RX_PKT_1 |\
  622. ISR_RX_PKT_2 |\
  623. ISR_RX_PKT_3)
  624. #define ISR_OVER (\
  625. ISR_RFD0_UR |\
  626. ISR_RFD1_UR |\
  627. ISR_RFD2_UR |\
  628. ISR_RFD3_UR |\
  629. ISR_HW_RXF_OV |\
  630. ISR_TXF_UR)
  631. #define ISR_ERROR (\
  632. ISR_DMAR_TO_RST |\
  633. ISR_TXQ_TO_RST |\
  634. ISR_DMAW_TO_RST |\
  635. ISR_PHY_LINKDOWN)
  636. #define REG_INT_RETRIG_TIMER 0x1608
  637. #define INT_RETRIG_TIMER_MASK 0xFFFF
  638. #define REG_HDS_CTRL 0x160C
  639. #define HDS_CTRL_EN 0x0001
  640. #define HDS_CTRL_BACKFILLSIZE_SHIFT 8
  641. #define HDS_CTRL_BACKFILLSIZE_MASK 0x0FFF
  642. #define HDS_CTRL_MAX_HDRSIZE_SHIFT 20
  643. #define HDS_CTRL_MAC_HDRSIZE_MASK 0x0FFF
  644. #define REG_MAC_RX_STATUS_BIN 0x1700
  645. #define REG_MAC_RX_STATUS_END 0x175c
  646. #define REG_MAC_TX_STATUS_BIN 0x1760
  647. #define REG_MAC_TX_STATUS_END 0x17c0
  648. #define REG_CLK_GATING_CTRL 0x1814
  649. #define CLK_GATING_DMAW_EN 0x0001
  650. #define CLK_GATING_DMAR_EN 0x0002
  651. #define CLK_GATING_TXQ_EN 0x0004
  652. #define CLK_GATING_RXQ_EN 0x0008
  653. #define CLK_GATING_TXMAC_EN 0x0010
  654. #define CLK_GATING_RXMAC_EN 0x0020
  655. #define CLK_GATING_EN_ALL (CLK_GATING_DMAW_EN |\
  656. CLK_GATING_DMAR_EN |\
  657. CLK_GATING_TXQ_EN |\
  658. CLK_GATING_RXQ_EN |\
  659. CLK_GATING_TXMAC_EN|\
  660. CLK_GATING_RXMAC_EN)
  661. /* DEBUG ADDR */
  662. #define REG_DEBUG_DATA0 0x1900
  663. #define REG_DEBUG_DATA1 0x1904
  664. #define L1D_MPW_PHYID1 0xD01C /* V7 */
  665. #define L1D_MPW_PHYID2 0xD01D /* V1-V6 */
  666. #define L1D_MPW_PHYID3 0xD01E /* V8 */
  667. /* Autoneg Advertisement Register */
  668. #define ADVERTISE_DEFAULT_CAP \
  669. (ADVERTISE_ALL | ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM)
  670. /* 1000BASE-T Control Register */
  671. #define GIGA_CR_1000T_REPEATER_DTE 0x0400 /* 1=Repeater/switch device port 0=DTE device */
  672. #define GIGA_CR_1000T_MS_VALUE 0x0800 /* 1=Configure PHY as Master 0=Configure PHY as Slave */
  673. #define GIGA_CR_1000T_MS_ENABLE 0x1000 /* 1=Master/Slave manual config value 0=Automatic Master/Slave config */
  674. #define GIGA_CR_1000T_TEST_MODE_NORMAL 0x0000 /* Normal Operation */
  675. #define GIGA_CR_1000T_TEST_MODE_1 0x2000 /* Transmit Waveform test */
  676. #define GIGA_CR_1000T_TEST_MODE_2 0x4000 /* Master Transmit Jitter test */
  677. #define GIGA_CR_1000T_TEST_MODE_3 0x6000 /* Slave Transmit Jitter test */
  678. #define GIGA_CR_1000T_TEST_MODE_4 0x8000 /* Transmitter Distortion test */
  679. #define GIGA_CR_1000T_SPEED_MASK 0x0300
  680. #define GIGA_CR_1000T_DEFAULT_CAP 0x0300
  681. /* PHY Specific Status Register */
  682. #define MII_GIGA_PSSR 0x11
  683. #define GIGA_PSSR_SPD_DPLX_RESOLVED 0x0800 /* 1=Speed & Duplex resolved */
  684. #define GIGA_PSSR_DPLX 0x2000 /* 1=Duplex 0=Half Duplex */
  685. #define GIGA_PSSR_SPEED 0xC000 /* Speed, bits 14:15 */
  686. #define GIGA_PSSR_10MBS 0x0000 /* 00=10Mbs */
  687. #define GIGA_PSSR_100MBS 0x4000 /* 01=100Mbs */
  688. #define GIGA_PSSR_1000MBS 0x8000 /* 10=1000Mbs */
  689. /* PHY Interrupt Enable Register */
  690. #define MII_IER 0x12
  691. #define IER_LINK_UP 0x0400
  692. #define IER_LINK_DOWN 0x0800
  693. /* PHY Interrupt Status Register */
  694. #define MII_ISR 0x13
  695. #define ISR_LINK_UP 0x0400
  696. #define ISR_LINK_DOWN 0x0800
  697. /* Cable-Detect-Test Control Register */
  698. #define MII_CDTC 0x16
  699. #define CDTC_EN_OFF 0 /* sc */
  700. #define CDTC_EN_BITS 1
  701. #define CDTC_PAIR_OFF 8
  702. #define CDTC_PAIR_BIT 2
  703. /* Cable-Detect-Test Status Register */
  704. #define MII_CDTS 0x1C
  705. #define CDTS_STATUS_OFF 8
  706. #define CDTS_STATUS_BITS 2
  707. #define CDTS_STATUS_NORMAL 0
  708. #define CDTS_STATUS_SHORT 1
  709. #define CDTS_STATUS_OPEN 2
  710. #define CDTS_STATUS_INVALID 3
  711. #define MII_DBG_ADDR 0x1D
  712. #define MII_DBG_DATA 0x1E
  713. #define MII_ANA_CTRL_0 0x0
  714. #define ANA_RESTART_CAL 0x0001
  715. #define ANA_MANUL_SWICH_ON_SHIFT 0x1
  716. #define ANA_MANUL_SWICH_ON_MASK 0xF
  717. #define ANA_MAN_ENABLE 0x0020
  718. #define ANA_SEL_HSP 0x0040
  719. #define ANA_EN_HB 0x0080
  720. #define ANA_EN_HBIAS 0x0100
  721. #define ANA_OEN_125M 0x0200
  722. #define ANA_EN_LCKDT 0x0400
  723. #define ANA_LCKDT_PHY 0x0800
  724. #define ANA_AFE_MODE 0x1000
  725. #define ANA_VCO_SLOW 0x2000
  726. #define ANA_VCO_FAST 0x4000
  727. #define ANA_SEL_CLK125M_DSP 0x8000
  728. #define MII_ANA_CTRL_4 0x4
  729. #define ANA_IECHO_ADJ_MASK 0xF
  730. #define ANA_IECHO_ADJ_3_SHIFT 0
  731. #define ANA_IECHO_ADJ_2_SHIFT 4
  732. #define ANA_IECHO_ADJ_1_SHIFT 8
  733. #define ANA_IECHO_ADJ_0_SHIFT 12
  734. #define MII_ANA_CTRL_5 0x5
  735. #define ANA_SERDES_CDR_BW_SHIFT 0
  736. #define ANA_SERDES_CDR_BW_MASK 0x3
  737. #define ANA_MS_PAD_DBG 0x0004
  738. #define ANA_SPEEDUP_DBG 0x0008
  739. #define ANA_SERDES_TH_LOS_SHIFT 4
  740. #define ANA_SERDES_TH_LOS_MASK 0x3
  741. #define ANA_SERDES_EN_DEEM 0x0040
  742. #define ANA_SERDES_TXELECIDLE 0x0080
  743. #define ANA_SERDES_BEACON 0x0100
  744. #define ANA_SERDES_HALFTXDR 0x0200
  745. #define ANA_SERDES_SEL_HSP 0x0400
  746. #define ANA_SERDES_EN_PLL 0x0800
  747. #define ANA_SERDES_EN 0x1000
  748. #define ANA_SERDES_EN_LCKDT 0x2000
  749. #define MII_ANA_CTRL_11 0xB
  750. #define ANA_PS_HIB_EN 0x8000
  751. #define MII_ANA_CTRL_18 0x12
  752. #define ANA_TEST_MODE_10BT_01SHIFT 0
  753. #define ANA_TEST_MODE_10BT_01MASK 0x3
  754. #define ANA_LOOP_SEL_10BT 0x0004
  755. #define ANA_RGMII_MODE_SW 0x0008
  756. #define ANA_EN_LONGECABLE 0x0010
  757. #define ANA_TEST_MODE_10BT_2 0x0020
  758. #define ANA_EN_10BT_IDLE 0x0400
  759. #define ANA_EN_MASK_TB 0x0800
  760. #define ANA_TRIGGER_SEL_TIMER_SHIFT 12
  761. #define ANA_TRIGGER_SEL_TIMER_MASK 0x3
  762. #define ANA_INTERVAL_SEL_TIMER_SHIFT 14
  763. #define ANA_INTERVAL_SEL_TIMER_MASK 0x3
  764. #define MII_ANA_CTRL_41 0x29
  765. #define ANA_TOP_PS_EN 0x8000
  766. #define MII_ANA_CTRL_54 0x36
  767. #define ANA_LONG_CABLE_TH_100_SHIFT 0
  768. #define ANA_LONG_CABLE_TH_100_MASK 0x3F
  769. #define ANA_DESERVED 0x0040
  770. #define ANA_EN_LIT_CH 0x0080
  771. #define ANA_SHORT_CABLE_TH_100_SHIFT 8
  772. #define ANA_SHORT_CABLE_TH_100_MASK 0x3F
  773. #define ANA_BP_BAD_LINK_ACCUM 0x4000
  774. #define ANA_BP_SMALL_BW 0x8000
  775. #endif /*_ATL1C_HW_H_*/