From: John Crispin <john@phrozen.org> Date: 2016-05-05 09:25:05
This series contains 3 patches. One adds support for fixed-phy, making
boards work where the internal gigabit switch is used. Additionally the
series fixes support for GBit PHYs that so far only worked at 100Mbit.
John Crispin (3):
net-next: mediatek: fix gigabit and flow control advertisement
net-next: mediatek: add fixed-phy support
net-next: mediatek: add RX delay support
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
--
1.7.10.4
From: John Crispin <john@phrozen.org> Date: 2016-05-05 09:24:37
The MT7623 SoC has a builtin gigabit switch. If we want to use it, GMAC1
needs to be configured using a fixed link speed and flow control settings.
The easiest way to do this is to used the fixed-phy driver, allowing us to
reuse the existing mdio polling code to setup the MAC.
Signed-off-by: John Crispin <redacted>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +++
1 file changed, 3 insertions(+)
From: John Crispin <john@phrozen.org> Date: 2016-05-05 09:24:41
The current code will not setup the PHYs advertisement features correctly.
Fix this and properly advertise Gigabit features and properly handle
asymmetric pause frames.
Signed-off-by: John Crispin <redacted>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
@@ -133,6 +133,8 @@ static int mtk_mdio_read(struct mii_bus *bus, int phy_addr, int phy_reg)staticvoidmtk_phy_link_adjust(structnet_device*dev){structmtk_mac*mac=netdev_priv(dev);+u16lcl_adv,rmt_adv=0;+u8flowctrl;u32mcr=MAC_MCR_MAX_RX_1536|MAC_MCR_IPG_CFG|MAC_MCR_FORCE_MODE|MAC_MCR_TX_EN|MAC_MCR_RX_EN|MAC_MCR_BACKOFF_EN|
From: John Crispin <john@phrozen.org> Date: 2016-05-05 09:24:49
If an external Gigabit PHY is connected to either of the MACs we need to
tell the to use a RX delay. Not doing so will result in heavy packet loss
and/or data corruption of RX traffic.
Signed-off-by: John Crispin <redacted>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 1 +
1 file changed, 1 insertion(+)
From: Andrew Lunn <andrew@lunn.ch> Date: 2016-05-05 12:03:06
On Thu, May 05, 2016 at 11:17:35AM +0200, John Crispin wrote:
The MT7623 SoC has a builtin gigabit switch. If we want to use it, GMAC1
needs to be configured using a fixed link speed and flow control settings.
The easiest way to do this is to used the fixed-phy driver, allowing us to
reuse the existing mdio polling code to setup the MAC.
Signed-off-by: John Crispin <john@phrozen.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Looks good.
Andrew
From: Andrew Lunn <andrew@lunn.ch> Date: 2016-05-05 12:14:04
On Thu, May 05, 2016 at 11:17:36AM +0200, John Crispin wrote:
If an external Gigabit PHY is connected to either of the MACs we need to
tell the to use a RX delay. Not doing so will result in heavy packet loss
and/or data corruption of RX traffic.
Hi John
Is this comment correct? Reading the code, all this switch statement
does is select between RGMII, MII and RMII. It has nothing to do with
delay. I suspect the PHY is doing the delay, not the MAC, since you
pass the phy mode to of_phy_connect().
If my interpretation of the code is correct, you might also want to
handle PHY_INTERFACE_MODE_RGMII_TXID and PHY_INTERFACE_MODE_RGMII_ID
which are also RGMII modes.
Andrew
From: John Crispin <john@phrozen.org> Date: 2016-05-05 17:37:46
On 05/05/2016 14:13, Andrew Lunn wrote:
On Thu, May 05, 2016 at 11:17:36AM +0200, John Crispin wrote:
quoted
If an external Gigabit PHY is connected to either of the MACs we need to
tell the to use a RX delay. Not doing so will result in heavy packet loss
and/or data corruption of RX traffic.
Hi John
Is this comment correct? Reading the code, all this switch statement
does is select between RGMII, MII and RMII. It has nothing to do with
delay. I suspect the PHY is doing the delay, not the MAC, since you
pass the phy mode to of_phy_connect().
If my interpretation of the code is correct, you might also want to
handle PHY_INTERFACE_MODE_RGMII_TXID and PHY_INTERFACE_MODE_RGMII_ID
which are also RGMII modes.
Andrew
Hi Andrew,
the comment is indeed incorrect and the PHY needs to handle the delay. i
will send a V2 and also add _TXID and _ID
John
From: David Miller <davem@davemloft.net> Date: 2016-05-05 21:20:40
Sorry, I'm not entertaining 3 seperate patch series for the same
driver at one time. I'm removing all of these mediatek patches
from my queue.
Submit one series at a time please, thanks.