All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/7] remove different PHY fixups
@ 2021-02-03  9:18 ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Oleksij Rempel, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Russell King,
	Philippe Schenker

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.

regards,
Oleksij

Oleksij Rempel (7):
  ARM i.MX6q: remove PHY fixup for KSZ9031
  ARM i.MX6q: remove TX clock delay of ar8031_phy_fixup()
  ARM i.MX6q: remove hand crafted PHY power up 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/boot/dts/imx6q-dmo-edmqmx6.dts |  2 +-
 arch/arm/mach-imx/mach-imx6q.c          | 85 -------------------------
 arch/arm/mach-imx/mach-imx6sx.c         | 26 --------
 arch/arm/mach-imx/mach-imx7d.c          | 22 -------
 4 files changed, 1 insertion(+), 134 deletions(-)

-- 
2.30.0


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v1 0/7] remove different PHY fixups
@ 2021-02-03  9:18 ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Philippe Schenker, netdev, linux-kernel, Russell King,
	Oleksij Rempel, linux-imx, kernel, David Jander, Fabio Estevam,
	linux-arm-kernel

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.

regards,
Oleksij

Oleksij Rempel (7):
  ARM i.MX6q: remove PHY fixup for KSZ9031
  ARM i.MX6q: remove TX clock delay of ar8031_phy_fixup()
  ARM i.MX6q: remove hand crafted PHY power up 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/boot/dts/imx6q-dmo-edmqmx6.dts |  2 +-
 arch/arm/mach-imx/mach-imx6q.c          | 85 -------------------------
 arch/arm/mach-imx/mach-imx6sx.c         | 26 --------
 arch/arm/mach-imx/mach-imx7d.c          | 22 -------
 4 files changed, 1 insertion(+), 134 deletions(-)

-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v1 1/7] ARM i.MX6q: remove PHY fixup for KSZ9031
  2021-02-03  9:18 ` Oleksij Rempel
@ 2021-02-03  9:18   ` Oleksij Rempel
  -1 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Oleksij Rempel, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Russell King,
	Philippe Schenker

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/boot/dts/imx6q-dmo-edmqmx6.dts |  2 +-
 arch/arm/mach-imx/mach-imx6q.c          | 23 -----------------------
 2 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
index fa2307d8ce86..c713ac03b3b9 100644
--- a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
+++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
@@ -112,7 +112,7 @@ flash: m25p80@0 {
 &fec {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_enet>;
-	phy-mode = "rgmii";
+	phy-mode = "rgmii-id";
 	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
 	phy-supply = <&vgen2_1v2_eth>;
 	status = "okay";
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 703998ebb52e..78205f90da27 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -40,27 +40,6 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev)
 	return 0;
 }
 
-static void mmd_write_reg(struct phy_device *dev, int device, int reg, int val)
-{
-	phy_write(dev, 0x0d, device);
-	phy_write(dev, 0x0e, reg);
-	phy_write(dev, 0x0d, (1 << 14) | device);
-	phy_write(dev, 0x0e, val);
-}
-
-static int ksz9031rn_phy_fixup(struct phy_device *dev)
-{
-	/*
-	 * min rx data delay, max rx/tx clock delay,
-	 * min rx/tx control delay
-	 */
-	mmd_write_reg(dev, 2, 4, 0);
-	mmd_write_reg(dev, 2, 5, 0);
-	mmd_write_reg(dev, 2, 8, 0x003ff);
-
-	return 0;
-}
-
 /*
  * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
  * as they are used for slots1-7 PERST#
@@ -152,8 +131,6 @@ static void __init imx6q_enet_phy_init(void)
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
 		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
 				ksz9021rn_phy_fixup);
-		phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
-				ksz9031rn_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
 				ar8031_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 1/7] ARM i.MX6q: remove PHY fixup for KSZ9031
@ 2021-02-03  9:18   ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Philippe Schenker, netdev, linux-kernel, Russell King,
	Oleksij Rempel, linux-imx, kernel, David Jander, Fabio Estevam,
	linux-arm-kernel

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/boot/dts/imx6q-dmo-edmqmx6.dts |  2 +-
 arch/arm/mach-imx/mach-imx6q.c          | 23 -----------------------
 2 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
index fa2307d8ce86..c713ac03b3b9 100644
--- a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
+++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
@@ -112,7 +112,7 @@ flash: m25p80@0 {
 &fec {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_enet>;
-	phy-mode = "rgmii";
+	phy-mode = "rgmii-id";
 	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
 	phy-supply = <&vgen2_1v2_eth>;
 	status = "okay";
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 703998ebb52e..78205f90da27 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -40,27 +40,6 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev)
 	return 0;
 }
 
-static void mmd_write_reg(struct phy_device *dev, int device, int reg, int val)
-{
-	phy_write(dev, 0x0d, device);
-	phy_write(dev, 0x0e, reg);
-	phy_write(dev, 0x0d, (1 << 14) | device);
-	phy_write(dev, 0x0e, val);
-}
-
-static int ksz9031rn_phy_fixup(struct phy_device *dev)
-{
-	/*
-	 * min rx data delay, max rx/tx clock delay,
-	 * min rx/tx control delay
-	 */
-	mmd_write_reg(dev, 2, 4, 0);
-	mmd_write_reg(dev, 2, 5, 0);
-	mmd_write_reg(dev, 2, 8, 0x003ff);
-
-	return 0;
-}
-
 /*
  * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
  * as they are used for slots1-7 PERST#
@@ -152,8 +131,6 @@ static void __init imx6q_enet_phy_init(void)
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
 		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
 				ksz9021rn_phy_fixup);
-		phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
-				ksz9031rn_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
 				ar8031_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 2/7] ARM i.MX6q: remove TX clock delay of ar8031_phy_fixup()
  2021-02-03  9:18 ` Oleksij Rempel
@ 2021-02-03  9:18   ` Oleksij Rempel
  -1 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Oleksij Rempel, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Russell King,
	Philippe Schenker

In case the at803x PHY driver is activated in the kernel, the TX clock
fixup is overwritten by at803x_config_init(), in this case no additional
device tree changes are needed.

If this patch breaks your system, please enable AT803X_PHY driver and
add the following device tree property to the PHY node:

    phy-mode = "rgmii-txid";

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx6q.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 78205f90da27..1abefe7e1c3a 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -82,12 +82,6 @@ static int ar8031_phy_fixup(struct phy_device *dev)
 	val |= 0x18;
 	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;
 }
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 2/7] ARM i.MX6q: remove TX clock delay of ar8031_phy_fixup()
@ 2021-02-03  9:18   ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Philippe Schenker, netdev, linux-kernel, Russell King,
	Oleksij Rempel, linux-imx, kernel, David Jander, Fabio Estevam,
	linux-arm-kernel

In case the at803x PHY driver is activated in the kernel, the TX clock
fixup is overwritten by at803x_config_init(), in this case no additional
device tree changes are needed.

If this patch breaks your system, please enable AT803X_PHY driver and
add the following device tree property to the PHY node:

    phy-mode = "rgmii-txid";

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx6q.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 78205f90da27..1abefe7e1c3a 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -82,12 +82,6 @@ static int ar8031_phy_fixup(struct phy_device *dev)
 	val |= 0x18;
 	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;
 }
 
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 3/7] ARM i.MX6q: remove hand crafted PHY power up in ar8035_phy_fixup()
  2021-02-03  9:18 ` Oleksij Rempel
@ 2021-02-03  9:18   ` Oleksij Rempel
  -1 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Oleksij Rempel, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Russell King,
	Philippe Schenker

The at803x_resume() handler in the at803x.c PHY driver powers up the PHY
properly, so remove this fixup.

If this patch breaks your system, enable the AT803X_PHY driver.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx6q.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 1abefe7e1c3a..4c840e116003 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -110,11 +110,6 @@ static int ar8035_phy_fixup(struct phy_device *dev)
 	 */
 	ar8031_phy_fixup(dev);
 
