aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
diff options
context:
space:
mode:
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>2012-06-27 17:14:37 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-01 06:34:50 -0400
commitd765955d2ae0b88781a0db3a5bacfe4241925e09 (patch)
treee1906652617da85d0168b5cfe84219f69403e3d0 /drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
parent0ec2ccd0804ebb57a860c59d056a3f420c4f8028 (diff)
stmmac: add the Energy Efficient Ethernet support
This patch adds the Energy Efficient Ethernet support to the stmmac. Please see the driver's documentation for further details about this support in the driver. Thanks also goes to Rayagond Kokatanur for his first implementation. Note: to clearly manage and expose the lpi interrupt status and eee ethtool stats I've had to do some modifications to the driver's design and I found really useful to move other parts of the code (e.g. mmc irq stat) in the main directly. So this means that some core has been reworked to introduce the EEE. v1: initial patch v2: fixed some sparse issues (typos) v3: erroneously sent the v2 renamed as v3 v4: o Fixed the return value of the stmmac_eee_init as suggested by D.Miller o Totally reviewed the ethtool support for EEE o Added a new internal parameter to tune the SW timer for TX LPI. v5: do not change any eee setting in case of the stmmac_ethtool_op_set_eee fails (it has to return -EOPNOTSUPP in that case). 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.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
index 23478bf4ed7a..f90fcb5f9573 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
@@ -36,6 +36,7 @@
36 36
37#define GMAC_INT_STATUS 0x00000038 /* interrupt status register */ 37#define GMAC_INT_STATUS 0x00000038 /* interrupt status register */
38enum dwmac1000_irq_status { 38enum dwmac1000_irq_status {
39 lpiis_irq = 0x400,
39 time_stamp_irq = 0x0200, 40 time_stamp_irq = 0x0200,
40 mmc_rx_csum_offload_irq = 0x0080, 41 mmc_rx_csum_offload_irq = 0x0080,
41 mmc_tx_irq = 0x0040, 42 mmc_tx_irq = 0x0040,
@@ -60,6 +61,25 @@ enum power_event {
60 power_down = 0x00000001, 61 power_down = 0x00000001,
61}; 62};
62 63
64/* Energy Efficient Ethernet (EEE)
65 *
66 * LPI status, timer and control register offset
67 */
68#define LPI_CTRL_STATUS 0x0030
69#define LPI_TIMER_CTRL 0x0034
70
71/* LPI control and status defines */
72#define LPI_CTRL_STATUS_LPITXA 0x00080000 /* Enable LPI TX Automate */
73#define LPI_CTRL_STATUS_PLSEN 0x00040000 /* Enable PHY Link Status */
74#define LPI_CTRL_STATUS_PLS 0x00020000 /* PHY Link Status */
75#define LPI_CTRL_STATUS_LPIEN 0x00010000 /* LPI Enable */
76#define LPI_CTRL_STATUS_RLPIST 0x00000200 /* Receive LPI state */
77#define LPI_CTRL_STATUS_TLPIST 0x00000100 /* Transmit LPI state */
78#define LPI_CTRL_STATUS_RLPIEX 0x00000008 /* Receive LPI Exit */
79#define LPI_CTRL_STATUS_RLPIEN 0x00000004 /* Receive LPI Entry */
80#define LPI_CTRL_STATUS_TLPIEX 0x00000002 /* Transmit LPI Exit */
81#define LPI_CTRL_STATUS_TLPIEN 0x00000001 /* Transmit LPI Entry */
82
63/* GMAC HW ADDR regs */ 83/* GMAC HW ADDR regs */
64#define GMAC_ADDR_HIGH(reg) (((reg > 15) ? 0x00000800 : 0x00000040) + \ 84#define GMAC_ADDR_HIGH(reg) (((reg > 15) ? 0x00000800 : 0x00000040) + \
65 (reg * 8)) 85 (reg * 8))