Skip to contentSkip to conversation

ARM: imx: stop adjusting ar8031 phy tx delay

PATCH Applied André Draszik 2 participants 2 messages Aug 9, 2019 – Aug 19, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: stop adjusting ar8031 phy tx delay

Recent changes to the Atheros at803x driver cause the approach taken here to stop working because commit 6d4cd041f0af
("net: phy: at803x: disable delay only for RGMII mode") and commit cd28d1d6e52e
("net: phy: at803x: Disable phy delay for RGMII mode") fix the AR8031 driver to configure the phy's (RX/TX) delays as per the 'phy-mode' in the device tree.

In particular, the phy tx (and rx) delays are updated again as per the 'phy-mode' *after* the code in here runs.

Things worked before above commits, because the AR8031 comes out of reset with RX delay enabled, and the at803x driver didn't touch the delay configuration at all when "rgmii" mode was selected.

It appears the code in here tries to make device trees work that incorrectly specify "rgmii", but that can't work any more and it is imperative since above commits to have the phy-mode configured correctly in the device tree.

I suspect there are a few imx7d based boards using the ar8031 phy and phy-mode = "rgmii", but given I don't know which ones exactly, I am not in a position to update the respective device trees.

Hence this patch is simply removing the superfluous code from the imx7d initialisation. An alternative could be to add a warning instead, but that would penalize all boards that have been updated already.

CC Russell King <[email protected]>
CC Shawn Guo <[email protected]>
CC Sascha Hauer <[email protected]>
CC Pengutronix Kernel Team <[email protected]>
CC Fabio Estevam <[email protected]>
CC NXP Linux Team <[email protected]>
CC Kate Stewart <[email protected]>
CC Greg Kroah-Hartman <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Leonard Crestez <[email protected]>
---
 arch/arm/mach-imx/mach-imx7d.c | 6 ------
 1 file changed, 6 deletions(-)
arch/arm/mach-imx/mach-imx7d.c +0 -6
index 95713450591a..ebb27592a9f7 100644
@@ -30,12 +30,6 @@ static int ar8031_phy_fixup(struct phy_device *dev)
 	val &= ~(0x1 << 8);
 	phy_write(dev, 0xe, val);
 
-	/* introduce tx clock delay */
-	phy_write(dev, 0x1d, 0x5);
-	val = phy_read(dev, 0x1e);
-	val |= 0x0100;
-	phy_write(dev, 0x1e, val);
-
 	return 0;
 }
 
Signature · 1 line
2.20.1
Applied
#1 lore raw
Quoted 34 lines · André Draszik

Recent changes to the Atheros at803x driver cause the approach taken here to stop working because commit 6d4cd041f0af
("net: phy: at803x: disable delay only for RGMII mode") and commit cd28d1d6e52e
("net: phy: at803x: Disable phy delay for RGMII mode") fix the AR8031 driver to configure the phy's (RX/TX) delays as per the 'phy-mode' in the device tree.

In particular, the phy tx (and rx) delays are updated again as per the 'phy-mode' *after* the code in here runs.

Things worked before above commits, because the AR8031 comes out of reset with RX delay enabled, and the at803x driver didn't touch the delay configuration at all when "rgmii" mode was selected.

It appears the code in here tries to make device trees work that incorrectly specify "rgmii", but that can't work any more and it is imperative since above commits to have the phy-mode configured correctly in the device tree.

I suspect there are a few imx7d based boards using the ar8031 phy and phy-mode = "rgmii", but given I don't know which ones exactly, I am not in a position to update the respective device trees.

Hence this patch is simply removing the superfluous code from the imx7d initialisation. An alternative could be to add a warning instead, but that would penalize all boards that have been updated already.

Quoted 12 lines
CC Russell King <[email protected]>
CC Shawn Guo <[email protected]>
CC Sascha Hauer <[email protected]>
CC Pengutronix Kernel Team <[email protected]>
CC Fabio Estevam <[email protected]>
CC NXP Linux Team <[email protected]>
CC Kate Stewart <[email protected]>
CC Greg Kroah-Hartman <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Leonard Crestez <[email protected]>

Applied, thanks.