-	/*check phy power*/
-	val = phy_read(dev, 0x0);
-	if (val & BMCR_PDOWN)
-		phy_write(dev, 0x0, val & ~BMCR_PDOWN);
-
 	return 0;
 }
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 3/7] ARM i.MX6q: remove hand crafted PHY power up in ar8035_phy_fixup()
@ 2021-02-03  9:18   ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Philippe Schenker, netdev, linux-kernel, Russell King,
	Oleksij Rempel, linux-imx, kernel, David Jander, Fabio Estevam,
	linux-arm-kernel

The at803x_resume() handler in the at803x.c PHY driver powers up the PHY
properly, so remove this fixup.

If this patch breaks your system, enable the AT803X_PHY driver.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx6q.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 1abefe7e1c3a..4c840e116003 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -110,11 +110,6 @@ static int ar8035_phy_fixup(struct phy_device *dev)
 	 */
 	ar8031_phy_fixup(dev);
 
-	/*check phy power*/
-	val = phy_read(dev, 0x0);
-	if (val & BMCR_PDOWN)
-		phy_write(dev, 0x0, val & ~BMCR_PDOWN);
-
 	return 0;
 }
 
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 4/7] ARM i.MX6q: remove clk-out fixup for the Atheros AR8031 and AR8035 PHYs
  2021-02-03  9:18 ` Oleksij Rempel
@ 2021-02-03  9:18   ` Oleksij Rempel
  -1 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Oleksij Rempel, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Russell King,
	Philippe Schenker

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(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 4c840e116003..d12b571a61ac 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -68,25 +68,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, ventana_pciesw_early_fixup);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, ventana_pciesw_early_fixup);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, ventana_pciesw_early_fixup);
 
-static int ar8031_phy_fixup(struct phy_device *dev)
-{
-	u16 val;
-
-	/* To enable AR8031 output a 125MHz clk from CLK_25M */
-	phy_write(dev, 0xd, 0x7);
-	phy_write(dev, 0xe, 0x8016);
-	phy_write(dev, 0xd, 0x4007);
-
-	val = phy_read(dev, 0xe);
-	val &= 0xffe3;
-	val |= 0x18;
-	phy_write(dev, 0xe, val);
-
-	return 0;
-}
-
-#define PHY_ID_AR8031	0x004dd074
-
 static int ar8035_phy_fixup(struct phy_device *dev)
 {
 	u16 val;
@@ -101,15 +82,6 @@ static int ar8035_phy_fixup(struct phy_device *dev)
 	val = phy_read(dev, 0xe);
 	phy_write(dev, 0xe, val & ~(1 << 8));
 
-	/*
-	 * Enable 125MHz clock from CLK_25M on the AR8031.  This
-	 * is fed in to the IMX6 on the ENET_REF_CLK (V22) pad.
-	 * Also, introduce a tx clock delay.
-	 *
-	 * This is the same as is the AR8031 fixup.
-	 */
-	ar8031_phy_fixup(dev);
-
 	return 0;
 }
 
@@ -120,8 +92,6 @@ static void __init imx6q_enet_phy_init(void)
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
 		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
 				ksz9021rn_phy_fixup);
-		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
-				ar8031_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
 				ar8035_phy_fixup);
 	}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 4/7] ARM i.MX6q: remove clk-out fixup for the Atheros AR8031 and AR8035 PHYs
@ 2021-02-03  9:18   ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Philippe Schenker, netdev, linux-kernel, Russell King,
	Oleksij Rempel, linux-imx, kernel, David Jander, Fabio Estevam,
	linux-arm-kernel

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(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 4c840e116003..d12b571a61ac 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -68,25 +68,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, ventana_pciesw_early_fixup);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, ventana_pciesw_early_fixup);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, ventana_pciesw_early_fixup);
 
-static int ar8031_phy_fixup(struct phy_device *dev)
-{
-	u16 val;
-
-	/* To enable AR8031 output a 125MHz clk from CLK_25M */
-	phy_write(dev, 0xd, 0x7);
-	phy_write(dev, 0xe, 0x8016);
-	phy_write(dev, 0xd, 0x4007);
-
-	val = phy_read(dev, 0xe);
-	val &= 0xffe3;
-	val |= 0x18;
-	phy_write(dev, 0xe, val);
-
-	return 0;
-}
-
-#define PHY_ID_AR8031	0x004dd074
-
 static int ar8035_phy_fixup(struct phy_device *dev)
 {
 	u16 val;
@@ -101,15 +82,6 @@ static int ar8035_phy_fixup(struct phy_device *dev)
 	val = phy_read(dev, 0xe);
 	phy_write(dev, 0xe, val & ~(1 << 8));
 
-	/*
-	 * Enable 125MHz clock from CLK_25M on the AR8031.  This
-	 * is fed in to the IMX6 on the ENET_REF_CLK (V22) pad.
-	 * Also, introduce a tx clock delay.
-	 *
-	 * This is the same as is the AR8031 fixup.
-	 */
-	ar8031_phy_fixup(dev);
-
 	return 0;
 }
 
@@ -120,8 +92,6 @@ static void __init imx6q_enet_phy_init(void)
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
 		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
 				ksz9021rn_phy_fixup);
-		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
-				ar8031_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
 				ar8035_phy_fixup);
 	}
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
  2021-02-03  9:18 ` Oleksij Rempel
@ 2021-02-03  9:18   ` Oleksij Rempel
  -1 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Oleksij Rempel, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Russell King,
	Philippe Schenker

This fixup removes the Lpi_en bit.

If this patch breaks functionality of your board, use following device
tree properties:

	ethernet-phy@X {
		reg = <0xX>;
		eee-broken-1000t;
		eee-broken-100tx;
		....
	};

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx6q.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index d12b571a61ac..c9d7c29d95e1 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -68,32 +68,11 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, ventana_pciesw_early_fixup);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, ventana_pciesw_early_fixup);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, ventana_pciesw_early_fixup);
 
-static int ar8035_phy_fixup(struct phy_device *dev)
-{
-	u16 val;
-
-	/* Ar803x phy SmartEEE feature cause link status generates glitch,
-	 * which cause ethernet link down/up issue, so disable SmartEEE
-	 */
-	phy_write(dev, 0xd, 0x3);
-	phy_write(dev, 0xe, 0x805d);
-	phy_write(dev, 0xd, 0x4003);
-
-	val = phy_read(dev, 0xe);
-	phy_write(dev, 0xe, val & ~(1 << 8));
-
-	return 0;
-}
-
-#define PHY_ID_AR8035 0x004dd072
-
 static void __init imx6q_enet_phy_init(void)
 {
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
 		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
 				ksz9021rn_phy_fixup);
-		phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
-				ar8035_phy_fixup);
 	}
 }
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
@ 2021-02-03  9:18   ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Philippe Schenker, netdev, linux-kernel, Russell King,
	Oleksij Rempel, linux-imx, kernel, David Jander, Fabio Estevam,
	linux-arm-kernel

This fixup removes the Lpi_en bit.

If this patch breaks functionality of your board, use following device
tree properties:

	ethernet-phy@X {
		reg = <0xX>;
		eee-broken-1000t;
		eee-broken-100tx;
		....
	};

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx6q.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index d12b571a61ac..c9d7c29d95e1 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -68,32 +68,11 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, ventana_pciesw_early_fixup);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, ventana_pciesw_early_fixup);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, ventana_pciesw_early_fixup);
 
-static int ar8035_phy_fixup(struct phy_device *dev)
-{
-	u16 val;
-
-	/* Ar803x phy SmartEEE feature cause link status generates glitch,
-	 * which cause ethernet link down/up issue, so disable SmartEEE
-	 */
-	phy_write(dev, 0xd, 0x3);
-	phy_write(dev, 0xe, 0x805d);
-	phy_write(dev, 0xd, 0x4003);
-
-	val = phy_read(dev, 0xe);
-	phy_write(dev, 0xe, val & ~(1 << 8));
-
-	return 0;
-}
-
-#define PHY_ID_AR8035 0x004dd072
-
 static void __init imx6q_enet_phy_init(void)
 {
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
 		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
 				ksz9021rn_phy_fixup);
-		phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
-				ar8035_phy_fixup);
 	}
 }
 
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 6/7] ARM: imx6sx: remove Atheros AR8031 PHY fixup
  2021-02-03  9:18 ` Oleksij Rempel
@ 2021-02-03  9:18   ` Oleksij Rempel
  -1 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Oleksij Rempel, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Russell King,
	Philippe Schenker

