ARM: imx6q: remove KSZ9021 PHY fixup
Subsystems (3)
PATCH 1/1 ARM: imx6q: remove KSZ9021 PHY fixup
477fce49aef4 ("arm/imx6q-sabrelite: add enet phy ksz9021rn fixup") added this PHY fixup in 2011. In 2013 954c396756e3 ("net/phy: micrel: Add OF configuration support for ksz9021") added support for configuring pad skew parameters via OF, removing the need for the board-level fixup.
Note:
In 2013 14078291d89b ("ARM: i.MX6: call ksz9021 phy fixup for all i.MX6 boards") extended usage of the fixup to nitrogen6x and titanium. nitrogen6x configures the PHY properly via OF, and titanium has no mainline Linux support. From u-boot titanium support was removed in 2021.
--- arch/arm/mach-imx/mach-imx6q.c | 30 ------------------------------ include/linux/micrel_phy.h | 5 ----- 2 files changed, 35 deletions(-)
arch/arm/mach-imx/mach-imx6q.c +0 -30
@@ -20,26 +20,6 @@#include "cpuidle.h" #include "hardware.h" -/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */ -static int ksz9021rn_phy_fixup (struct phy_device *phydev) -{ -if (IS_BUILTIN (CONFIG_PHYLIB )) { -/* min rx data delay */ -phy_write (phydev,MICREL_KSZ9021_EXTREG_CTRL , -0x8000 |MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW ); -phy_write (phydev,MICREL_KSZ9021_EXTREG_DATA_WRITE ,0x0000 ); - -/* max rx/tx clock delay, min rx/tx control delay */ -phy_write (phydev,MICREL_KSZ9021_EXTREG_CTRL , -0x8000 |MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW ); -phy_write (phydev,MICREL_KSZ9021_EXTREG_DATA_WRITE ,0xf0f0 ); -phy_write (phydev,MICREL_KSZ9021_EXTREG_CTRL , -MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW ); - } - -return 0 ; -} -/* * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High * as they are used for slots1-7 PERST#
@@ -68,14 +48,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 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); - } -} -static void __init imx6q_1588_init (void ) {struct device_node *np;
@@ -179,8 +151,6 @@ static void __init imx6q_init_machine(void)imx_print_silicon_rev (cpu_is_imx6dl () ?"i.MX6DL" :"i.MX6Q" ,imx_get_soc_revision ()); -imx6q_enet_phy_init (); -of_platform_default_populate (NULL ,NULL ,NULL );imx_anatop_init ();
include/linux/micrel_phy.h +0 -5
@@ -47,11 +47,6 @@#define MICREL_PHY_FXEN BIT(1)#define MICREL_KSZ8_P1_ERRATA BIT(2) -#define MICREL_KSZ9021_EXTREG_CTRL 0xB -#define MICREL_KSZ9021_EXTREG_DATA_WRITE 0xC -#define MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW 0x104 -#define MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW 0x105 -/* Device specific MII_BMCR (Reg 0) bits */ /* 1 = HP Auto MDI/MDI-X mode, 0 = Microchip Auto MDI/MDI-X mode */ #define KSZ886X_BMCR_HP_MDIX BIT(5)
Signature · 1 line
2.55.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Removing the KSZ9021 PHY fixup breaks backward compatibility with older Device Trees, causing…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Removing the KSZ9021 PHY fixup breaks backward compatibility with older Device Trees, causing Ethernet to fail. --
--- Patch [1]: [PATCH] ARM: imx6q: remove KSZ9021 PHY fixup --- commit 043c886239c15d5e6801536fd77e59f0f71dbb60
Author: Heiner Kallweit <[email protected]>
ARM: imx6q: remove KSZ9021 PHY fixup
This commit removes the board-level PHY fixup for the KSZ9021 Ethernet PHY on i.MX6Q boards, which was originally added to configure RGMII pad skew. The commit notes that OF configuration support was added in 2013, making the board-level fixup theoretically redundant.
Quoted 4 lines
arch/arm/mach-imx/mach-imx6q.c +0
-0
[ ... ]
arch/arm/mach-imx/mach-imx6q.c DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, ventana_pciesw_early_fixup); · line 78
Quoted 8 lines
arch/arm/mach-imx/mach-imx6q.c +0
-8-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); - } -} -
[Severity: High]
Will removing this fixup break Ethernet for users booting with older Device Trees that lack the explicit skew-ps properties?
The Linux kernel generally treats the Device Tree as a stable ABI. Older DTBs implicitly relied on this board-level fixup to set the necessary PHY delays because the KSZ9021 PHY driver only sets RGMII pad skew registers if explicit *-skew-ps properties are present. It does not apply default delays based solely on the phy-mode.
If a system boots an affected board (like Sabrelite) with an older DTB, could this omission cause Ethernet communication to fail unconditionally?
To preserve backward compatibility while still removing it for unaffected boards, would it be better to conditionally apply the fixup using of_machine_is_compatible() instead of removing it entirely?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
[email protected]
AppliedFrom: Frank Li <[email protected]>
Quoted 5 lines · Heiner Kallweit
477fce49aef4("arm/imx6q-sabrelite: add enet phy ksz9021rn fixup") added this PHY fixup in 2011. In 2013954c396756e3("net/phy: micrel: Add OF configuration support for ksz9021") added support for configuring pad skew parameters via OF, removing the need for the board-level fixup.
Quoted 7 lines
Note:
In 201314078291d89b("ARM: i.MX6: call ksz9021 phy fixup for all i.MX6 boards") extended usage of the fixup to nitrogen6x and titanium. nitrogen6x configures the PHY properly via OF, and titanium has no mainline Linux support. From u-boot titanium support was removed in 2021.[...]
Applied, thanks!
[1/1] ARM: imx6q: remove KSZ9021 PHY fixup
commit: 8392af7be78d0cdc5f1ec6c9a53d424b32642403
Best regards,
Signature · 1 line
Frank Li <[email protected]>