* [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes
@ 2014-08-28 6:11 Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 1/4] stmmac: fix the EEE LPI Macro definitions Giuseppe Cavallaro
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Giuseppe Cavallaro @ 2014-08-28 6:11 UTC (permalink / raw)
To: netdev; +Cc: davem, Giuseppe Cavallaro
This is a subset of patches to provide some fixes for the EEE support inside the
driver.
Patches have been tested on boards EEE capable plugged on switch w/ w/o EEE
support.
Giuseppe CAVALLARO (1):
stmmac: never check EEE in case of a switch is attached
Giuseppe Cavallaro (1):
stmmac: fix PLS bit setting when EEE is active
nandini sharma (2):
stmmac: fix the EEE LPI Macro definitions.
stmmac: fix LPI TW timer value to 20.5us.
drivers/net/ethernet/stmicro/stmmac/common.h | 10 +++++-----
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++++----
2 files changed, 13 insertions(+), 9 deletions(-)
--
1.7.4.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH (net.git) 1/4] stmmac: fix the EEE LPI Macro definitions.
2014-08-28 6:11 [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes Giuseppe Cavallaro
@ 2014-08-28 6:11 ` Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 2/4] stmmac: fix LPI TW timer value to 20.5us Giuseppe Cavallaro
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Giuseppe Cavallaro @ 2014-08-28 6:11 UTC (permalink / raw)
To: netdev; +Cc: davem, nandini sharma, Giuseppe Cavallaro
From: nandini sharma <nandini.sharma@st.com>
This patch is to fix the definition of macros for EEE otherwise the LPI TX/RX
entry/exit cannot be properly managed.
Signed-off-by: Nandini Sharma <nandini.sharma@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/ethernet/stmicro/stmmac/common.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index de507c3..a464e8c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -220,10 +220,10 @@ enum dma_irq_status {
handle_tx = 0x8,
};
-#define CORE_IRQ_TX_PATH_IN_LPI_MODE (1 << 1)
-#define CORE_IRQ_TX_PATH_EXIT_LPI_MODE (1 << 2)
-#define CORE_IRQ_RX_PATH_IN_LPI_MODE (1 << 3)
-#define CORE_IRQ_RX_PATH_EXIT_LPI_MODE (1 << 4)
+#define CORE_IRQ_TX_PATH_IN_LPI_MODE (1 << 0)
+#define CORE_IRQ_TX_PATH_EXIT_LPI_MODE (1 << 1)
+#define CORE_IRQ_RX_PATH_IN_LPI_MODE (1 << 2)
+#define CORE_IRQ_RX_PATH_EXIT_LPI_MODE (1 << 3)
#define CORE_PCS_ANE_COMPLETE (1 << 5)
#define CORE_PCS_LINK_STATUS (1 << 6)
--
1.7.4.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH (net.git) 2/4] stmmac: fix LPI TW timer value to 20.5us.
2014-08-28 6:11 [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 1/4] stmmac: fix the EEE LPI Macro definitions Giuseppe Cavallaro
@ 2014-08-28 6:11 ` Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 3/4 (v2)] stmmac: never check EEE in case of a switch is attached Giuseppe Cavallaro
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Giuseppe Cavallaro @ 2014-08-28 6:11 UTC (permalink / raw)
To: netdev; +Cc: davem, nandini sharma, Giuseppe Cavallaro
From: nandini sharma <nandini.sharma@st.com>
The value for LPI TW timer has to be updated to 0x1E that is the hardcoded value
of 20.5us and it will apply to all EEE enabled Remote PHYs.
Disadvantage is for PHY's that support lesser wakeup time but we can accept it
waiting to implement LLDP to negotiate the Wakeup time of Remote PHY.
Signed-off-by: nandini sharma <nandini.sharma@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/ethernet/stmicro/stmmac/common.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index a464e8c..9f3e8b4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -287,7 +287,7 @@ struct dma_features {
/* Default LPI timers */
#define STMMAC_DEFAULT_LIT_LS 0x3E8
-#define STMMAC_DEFAULT_TWT_LS 0x0
+#define STMMAC_DEFAULT_TWT_LS 0x1E
#define STMMAC_CHAIN_MODE 0x1
#define STMMAC_RING_MODE 0x2
--
1.7.4.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH (net.git) 3/4 (v2)] stmmac: never check EEE in case of a switch is attached
2014-08-28 6:11 [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 1/4] stmmac: fix the EEE LPI Macro definitions Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 2/4] stmmac: fix LPI TW timer value to 20.5us Giuseppe Cavallaro
@ 2014-08-28 6:11 ` Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 4/4] stmmac: fix PLS bit setting when EEE is active Giuseppe Cavallaro
2014-09-01 5:01 ` [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Giuseppe Cavallaro @ 2014-08-28 6:11 UTC (permalink / raw)
To: netdev; +Cc: davem, Giuseppe CAVALLARO
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
This patch is to skip the EEE initialisation when the stmmac
is using a switch (with a fixed phy support).
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
v2: review local variable declarations
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 51a89d4..b8d931e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -275,6 +275,7 @@ static void stmmac_eee_ctrl_timer(unsigned long arg)
*/
bool stmmac_eee_init(struct stmmac_priv *priv)
{
+ char *phy_bus_name = priv->plat->phy_bus_name;
bool ret = false;
/* Using PCS we cannot dial with the phy registers at this stage
@@ -284,6 +285,10 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
(priv->pcs == STMMAC_PCS_RTBI))
goto out;
+ /* Never init EEE in case of a switch is attached */
+ if (phy_bus_name && (!strcmp(phy_bus_name, "fixed")))
+ goto out;
+
/* MAC core supports the EEE feature. */
if (priv->dma_cap.eee) {
int tx_lpi_timer = priv->tx_lpi_timer;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH (net.git) 4/4] stmmac: fix PLS bit setting when EEE is active
2014-08-28 6:11 [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes Giuseppe Cavallaro
` (2 preceding siblings ...)
2014-08-28 6:11 ` [PATCH (net.git) 3/4 (v2)] stmmac: never check EEE in case of a switch is attached Giuseppe Cavallaro
@ 2014-08-28 6:11 ` Giuseppe Cavallaro
2014-09-01 5:01 ` [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Giuseppe Cavallaro @ 2014-08-28 6:11 UTC (permalink / raw)
To: netdev; +Cc: davem, Giuseppe Cavallaro, nandini sharma
In case of PLS is active the PLS (PHY Link Status) bit in
the Reg12 has to be set to allow the MAC to asserts the LPI
pattern when the link is ok.
Signed-off-by: nandini sharma <nandini.sharma@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index b8d931e..eb5b7c4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -321,10 +321,9 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
priv->hw->mac->set_eee_timer(priv->hw,
STMMAC_DEFAULT_LIT_LS,
tx_lpi_timer);
- } else
- /* Set HW EEE according to the speed */
- priv->hw->mac->set_eee_pls(priv->hw,
- priv->phydev->link);
+ }
+ /* Set HW EEE according to the speed */
+ priv->hw->mac->set_eee_pls(priv->hw, priv->phydev->link);
pr_debug("stmmac: Energy-Efficient Ethernet initialized\n");
--
1.7.4.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes
2014-08-28 6:11 [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes Giuseppe Cavallaro
` (3 preceding siblings ...)
2014-08-28 6:11 ` [PATCH (net.git) 4/4] stmmac: fix PLS bit setting when EEE is active Giuseppe Cavallaro
@ 2014-09-01 5:01 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-09-01 5:01 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: netdev
From: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Date: Thu, 28 Aug 2014 08:11:40 +0200
> This is a subset of patches to provide some fixes for the EEE support inside the
> driver.
> Patches have been tested on boards EEE capable plugged on switch w/ w/o EEE
> support.
Series applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-09-01 5:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28 6:11 [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 1/4] stmmac: fix the EEE LPI Macro definitions Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 2/4] stmmac: fix LPI TW timer value to 20.5us Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 3/4 (v2)] stmmac: never check EEE in case of a switch is attached Giuseppe Cavallaro
2014-08-28 6:11 ` [PATCH (net.git) 4/4] stmmac: fix PLS bit setting when EEE is active Giuseppe Cavallaro
2014-09-01 5:01 ` [PATCH (net.git) 0/4 (v2)] stmmac EEE fixes David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).