If this patch breaks your system, enable AT803X_PHY driver and add a PHY
node to the board device tree:

	phy-connection-type = "rgmii-txid"; (or rgmii-id)
	ethernet-phy@X {
		reg = <0xX>;

		qca,clk-out-frequency = <125000000>;

		vddio-supply = <&vddh>;

		vddio: vddio-regulator {
			regulator-name = "VDDIO";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		vddh: vddh-regulator {
			regulator-name = "VDDH";
		};
	};

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx6sx.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
index 781e2a94fdd7..e65ed5218f53 100644
--- a/arch/arm/mach-imx/mach-imx6sx.c
+++ b/arch/arm/mach-imx/mach-imx6sx.c
@@ -15,31 +15,6 @@
 #include "common.h"
 #include "cpuidle.h"
 
-static int ar8031_phy_fixup(struct phy_device *dev)
-{
-	u16 val;
-
-	/* Set RGMII IO voltage to 1.8V */
-	phy_write(dev, 0x1d, 0x1f);
-	phy_write(dev, 0x1e, 0x8);
-
-	/* introduce tx clock delay */
-	phy_write(dev, 0x1d, 0x5);
-	val = phy_read(dev, 0x1e);
-	val |= 0x0100;
-	phy_write(dev, 0x1e, val);
-
-	return 0;
-}
-
-#define PHY_ID_AR8031   0x004dd074
-static void __init imx6sx_enet_phy_init(void)
-{
-	if (IS_BUILTIN(CONFIG_PHYLIB))
-		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
-					   ar8031_phy_fixup);
-}
-
 static void __init imx6sx_enet_clk_sel(void)
 {
 	struct regmap *gpr;
@@ -57,7 +32,6 @@ static void __init imx6sx_enet_clk_sel(void)
 
 static inline void imx6sx_enet_init(void)
 {
-	imx6sx_enet_phy_init();
 	imx6sx_enet_clk_sel();
 }
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 6/7] ARM: imx6sx: remove Atheros AR8031 PHY fixup
@ 2021-02-03  9:18   ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Philippe Schenker, netdev, linux-kernel, Russell King,
	Oleksij Rempel, linux-imx, kernel, David Jander, Fabio Estevam,
	linux-arm-kernel

If this patch breaks your system, enable AT803X_PHY driver and add a PHY
node to the board device tree:

	phy-connection-type = "rgmii-txid"; (or rgmii-id)
	ethernet-phy@X {
		reg = <0xX>;

		qca,clk-out-frequency = <125000000>;

		vddio-supply = <&vddh>;

		vddio: vddio-regulator {
			regulator-name = "VDDIO";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		vddh: vddh-regulator {
			regulator-name = "VDDH";
		};
	};

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx6sx.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
index 781e2a94fdd7..e65ed5218f53 100644
--- a/arch/arm/mach-imx/mach-imx6sx.c
+++ b/arch/arm/mach-imx/mach-imx6sx.c
@@ -15,31 +15,6 @@
 #include "common.h"
 #include "cpuidle.h"
 
-static int ar8031_phy_fixup(struct phy_device *dev)
-{
-	u16 val;
-
-	/* Set RGMII IO voltage to 1.8V */
-	phy_write(dev, 0x1d, 0x1f);
-	phy_write(dev, 0x1e, 0x8);
-
-	/* introduce tx clock delay */
-	phy_write(dev, 0x1d, 0x5);
-	val = phy_read(dev, 0x1e);
-	val |= 0x0100;
-	phy_write(dev, 0x1e, val);
-
-	return 0;
-}
-
-#define PHY_ID_AR8031   0x004dd074
-static void __init imx6sx_enet_phy_init(void)
-{
-	if (IS_BUILTIN(CONFIG_PHYLIB))
-		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
-					   ar8031_phy_fixup);
-}
-
 static void __init imx6sx_enet_clk_sel(void)
 {
 	struct regmap *gpr;
@@ -57,7 +32,6 @@ static void __init imx6sx_enet_clk_sel(void)
 
 static inline void imx6sx_enet_init(void)
 {
-	imx6sx_enet_phy_init();
 	imx6sx_enet_clk_sel();
 }
 
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 7/7] ARM: imx7d: remove Atheros AR8031 PHY fixup
  2021-02-03  9:18 ` Oleksij Rempel
@ 2021-02-03  9:18   ` Oleksij Rempel
  -1 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Oleksij Rempel, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Russell King,
	Philippe Schenker

This fixup configures the IO voltage and disables the SmartEEE
functionality.

If this patch breaks your system, enable AT803X_PHY driver and configure
the PHY by the device tree:

	phy-connection-type = "rgmii-id";
	ethernet-phy@X {
		reg = <0xX>;
		eee-broken-1000t;
		eee-broken-100tx;

		vddio-supply = <&vddh>;

		vddio: vddio-regulator {
			regulator-name = "VDDIO";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		vddh: vddh-regulator {
			regulator-name = "VDDH";
		};
	};

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx7d.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c
index 879c35929a13..ccf64ddf8b7e 100644
--- a/arch/arm/mach-imx/mach-imx7d.c
+++ b/arch/arm/mach-imx/mach-imx7d.c
@@ -14,25 +14,6 @@
 
 #include "common.h"
 
-static int ar8031_phy_fixup(struct phy_device *dev)
-{
-	u16 val;
-
-	/* Set RGMII IO voltage to 1.8V */
-	phy_write(dev, 0x1d, 0x1f);
-	phy_write(dev, 0x1e, 0x8);
-
-	/* disable phy AR8031 SmartEEE function. */
-	phy_write(dev, 0xd, 0x3);
-	phy_write(dev, 0xe, 0x805d);
-	phy_write(dev, 0xd, 0x4003);
-	val = phy_read(dev, 0xe);
-	val &= ~(0x1 << 8);
-	phy_write(dev, 0xe, val);
-
-	return 0;
-}
-
 static int bcm54220_phy_fixup(struct phy_device *dev)
 {
 	/* enable RXC skew select RGMII copper mode */
@@ -44,14 +25,11 @@ static int bcm54220_phy_fixup(struct phy_device *dev)
 	return 0;
 }
 
-#define PHY_ID_AR8031	0x004dd074
 #define PHY_ID_BCM54220	0x600d8589
 
 static void __init imx7d_enet_phy_init(void)
 {
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
-		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
-					   ar8031_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_BCM54220, 0xffffffff,
 					   bcm54220_phy_fixup);
 	}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 7/7] ARM: imx7d: remove Atheros AR8031 PHY fixup
@ 2021-02-03  9:18   ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-03  9:18 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Philippe Schenker, netdev, linux-kernel, Russell King,
	Oleksij Rempel, linux-imx, kernel, David Jander, Fabio Estevam,
	linux-arm-kernel

This fixup configures the IO voltage and disables the SmartEEE
functionality.

If this patch breaks your system, enable AT803X_PHY driver and configure
the PHY by the device tree:

	phy-connection-type = "rgmii-id";
	ethernet-phy@X {
		reg = <0xX>;
		eee-broken-1000t;
		eee-broken-100tx;

		vddio-supply = <&vddh>;

		vddio: vddio-regulator {
			regulator-name = "VDDIO";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		vddh: vddh-regulator {
			regulator-name = "VDDH";
		};
	};

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx7d.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c
index 879c35929a13..ccf64ddf8b7e 100644
--- a/arch/arm/mach-imx/mach-imx7d.c
+++ b/arch/arm/mach-imx/mach-imx7d.c
@@ -14,25 +14,6 @@
 
 #include "common.h"
 
-static int ar8031_phy_fixup(struct phy_device *dev)
-{
-	u16 val;
-
-	/* Set RGMII IO voltage to 1.8V */
-	phy_write(dev, 0x1d, 0x1f);
-	phy_write(dev, 0x1e, 0x8);
-
-	/* disable phy AR8031 SmartEEE function. */
-	phy_write(dev, 0xd, 0x3);
-	phy_write(dev, 0xe, 0x805d);
-	phy_write(dev, 0xd, 0x4003);
-	val = phy_read(dev, 0xe);
-	val &= ~(0x1 << 8);
-	phy_write(dev, 0xe, val);
-
-	return 0;
-}
-
 static int bcm54220_phy_fixup(struct phy_device *dev)
 {
 	/* enable RXC skew select RGMII copper mode */
@@ -44,14 +25,11 @@ static int bcm54220_phy_fixup(struct phy_device *dev)
 	return 0;
 }
 
-#define PHY_ID_AR8031	0x004dd074
 #define PHY_ID_BCM54220	0x600d8589
 
 static void __init imx7d_enet_phy_init(void)
 {
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
-		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
-					   ar8031_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_BCM54220, 0xffffffff,
 					   bcm54220_phy_fixup);
 	}
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 0/7] remove different PHY fixups
  2021-02-03  9:18 ` Oleksij Rempel
@ 2021-02-03  9:28   ` Russell King - ARM Linux admin
  -1 siblings, 0 replies; 26+ messages in thread
From: Russell King - ARM Linux admin @ 2021-02-03  9:28 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Philippe Schenker

On Wed, Feb 03, 2021 at 10:18:50AM +0100, Oleksij Rempel wrote:
> 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.

Please wait a cycle for the changes I've submitted through net-next
to be merged, so we don't end up with stuff breaking during the merge
window because these changes have been merged before the changes in
net-next.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 0/7] remove different PHY fixups
@ 2021-02-03  9:28   ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 26+ messages in thread
From: Russell King - ARM Linux admin @ 2021-02-03  9:28 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Florian Fainelli, netdev, Sascha Hauer,
	linux-kernel, Fabio Estevam, Philippe Schenker, linux-imx,
	kernel, David Jander, Shawn Guo, linux-arm-kernel,
	Heiner Kallweit

On Wed, Feb 03, 2021 at 10:18:50AM +0100, Oleksij Rempel wrote:
> 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.

Please wait a cycle for the changes I've submitted through net-next
to be merged, so we don't end up with stuff breaking during the merge
window because these changes have been merged before the changes in
net-next.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
  2021-02-03  9:18   ` Oleksij Rempel
@ 2021-02-03  9:56     ` Russell King - ARM Linux admin
  -1 siblings, 0 replies; 26+ messages in thread
From: Russell King - ARM Linux admin @ 2021-02-03  9:56 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Shawn Guo, Sascha Hauer, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, kernel, netdev, linux-arm-kernel, linux-kernel,
	linux-imx, Fabio Estevam, David Jander, Philippe Schenker

On Wed, Feb 03, 2021 at 10:18:55AM +0100, Oleksij Rempel wrote:
> This fixup removes the Lpi_en bit.
> 
> If this patch breaks functionality of your board, use following device
> tree properties:
> 
> 	ethernet-phy@X {
> 		reg = <0xX>;
> 		eee-broken-1000t;
> 		eee-broken-100tx;
> 		....
> 	};

That is the historical fix for this problem, but there is a better
solution now in net-next - configuring the Tw parameter for gigabit
connections. That solves the random link drop issue when EEE is
enabled.

Support for this configuration has only recently been merged into
net-next and other trees for this merge window, so I ask that you
hold off at least this patch until the next cycle.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
@ 2021-02-03  9:56     ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 26+ messages in thread
From: Russell King - ARM Linux admin @ 2021-02-03  9:56 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Florian Fainelli, netdev, Sascha Hauer,
	linux-kernel, Fabio Estevam, Philippe Schenker, linux-imx,
	kernel, David Jander, Shawn Guo, linux-arm-kernel,
	Heiner Kallweit

On Wed, Feb 03, 2021 at 10:18:55AM +0100, Oleksij Rempel wrote:
> This fixup removes the Lpi_en bit.
> 
> If this patch breaks functionality of your board, use following device
> tree properties:
> 
> 	ethernet-phy@X {
> 		reg = <0xX>;
> 		eee-broken-1000t;
> 		eee-broken-100tx;
> 		....
> 	};

That is the historical fix for this problem, but there is a better
solution now in net-next - configuring the Tw parameter for gigabit
connections. That solves the random link drop issue when EEE is
enabled.

Support for this configuration has only recently been merged into
net-next and other trees for this merge window, so I ask that you
hold off at least this patch until the next cycle.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 1/7] ARM i.MX6q: remove PHY fixup for KSZ9031
  2021-02-03  9:18   ` Oleksij Rempel
@ 2021-02-03 10:24     ` Philippe Schenker
  -1 siblings, 0 replies; 26+ messages in thread
From: Philippe Schenker @ 2021-02-03 10:24 UTC (permalink / raw)
  To: o.rempel, s.hauer, f.fainelli, hkallweit1, shawnguo, andrew
  Cc: kernel, linux, festevam, linux-imx, david, linux-kernel,
	linux-arm-kernel, netdev

On Wed, 2021-02-03 at 10:18 +0100, 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>

For Toradex Boards:

Acked-by: Philippe Schenker <philippe.schenker@toradex.com>

> ---
>  arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts |  2 +-
>  arch/arm/mach-imx/mach-imx6q.c          | 23 -----------------------
>  2 files changed, 1 insertion(+), 24 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> index fa2307d8ce86..c713ac03b3b9 100644
> --- a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> +++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> @@ -112,7 +112,7 @@ flash: m25p80@0 {
>  &fec {
>         pinctrl-names = "default";
>         pinctrl-0 = <&pinctrl_enet>;
> -       phy-mode = "rgmii";
> +       phy-mode = "rgmii-id";
>         phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
>         phy-supply = <&vgen2_1v2_eth>;
>         status = "okay";
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-
> imx6q.c
> index 703998ebb52e..78205f90da27 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -40,27 +40,6 @@ static int ksz9021rn_phy_fixup(struct phy_device
> *phydev)
>         return 0;
>  }
>  
> -static void mmd_write_reg(struct phy_device *dev, int device, int
> reg, int val)
> -{
> -       phy_write(dev, 0x0d, device);
> -       phy_write(dev, 0x0e, reg);
> -       phy_write(dev, 0x0d, (1 << 14) | device);
> -       phy_write(dev, 0x0e, val);
> -}
> -
> -static int ksz9031rn_phy_fixup(struct phy_device *dev)
> -{
> -       /*
> -        * min rx data delay, max rx/tx clock delay,
> -        * min rx/tx control delay
> -        */
> -       mmd_write_reg(dev, 2, 4, 0);
> -       mmd_write_reg(dev, 2, 5, 0);
> -       mmd_write_reg(dev, 2, 8, 0x003ff);
> -
> -       return 0;
> -}
> -
>  /*
>   * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
>   * as they are used for slots1-7 PERST#
> @@ -152,8 +131,6 @@ static void __init imx6q_enet_phy_init(void)
>         if (IS_BUILTIN(CONFIG_PHYLIB)) {
>                 phy_register_fixup_for_uid(PHY_ID_KSZ9021,
> MICREL_PHY_ID_MASK,
>                                 ksz9021rn_phy_fixup);
> -               phy_register_fixup_for_uid(PHY_ID_KSZ9031,
> MICREL_PHY_ID_MASK,
> -                               ksz9031rn_phy_fixup);
>                 phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
>                                 ar8031_phy_fixup);
>                 phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 1/7] ARM i.MX6q: remove PHY fixup for KSZ9031
@ 2021-02-03 10:24     ` Philippe Schenker
  0 siblings, 0 replies; 26+ messages in thread
From: Philippe Schenker @ 2021-02-03 10:24 UTC (permalink / raw)
  To: o.rempel, s.hauer, f.fainelli, hkallweit1, shawnguo, andrew
  Cc: netdev, linux-kernel, linux, linux-imx, kernel, david, festevam,
	linux-arm-kernel

On Wed, 2021-02-03 at 10:18 +0100, 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>

For Toradex Boards:

Acked-by: Philippe Schenker <philippe.schenker@toradex.com>

> ---
>  arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts |  2 +-
>  arch/arm/mach-imx/mach-imx6q.c          | 23 -----------------------
>  2 files changed, 1 insertion(+), 24 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> index fa2307d8ce86..c713ac03b3b9 100644
> --- a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> +++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
> @@ -112,7 +112,7 @@ flash: m25p80@0 {
>  &fec {
>         pinctrl-names = "default";
>         pinctrl-0 = <&pinctrl_enet>;
> -       phy-mode = "rgmii";
> +       phy-mode = "rgmii-id";
>         phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
>         phy-supply = <&vgen2_1v2_eth>;
>         status = "okay";
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-
> imx6q.c
> index 703998ebb52e..78205f90da27 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -40,27 +40,6 @@ static int ksz9021rn_phy_fixup(struct phy_device
> *phydev)
>         return 0;
>  }
>  
> -static void mmd_write_reg(struct phy_device *dev, int device, int
> reg, int val)
> -{
> -       phy_write(dev, 0x0d, device);
> -       phy_write(dev, 0x0e, reg);
> -       phy_write(dev, 0x0d, (1 << 14) | device);
> -       phy_write(dev, 0x0e, val);
> -}
> -
> -static int ksz9031rn_phy_fixup(struct phy_device *dev)
> -{
> -       /*
> -        * min rx data delay, max rx/tx clock delay,
> -        * min rx/tx control delay
> -        */
> -       mmd_write_reg(dev, 2, 4, 0);
> -       mmd_write_reg(dev, 2, 5, 0);
> -       mmd_write_reg(dev, 2, 8, 0x003ff);
> -
> -       return 0;
> -}
> -
>  /*
>   * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
>   * as they are used for slots1-7 PERST#
> @@ -152,8 +131,6 @@ static void __init imx6q_enet_phy_init(void)
>         if (IS_BUILTIN(CONFIG_PHYLIB)) {
>                 phy_register_fixup_for_uid(PHY_ID_KSZ9021,
> MICREL_PHY_ID_MASK,
>                                 ksz9021rn_phy_fixup);
> -               phy_register_fixup_for_uid(PHY_ID_KSZ9031,
> MICREL_PHY_ID_MASK,
> -                               ksz9031rn_phy_fixup);
>                 phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
>                                 ar8031_phy_fixup);
>                 phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
  2021-02-03  9:56     ` Russell King - ARM Linux admin
@ 2021-02-08  9:20       ` Oleksij Rempel
  -1 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-08  9:20 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Andrew Lunn, Florian Fainelli, netdev, Sascha Hauer,
	linux-kernel, Fabio Estevam, Philippe Schenker, linux-imx,
	kernel, David Jander, Shawn Guo, linux-arm-kernel,
	Heiner Kallweit

On Wed, Feb 03, 2021 at 09:56:28AM +0000, Russell King - ARM Linux admin wrote:
> On Wed, Feb 03, 2021 at 10:18:55AM +0100, Oleksij Rempel wrote:
> > This fixup removes the Lpi_en bit.
> > 
> > If this patch breaks functionality of your board, use following device
> > tree properties:
> > 
> > 	ethernet-phy@X {
> > 		reg = <0xX>;
> > 		eee-broken-1000t;
> > 		eee-broken-100tx;
> > 		....
> > 	};
> 
> That is the historical fix for this problem, but there is a better
> solution now in net-next - configuring the Tw parameter for gigabit
> connections. That solves the random link drop issue when EEE is
> enabled.

Do you mean this properties?
  qca,smarteee-tw-us-1g
  qca,smarteee-tw-us-100m

Do you have some recommendations, which values can be here used? Are
they same for all MACs? Or, can we calculate this values automatically?

Beside, I have seen this patch: "ARM: dts: imx6qdl-sr-som: fix some
cubox-i platforms"

I had similar issue and it was triggered by the boot loader, which
enabled 60 Ohm on-die termination. The fix was to remove this lines in
the boot loader: wm 32 0x020e07ac 0x00000200 /* 60 Ohm ODT */

> Support for this configuration has only recently been merged into
> net-next and other trees for this merge window, so I ask that you
> hold off at least this patch until the next cycle.

ok.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
@ 2021-02-08  9:20       ` Oleksij Rempel
  0 siblings, 0 replies; 26+ messages in thread
From: Oleksij Rempel @ 2021-02-08  9:20 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Andrew Lunn, Florian Fainelli, netdev, Sascha Hauer,
	linux-kernel, Philippe Schenker, linux-imx, kernel, David Jander,
	Shawn Guo, Fabio Estevam, linux-arm-kernel, Heiner Kallweit

On Wed, Feb 03, 2021 at 09:56:28AM +0000, Russell King - ARM Linux admin wrote:
> On Wed, Feb 03, 2021 at 10:18:55AM +0100, Oleksij Rempel wrote:
> > This fixup removes the Lpi_en bit.
> > 
> > If this patch breaks functionality of your board, use following device
> > tree properties:
> > 
> > 	ethernet-phy@X {
> > 		reg = <0xX>;
> > 		eee-broken-1000t;
> > 		eee-broken-100tx;
> > 		....
> > 	};
> 
> That is the historical fix for this problem, but there is a better
> solution now in net-next - configuring the Tw parameter for gigabit
> connections. That solves the random link drop issue when EEE is
> enabled.

Do you mean this properties?
  qca,smarteee-tw-us-1g
  qca,smarteee-tw-us-100m

Do you have some recommendations, which values can be here used? Are
they same for all MACs? Or, can we calculate this values automatically?

Beside, I have seen this patch: "ARM: dts: imx6qdl-sr-som: fix some
cubox-i platforms"

I had similar issue and it was triggered by the boot loader, which
enabled 60 Ohm on-die termination. The fix was to remove this lines in
the boot loader: wm 32 0x020e07ac 0x00000200 /* 60 Ohm ODT */

> Support for this configuration has only recently been merged into
> net-next and other trees for this merge window, so I ask that you
> hold off at least this patch until the next cycle.

ok.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
  2021-02-08  9:20       ` Oleksij Rempel
