changes v3:
- split arch and dts changes
changes v2:
- rebase against latest kernel
- fix networking on RIoTBoard
This patch series tries to remove most of the imx6 and imx7 board
specific PHY configuration via fixup, as this breaks the PHYs when
connected to switch chips or USB Ethernet MACs.
Each patch has the possibility to break boards, but contains a
recommendation to fix the problem in a more portable and future-proof
way.
Oleksij Rempel (7):
ARM i.MX6q: remove PHY fixup for KSZ9031
ARM i.MX6q: remove part of ar8031_phy_fixup()
ARM i.MX6q: remove BMCR_PDOWN handler in ar8035_phy_fixup()
ARM i.MX6q: remove clk-out fixup for the Atheros AR8031 and AR8035
PHYs
ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
ARM: imx6sx: remove Atheros AR8031 PHY fixup
ARM: imx7d: remove Atheros AR8031 PHY fixup
arch/arm/mach-imx/mach-imx6q.c | 85 ---------------------------------
arch/arm/mach-imx/mach-imx6sx.c | 26 ----------
arch/arm/mach-imx/mach-imx7d.c | 22 ---------
3 files changed, 133 deletions(-)
--
2.29.2
This fixup removes the Lpi_en bit.
If this patch breaks functionality of your board, use following device
tree properties: qca,smarteee-tw-us-1g and qca,smarteee-tw-us-100m.
For example:
ethernet-phy@X {
reg = <0xX>;
qca,smarteee-tw-us-1g = <24>;
....
};
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
arch/arm/mach-imx/mach-imx6q.c | 21 ---------------------
1 file changed, 21 deletions(-)
This part of this fixup is overwritten by at803x_config_init() in
drivers/net/phy/at803x.c. No additional devicetree fixes are needed.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
arch/arm/mach-imx/mach-imx6q.c | 6 ------
1 file changed, 6 deletions(-)
Starting with:
bcf3440c6dd7 ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY")
the micrel phy driver started respecting phy-mode for the KSZ9031 PHY.
At least with kernel v5.8 configuration provided by this fixup was
overwritten by the micrel driver.
This fixup was providing following configuration:
RX path: 2.58ns delay
rx -0.42 (left shift) + rx_clk +0.96ns (right shift) =
1,38 + 1,2 internal RX delay = 2.58ns
TX path: 0.96ns delay
tx (no delay) + tx_clk 0.96ns (right shift) = 0.96ns
This configuration is outside of the recommended RGMII clock skew delays
and about in the middle of: rgmii-idrx and rgmii-id
Since most embedded systems do not have enough place to introduce
significant clock skew, rgmii-id is the way to go.
In case this patch breaks network functionality on your system, build
kernel with enabled MICREL_PHY. If it is still not working then try
following device tree options:
1. Set (or change) phy-mode in DT to:
phy-mode = "rgmii-id";
This actives internal delay for both RX and TX.
1. Set (or change) phy-mode in DT to:
phy-mode = "rgmii-idrx";
This actives internal delay for RX only.
3. Use following DT properties:
phy-mode = "rgmii";
txen-skew-psec = <0>;
rxdv-skew-psec = <0>;
rxd0-skew-psec = <0>;
rxd1-skew-psec = <0>;
rxd2-skew-psec = <0>;
rxd3-skew-psec = <0>;
rxc-skew-psec = <1860>;
txc-skew-psec = <1860>;
This activates the internal delays for RX and TX, with the value as
the fixup that is removed in this patch.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
arch/arm/mach-imx/mach-imx6q.c | 23 -----------------------
1 file changed, 23 deletions(-)
This configuration should be set over device tree.
If this patch breaks network functionality on your system, enable the
AT803X_PHY driver and set following device tree property in the PHY
node:
qca,clk-out-frequency = <125000000>;
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
arch/arm/mach-imx/mach-imx6q.c | 30 ------------------------------
1 file changed, 30 deletions(-)
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-05-11 12:50:02
On Tue, May 11, 2021 at 06:37:29AM +0200, Oleksij Rempel wrote:
Starting with:
bcf3440c6dd7 ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY")
the micrel phy driver started respecting phy-mode for the KSZ9031 PHY.
At least with kernel v5.8 configuration provided by this fixup was
overwritten by the micrel driver.
This fixup was providing following configuration:
RX path: 2.58ns delay
rx -0.42 (left shift) + rx_clk +0.96ns (right shift) =
1,38 + 1,2 internal RX delay = 2.58ns
TX path: 0.96ns delay
tx (no delay) + tx_clk 0.96ns (right shift) = 0.96ns
This configuration is outside of the recommended RGMII clock skew delays
and about in the middle of: rgmii-idrx and rgmii-id
Since most embedded systems do not have enough place to introduce
significant clock skew, rgmii-id is the way to go.
In case this patch breaks network functionality on your system, build
kernel with enabled MICREL_PHY. If it is still not working then try
following device tree options:
1. Set (or change) phy-mode in DT to:
phy-mode = "rgmii-id";
This actives internal delay for both RX and TX.
1. Set (or change) phy-mode in DT to:
phy-mode = "rgmii-idrx";
This actives internal delay for RX only.
3. Use following DT properties:
phy-mode = "rgmii";
txen-skew-psec = <0>;
rxdv-skew-psec = <0>;
rxd0-skew-psec = <0>;
rxd1-skew-psec = <0>;
rxd2-skew-psec = <0>;
rxd3-skew-psec = <0>;
rxc-skew-psec = <1860>;
txc-skew-psec = <1860>;
This activates the internal delays for RX and TX, with the value as
the fixup that is removed in this patch.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-05-11 12:50:30
On Tue, May 11, 2021 at 06:37:30AM +0200, Oleksij Rempel wrote:
This part of this fixup is overwritten by at803x_config_init() in
drivers/net/phy/at803x.c. No additional devicetree fixes are needed.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-05-11 12:51:31
On Tue, May 11, 2021 at 06:37:32AM +0200, Oleksij Rempel wrote:
This configuration should be set over device tree.
If this patch breaks network functionality on your system, enable the
AT803X_PHY driver and set following device tree property in the PHY
node:
qca,clk-out-frequency = <125000000>;
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-05-11 12:52:05
On Tue, May 11, 2021 at 06:37:33AM +0200, Oleksij Rempel wrote:
This fixup removes the Lpi_en bit.
If this patch breaks functionality of your board, use following device
tree properties: qca,smarteee-tw-us-1g and qca,smarteee-tw-us-100m.
For example:
ethernet-phy@X {
reg = <0xX>;
qca,smarteee-tw-us-1g = <24>;
....
};
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
On Tue, May 11, 2021 at 06:37:28AM +0200, Oleksij Rempel wrote:
changes v3:
- split arch and dts changes
changes v2:
- rebase against latest kernel
- fix networking on RIoTBoard
This patch series tries to remove most of the imx6 and imx7 board
specific PHY configuration via fixup, as this breaks the PHYs when
connected to switch chips or USB Ethernet MACs.
Each patch has the possibility to break boards, but contains a
recommendation to fix the problem in a more portable and future-proof
way.
Oleksij Rempel (7):
ARM i.MX6q: remove PHY fixup for KSZ9031
ARM i.MX6q: remove part of ar8031_phy_fixup()
ARM i.MX6q: remove BMCR_PDOWN handler in ar8035_phy_fixup()
ARM i.MX6q: remove clk-out fixup for the Atheros AR8031 and AR8035
PHYs
ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
Changed the subject prefix to 'ARM: imx6q: ...', and applied the series.
Shawn