diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2013-03-26 00:43:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-26 12:53:37 -0400 |
commit | e58bb43f5e438c9e003100a13a168aa90a651faa (patch) | |
tree | 6080e9e389250a87dee03a017091f71bbc0d43b9 /drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | |
parent | 0982a0f6d1be5f03ba62ed1f3deb92e8376b1e43 (diff) |
stmmac: initial support to manage pcs modes
This patch adds the minimal support to manage the PCS
modes (RGMII/SGMII) and restart the ANE.
Both TBI and RTBI are not yet supported.
Thanks to Byungho that wrote some part of this code
and tested SGMII too.
The only thing to be fixed is the get/set pause in
ethtool.
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac1000.h')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h index 6dd689e19f0a..57f4e8f607e9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | |||
@@ -98,6 +98,38 @@ enum power_event { | |||
98 | #define GMAC_TBI 0x000000d4 /* TBI extend status */ | 98 | #define GMAC_TBI 0x000000d4 /* TBI extend status */ |
99 | #define GMAC_S_R_GMII 0x000000d8 /* SGMII RGMII status */ | 99 | #define GMAC_S_R_GMII 0x000000d8 /* SGMII RGMII status */ |
100 | 100 | ||
101 | /* AN Configuration defines */ | ||
102 | #define GMAC_AN_CTRL_RAN 0x00000200 /* Restart Auto-Negotiation */ | ||
103 | #define GMAC_AN_CTRL_ANE 0x00001000 /* Auto-Negotiation Enable */ | ||
104 | #define GMAC_AN_CTRL_ELE 0x00004000 /* External Loopback Enable */ | ||
105 | #define GMAC_AN_CTRL_ECD 0x00010000 /* Enable Comma Detect */ | ||
106 | #define GMAC_AN_CTRL_LR 0x00020000 /* Lock to Reference */ | ||
107 | #define GMAC_AN_CTRL_SGMRAL 0x00040000 /* SGMII RAL Control */ | ||
108 | |||
109 | /* AN Status defines */ | ||
110 | #define GMAC_AN_STATUS_LS 0x00000004 /* Link Status 0:down 1:up */ | ||
111 | #define GMAC_AN_STATUS_ANA 0x00000008 /* Auto-Negotiation Ability */ | ||
112 | #define GMAC_AN_STATUS_ANC 0x00000020 /* Auto-Negotiation Complete */ | ||
113 | #define GMAC_AN_STATUS_ES 0x00000100 /* Extended Status */ | ||
114 | |||
115 | /* Register 54 (SGMII/RGMII status register) */ | ||
116 | #define GMAC_S_R_GMII_LINK 0x8 | ||
117 | #define GMAC_S_R_GMII_SPEED 0x5 | ||
118 | #define GMAC_S_R_GMII_SPEED_SHIFT 0x1 | ||
119 | #define GMAC_S_R_GMII_MODE 0x1 | ||
120 | #define GMAC_S_R_GMII_SPEED_125 2 | ||
121 | #define GMAC_S_R_GMII_SPEED_25 1 | ||
122 | |||
123 | /* Common ADV and LPA defines */ | ||
124 | #define GMAC_ANE_FD (1 << 5) | ||
125 | #define GMAC_ANE_HD (1 << 6) | ||
126 | #define GMAC_ANE_PSE (3 << 7) | ||
127 | #define GMAC_ANE_PSE_SHIFT 7 | ||
128 | |||
129 | /* GMAC Configuration defines */ | ||
130 | #define GMAC_CONTROL_TC 0x01000000 /* Transmit Conf. in RGMII/SGMII */ | ||
131 | #define GMAC_CONTROL_WD 0x00800000 /* Disable Watchdog on receive */ | ||
132 | |||
101 | /* GMAC Configuration defines */ | 133 | /* GMAC Configuration defines */ |
102 | #define GMAC_CONTROL_TC 0x01000000 /* Transmit Conf. in RGMII/SGMII */ | 134 | #define GMAC_CONTROL_TC 0x01000000 /* Transmit Conf. in RGMII/SGMII */ |
103 | #define GMAC_CONTROL_WD 0x00800000 /* Disable Watchdog on receive */ | 135 | #define GMAC_CONTROL_WD 0x00800000 /* Disable Watchdog on receive */ |
@@ -232,5 +264,7 @@ enum rtc_control { | |||
232 | #define GMAC_MMC_TX_INTR 0x108 | 264 | #define GMAC_MMC_TX_INTR 0x108 |
233 | #define GMAC_MMC_RX_CSUM_OFFLOAD 0x208 | 265 | #define GMAC_MMC_RX_CSUM_OFFLOAD 0x208 |
234 | 266 | ||
267 | |||
268 | |||
235 | extern const struct stmmac_dma_ops dwmac1000_dma_ops; | 269 | extern const struct stmmac_dma_ops dwmac1000_dma_ops; |
236 | #endif /* __DWMAC1000_H__ */ | 270 | #endif /* __DWMAC1000_H__ */ |