* [PATCH] ARM: imx6q: remove KSZ9021 PHY fixup
@ 2026-08-15 15:32 Heiner Kallweit
2026-08-15 15:40 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2026-08-15 15:32 UTC (permalink / raw)
To: Russell King, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam
Cc: linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
Tom Rini, Ilias Apalodimas, Stefano Babic, NXP i.MX U-Boot Team
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.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
arch/arm/mach-imx/mach-imx6q.c | 30 ------------------------------
include/linux/micrel_phy.h | 5 -----
2 files changed, 35 deletions(-)
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 7f620092575..58f53fba202 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -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();
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index 9c6f9817383..bb71b2510c2 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -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)
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: imx6q: remove KSZ9021 PHY fixup
2026-08-15 15:32 [PATCH] ARM: imx6q: remove KSZ9021 PHY fixup Heiner Kallweit
@ 2026-08-15 15:40 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-08-15 15:40 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Frank.Li, imx
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 <hkallweit1@gmail.com>
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.
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index 7f62009257526..58f53fba202f4 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
[ ... ]
> -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?
--
Sashiko AI review · https://sashiko.dev/#/patchset/8fdc784c-5e2b-40ac-aed8-7639f43df88d@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-15 15:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-15 15:32 [PATCH] ARM: imx6q: remove KSZ9021 PHY fixup Heiner Kallweit
2026-08-15 15:40 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox