Skip to contentSkip to conversation

arm64: dts: rockchip: fix Ethernet PHY on Theobroma PX30 devices

PATCH Applied Quentin Schulz 2 participants 4 messages Apr 21 – Apr 27

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

v2 cover arm64: dts: rockchip: fix Ethernet PHY on Theobroma PX30 devices

This removes the reliance on the bootloader setting up the Ethernet PHY for the Linux kernel to be able to use Ethernet.

This is due to the HW default of the PHY reset line being active and the MDIO auto-detection mechanism not controlling a PHY's reset line such that we need to hardcode the PHY ID in the compatible property for it to be usable by the kernel, regardless of what the bootloader is doing.

We only ever had one PHY (DP83825) for both devices, so it's fine to hardcode this way.

As discussed in v1[1][2], even though they suffer from the same limitation, only the patch for Ringneck is targeted for stable releases.

Ethernet is currently broken if the bootloader is built without Ethernet support for those two boards. Cobra is a product for which the software stack can only be replaced or updated by Cherry. Ringneck is a SoM supported since kernel 6.1, the user is likely going to write their own bootloader support based on the motherboard they attach the SoM to. They may disable Ethernet support in the bootloader if they don't need to (e.g. to reduce the attack surface or have an easier time certifying a
device when arguing with an audit company).

Ethernet-less bootloader was supported until commit e463625af7f9 ("arm64: dts: rockchip: move reset to dedicated eth-phy node on ringneck") for Ringneck. Because I do not control what our users have made with Ringneck, and that it used to work before commit e463625af7f9, the patch fixing the issue on Ringneck is a candidate for backporting to stable.

Cobra never supported it due to its support in the kernel being added with this (unknown at the time) limitation. Moreover, Cherry controls the whole software stack so this is already patched downstream whenever required. Therefore, the patch fixing the issue on Cobra is not marked as a candidate for backporting to stable (but if it ends up being backported, it's fine as well).

[1] https://lore.kernel.org/linux-rockchip/[email protected]/
[2] https://lore.kernel.org/linux-rockchip/[email protected]/

---
Changes in v2:
- removed Cc stable on Cobra's patch,
- Link to v1: https://patch.msgid.link/[email protected]

---
Quentin Schulz (2):
arm64: dts: rockchip: fix Ethernet PHY not found on PX30 Cobra
arm64: dts: rockchip: fix Ethernet PHY not found on PX30 Ringneck

 arch/arm64/boot/dts/rockchip/px30-cobra.dtsi    | 2 +-
 arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

---
base-commit: c1f49dea2b8f335813d3b348fd39117fb8efb428
change-id: 20260130-px30-eth-phy-676fa181e116

Best regards,

Signature · 1 line
Quentin Schulz <[email protected]>
#1 lore raw

PATCH v2 1/2 arm64: dts: rockchip: fix Ethernet PHY not found on PX30 Cobra

From: Quentin Schulz <[email protected]>

When not passing the PHY ID with an ethernet-phy-idX.Y compatible property, the MDIO bus will attempt to auto-detect the PHY by reading its registers and then probing the appropriate driver. For this to work, the PHY needs to be in a working state.

Unfortunately, the net subsystem doesn't control the PHY reset GPIO when attempting to auto-detect the PHY. This means the PHY needs to be in a working state when entering the Linux kernel. This historically has been the case for this device, but only because the bootloader was taking care of initializing the Ethernet controller even when not using it. We're attempting to support the removal of the network stack in the bootloader, which means the Linux kernel will be entered with the PHY still in reset and now Ethernet doesn't work anymore.

The devices in the field only ever had a TI DP83825, so let's simply bypass the auto-detection mechanism entirely by passing the appropriate PHY IDs via the compatible.

Fixes bb510ddc9d3e ("arm64: dts: rockchip: add px30-cobra base dtsi and board variants")
---
 arch/arm64/boot/dts/rockchip/px30-cobra.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/px30-cobra.dtsi +1 -1
index b7e669d8ba4d1..add917af5de78 100644
@@ -397,7 +397,7 @@ &io_domains {
 
 &mdio {
 	dp83825: ethernet-phy@0 {
-		compatible = "ethernet-phy-ieee802.3-c22";
+		compatible = "ethernet-phy-id2000.a140";
 		reg = <0x0>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&phy_rst>;
Signature · 1 line
2.53.0
#2 lore raw

PATCH v2 2/2 arm64: dts: rockchip: fix Ethernet PHY not found on PX30 Ringneck

In reply to Quentin Schulz

From: Quentin Schulz <[email protected]>

When not passing the PHY ID with an ethernet-phy-idX.Y compatible property, the MDIO bus will attempt to auto-detect the PHY by reading its registers and then probing the appropriate driver. For this to work, the PHY needs to be in a working state.

Unfortunately, the net subsystem doesn't control the PHY reset GPIO when attempting to auto-detect the PHY. This means the PHY needs to be in a working state when entering the Linux kernel. This historically has been the case for this device, but only because the bootloader was taking care of initializing the Ethernet controller even when not using it. We're attempting to support the removal of the network stack in the bootloader, which means the Linux kernel will be entered with the PHY still in reset and now Ethernet doesn't work anymore.

The devices in the field only ever had a TI DP83825, so let's simply bypass the auto-detection mechanism entirely by passing the appropriate PHY IDs via the compatible.

Note that this is only an issue since commit e463625af7f9 ("arm64: dts:
rockchip: move reset to dedicated eth-phy node on ringneck") as before that commit the reset was done by the MAC controller before starting the MDIO auto-detection mechanism, via the snps,reset-* properties.

Fixes e463625af7f9 ("arm64: dts: rockchip: move reset to dedicated eth-phy node on ringneck")
---
 arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi +1 -1
index 4203b335a2633..973b4c5880e24 100644
@@ -344,7 +344,7 @@ &io_domains {
 
 &mdio {
 	dp83825: ethernet-phy@0 {
-		compatible = "ethernet-phy-ieee802.3-c22";
+		compatible = "ethernet-phy-id2000.a140";
 		reg = <0x0>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&phy_rst>;
Signature · 1 line
2.53.0
maintainer Applied
#3 lore raw
In reply to Quentin Schulz
Quoted 9 lines · Quentin Schulz

This removes the reliance on the bootloader setting up the Ethernet PHY for the Linux kernel to be able to use Ethernet.

This is due to the HW default of the PHY reset line being active and the MDIO auto-detection mechanism not controlling a PHY's reset line such that we need to hardcode the PHY ID in the compatible property for it to be usable by the kernel, regardless of what the bootloader is doing.

[...]

Applied, thanks!

[1/2] arm64: dts: rockchip: fix Ethernet PHY not found on PX30 Cobra

      commit: 6598ed3586a4b1cc79423666e66b9861631a6c7e
[2/2] arm64: dts: rockchip: fix Ethernet PHY not found on PX30 Ringneck
      commit: ae653cb854f36d1555681ce70ca3d80d0ec73516

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>