@ 2021-02-08 14:21         ` Russell King - ARM Linux admin
  -1 siblings, 0 replies; 26+ messages in thread
From: Russell King - ARM Linux admin @ 2021-02-08 14:21 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Florian Fainelli, netdev, Sascha Hauer,
	linux-kernel, Philippe Schenker, linux-imx, kernel, David Jander,
	Shawn Guo, Fabio Estevam, linux-arm-kernel, Heiner Kallweit

On Mon, Feb 08, 2021 at 10:20:38AM +0100, Oleksij Rempel wrote:
> On Wed, Feb 03, 2021 at 09:56:28AM +0000, Russell King - ARM Linux admin wrote:
> > That is the historical fix for this problem, but there is a better
> > solution now in net-next - configuring the Tw parameter for gigabit
> > connections. That solves the random link drop issue when EEE is
> > enabled.
> 
> Do you mean this properties?
>   qca,smarteee-tw-us-1g
>   qca,smarteee-tw-us-100m
> 
> Do you have some recommendations, which values can be here used? Are
> they same for all MACs? Or, can we calculate this values automatically?

I don't think there's a way to "calculate" them.

The AR8035 default is 17us for 1G and 23us for 100M. Increasing the
1G Tw to 26us or 27us fixes it on several different Solidrun platforms
(iMX6 Hummingboards and Cubox-i, and LX2160A based). The boards all
have differing layouts, so I don't think it's layout or SoC specific
(which is good news.)

These figures have been arrived at by repetitive long-term testing and
observing whether there are sporadic link drops over these platforms.

> Beside, I have seen this patch: "ARM: dts: imx6qdl-sr-som: fix some
> cubox-i platforms"

That's for a different problem: moving these settings to DT broke
some Cubox-i platforms because of the weird ways that the AR8035
configures the address bits, using the LED pin. Tying a LED to the
LED pin is not sufficient to guarantee that a board always configures
the PHY to a particular address, so it can appear on address 0 or 4
depending on noise, temperature, supply voltage, and PHY chip
thresholds.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup
@ 2021-02-08 14:21         ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 26+ messages in thread
From: Russell King - ARM Linux admin @ 2021-02-08 14:21 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Florian Fainelli, netdev, Sascha Hauer,
	linux-kernel, Fabio Estevam, Philippe Schenker, linux-imx,
	kernel, David Jander, Shawn Guo, linux-arm-kernel,
	Heiner Kallweit

On Mon, Feb 08, 2021 at 10:20:38AM +0100, Oleksij Rempel wrote:
> On Wed, Feb 03, 2021 at 09:56:28AM +0000, Russell King - ARM Linux admin wrote:
> > That is the historical fix for this problem, but there is a better
> > solution now in net-next - configuring the Tw parameter for gigabit
> > connections. That solves the random link drop issue when EEE is
> > enabled.
> 
> Do you mean this properties?
>   qca,smarteee-tw-us-1g
>   qca,smarteee-tw-us-100m
> 
> Do you have some recommendations, which values can be here used? Are
> they same for all MACs? Or, can we calculate this values automatically?

I don't think there's a way to "calculate" them.

The AR8035 default is 17us for 1G and 23us for 100M. Increasing the
1G Tw to 26us or 27us fixes it on several different Solidrun platforms
(iMX6 Hummingboards and Cubox-i, and LX2160A based). The boards all
have differing layouts, so I don't think it's layout or SoC specific
(which is good news.)

These figures have been arrived at by repetitive long-term testing and
observing whether there are sporadic link drops over these platforms.

> Beside, I have seen this patch: "ARM: dts: imx6qdl-sr-som: fix some
> cubox-i platforms"

That's for a different problem: moving these settings to DT broke
some Cubox-i platforms because of the weird ways that the AR8035
configures the address bits, using the LED pin. Tying a LED to the
LED pin is not sufficient to guarantee that a board always configures
the PHY to a particular address, so it can appear on address 0 or 4
depending on noise, temperature, supply voltage, and PHY chip
thresholds.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-02-08 14:44 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03  9:18 [PATCH v1 0/7] remove different PHY fixups Oleksij Rempel
2021-02-03  9:18 ` Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 1/7] ARM i.MX6q: remove PHY fixup for KSZ9031 Oleksij Rempel
2021-02-03  9:18   ` Oleksij Rempel
2021-02-03 10:24   ` Philippe Schenker
2021-02-03 10:24     ` Philippe Schenker
2021-02-03  9:18 ` [PATCH v1 2/7] ARM i.MX6q: remove TX clock delay of ar8031_phy_fixup() Oleksij Rempel
2021-02-03  9:18   ` Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 3/7] ARM i.MX6q: remove hand crafted PHY power up in ar8035_phy_fixup() Oleksij Rempel
2021-02-03  9:18   ` Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 4/7] ARM i.MX6q: remove clk-out fixup for the Atheros AR8031 and AR8035 PHYs Oleksij Rempel
2021-02-03  9:18   ` Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 5/7] ARM i.MX6q: remove Atheros AR8035 SmartEEE fixup Oleksij Rempel
2021-02-03  9:18   ` Oleksij Rempel
2021-02-03  9:56   ` Russell King - ARM Linux admin
2021-02-03  9:56     ` Russell King - ARM Linux admin
2021-02-08  9:20     ` Oleksij Rempel
2021-02-08  9:20       ` Oleksij Rempel
2021-02-08 14:21       ` Russell King - ARM Linux admin
2021-02-08 14:21         ` Russell King - ARM Linux admin
2021-02-03  9:18 ` [PATCH v1 6/7] ARM: imx6sx: remove Atheros AR8031 PHY fixup Oleksij Rempel
2021-02-03  9:18   ` Oleksij Rempel
2021-02-03  9:18 ` [PATCH v1 7/7] ARM: imx7d: " Oleksij Rempel
2021-02-03  9:18   ` Oleksij Rempel
2021-02-03  9:28 ` [PATCH v1 0/7] remove different PHY fixups Russell King - ARM Linux admin
2021-02-03  9:28   ` Russell King - ARM Linux admin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.