renesas: Add compatible properties to Ethernet PHY nodes
Geert Uytterhoeven
maintainercover renesas: Add compatible properties to Ethernet PHY nodes
Hi all,
If an Ethernet PHY reset is asserted when the Ethernet driver is initialized, the PHY cannot be probed:
mdio_bus ee700000.ethernet-ffffffff: MDIO device at address 1 is missing
This happens because the Linux PHY subsystem tries to read the PHY Identifier registers before handling PHY reset. Hence if the PHY reset was asserted before, identification fails.
An easy way to reproduce this issue is by using kexec to launch a new kernel (the PHY reset will be asserted before starting the new kernel), or by unbinding and rebinding the Ethernet driver (the PHY reset will be asserted during unbind), e.g. on koelsch:
echo ee700000.ethernet > /sys/bus/platform/drivers/sh-eth/unbind $ echo ee700000.ethernet > /sys/bus/platform/drivers/sh-eth/bind
The recommended approach[1][2] seems to be working around this issue by adding compatible values to all ethernet-phy nodes, so Linux can identify the PHY at any time, without reading the PHY ID from the device, and regardless of the state of the PHY reset line.
Hence this patch series adds such compatible values to all Ethernet PHY subnodes representing PHYs on all boards with Renesas ARM and ARM64 SoCs. For easier review, I have split the series in one patch per PHY model.
On most boards, I could verify the actual PHY ID at runtime[3], on other boards I had to resort to schematics.
Kexec and Ethernet driver rebind have been tested on Koelsch and Salvator-XS.
I plan to queue these in renesas-devel for v5.16.
Thanks for your comments!
[1] "Re: [PATCH] RFC: net: phy: of phys probe/reset issue"
https://lore.kernel.org/r/[email protected]/
[2] "PHY reset may still be asserted during MDIO probe"
https://lore.kernel.org/r/CAMuHMdXno2OUHqsAfO0z43JmGkFehD+FJ2dEjEsr_P53oAAPxA@mail.gmail.com
[3] The easiest way to obtain the PHY ID is by adding a debug print to drivers/net/phy/phy_device.c:get_phy_c22_id(), _before_ applying this patch.
Geert Uytterhoeven (9):
ARM: dts: renesas: Add compatible properties to KSZ8041 Ethernet PHYs
ARM: dts: renesas: Add compatible properties to KSZ8081 Ethernet PHYs
ARM: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
iARM: dts: renesas: Add compatible properties to LAN8710A Ethernet
PHYs
ARM: dts: renesas: Add compatible properties to RTL8201FL Ethernet
PHYs
ARM: dts: renesas: Add compatible properties to uPD6061x Ethernet PHYs
arm64: dts: renesas: Add compatible properties to AR8031 Ethernet PHYs
arm64: dts: renesas: Add compatible properties to KSZ9031 Ethernet
PHYs
arm64: dts: renesas: Add compatible properties to RTL8211E Ethernet
PHYs
arch/arm/boot/dts/iwg20d-q7-common.dtsi | 2 ++ arch/arm/boot/dts/r7s72100-genmai.dts | 2 ++ arch/arm/boot/dts/r7s72100-gr-peach.dts | 2 ++ arch/arm/boot/dts/r7s72100-rskrza1.dts | 2 ++ arch/arm/boot/dts/r7s9210-rza2mevb.dts | 2 ++ arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 2 ++ arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 2 ++ arch/arm/boot/dts/r8a7742-iwg21d-q7.dts | 2 ++ arch/arm/boot/dts/r8a7743-sk-rzg1m.dts | 2 ++ arch/arm/boot/dts/r8a7745-iwg22d-sodimm.dts | 2 ++ arch/arm/boot/dts/r8a7745-sk-rzg1e.dts | 2 ++ arch/arm/boot/dts/r8a77470-iwg23s-sbc.dts | 2 ++ arch/arm/boot/dts/r8a7790-lager.dts | 2 ++ arch/arm/boot/dts/r8a7790-stout.dts | 2 ++ arch/arm/boot/dts/r8a7791-koelsch.dts | 2 ++ arch/arm/boot/dts/r8a7791-porter.dts | 2 ++ arch/arm/boot/dts/r8a7793-gose.dts | 2 ++ arch/arm/boot/dts/r8a7794-alt.dts | 2 ++ arch/arm/boot/dts/r8a7794-silk.dts | 2 ++ arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi | 2 ++ arch/arm64/boot/dts/renesas/cat875.dtsi | 2 ++ arch/arm64/boot/dts/renesas/draak.dtsi | 2 ++ arch/arm64/boot/dts/renesas/ebisu.dtsi | 2 ++ arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi | 2 ++ arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 2 ++ arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts | 2 ++ arch/arm64/boot/dts/renesas/r8a77980-condor.dts | 2 ++ arch/arm64/boot/dts/renesas/r8a77980-v3hsk.dts | 2 ++ arch/arm64/boot/dts/renesas/r8a779a0-falcon.dts | 2 ++ arch/arm64/boot/dts/renesas/salvator-common.dtsi | 2 ++ arch/arm64/boot/dts/renesas/ulcb.dtsi | 2 ++ 31 files changed, 62 insertions(+)
Signature · 12 lines
2.25.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus TorvaldsGeert Uytterhoeven
maintainerPATCH 1/9 ARM: dts: renesas: Add compatible properties to KSZ8041 Ethernet PHYs
Add compatible values to Ethernet PHY subnodes representing Micrel KSZ8041 PHYs on RZ/G1 and R-Car Gen2 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
--- arch/arm/boot/dts/r8a7743-sk-rzg1m.dts | 2 ++ arch/arm/boot/dts/r8a7745-sk-rzg1e.dts | 2 ++ arch/arm/boot/dts/r8a7790-lager.dts | 2 ++ arch/arm/boot/dts/r8a7790-stout.dts | 2 ++ arch/arm/boot/dts/r8a7791-koelsch.dts | 2 ++ arch/arm/boot/dts/r8a7791-porter.dts | 2 ++ arch/arm/boot/dts/r8a7793-gose.dts | 2 ++ arch/arm/boot/dts/r8a7794-alt.dts | 2 ++ arch/arm/boot/dts/r8a7794-silk.dts | 2 ++ 9 files changed, 18 insertions(+)
arch/arm/boot/dts/r8a7743-sk-rzg1m.dts +2 -0
@@ -69,6 +69,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
arch/arm/boot/dts/r8a7745-sk-rzg1e.dts +2 -0
@@ -64,6 +64,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc>; interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
arch/arm/boot/dts/r8a7790-lager.dts +2 -0
@@ -678,6 +678,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc0>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
arch/arm/boot/dts/r8a7790-stout.dts +2 -0
@@ -199,6 +199,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc0>; interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
arch/arm/boot/dts/r8a7791-koelsch.dts +2 -0
@@ -637,6 +637,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc0>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
arch/arm/boot/dts/r8a7791-porter.dts +2 -0
@@ -302,6 +302,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc0>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
arch/arm/boot/dts/r8a7793-gose.dts +2 -0
@@ -595,6 +595,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc0>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
arch/arm/boot/dts/r8a7794-alt.dts +2 -0
@@ -383,6 +383,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc0>; interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
arch/arm/boot/dts/r8a7794-silk.dts +2 -0
@@ -397,6 +397,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1537", + "ethernet-phy-ieee802.3-c22"; reg = <1>; interrupt-parent = <&irqc0>; interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
Signature · 1 line
2.25.1
Geert Uytterhoeven
maintainerPATCH 2/9 ARM: dts: renesas: Add compatible properties to KSZ8081 Ethernet PHYs
In reply to Geert UytterhoevenAdd compatible values to Ethernet PHY subnodes representing Micrel KSZ8081 PHYs on RZ/G1 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
---
I could not verify the PHY revision number (least significant nibble of the ID), due to lack of hardware.
--- arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts +2 -0
@@ -66,6 +66,8 @@ ðer { status = "okay"; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id0022.1560", + "ethernet-phy-ieee802.3-c22"; reg = <1>; micrel,led-mode = <1>; };
Signature · 1 line
2.25.1
Geert Uytterhoeven
maintainerPATCH 3/9 ARM: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
In reply to Geert UytterhoevenAdd compatible values to Ethernet PHY subnodes representing Micrel KSZ9031 PHYs on RZ/G1 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
---
I could not verify the PHY revision number (least significant nibble of the ID), due to lack of hardware.
--- arch/arm/boot/dts/iwg20d-q7-common.dtsi | 2 ++ arch/arm/boot/dts/r8a7742-iwg21d-q7.dts | 2 ++ arch/arm/boot/dts/r8a7745-iwg22d-sodimm.dts | 2 ++ arch/arm/boot/dts/r8a77470-iwg23s-sbc.dts | 2 ++ 4 files changed, 8 insertions(+)
arch/arm/boot/dts/iwg20d-q7-common.dtsi +2 -0
@@ -158,6 +158,8 @@ &avb { status = "okay"; phy3: ethernet-phy@3 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <3>; micrel,led-mode = <1>; };
arch/arm/boot/dts/r8a7742-iwg21d-q7.dts +2 -0
@@ -175,6 +175,8 @@ &avb { status = "okay"; phy3: ethernet-phy@3 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <3>; micrel,led-mode = <1>; };
arch/arm/boot/dts/r8a7745-iwg22d-sodimm.dts +2 -0
@@ -123,6 +123,8 @@ phy3: ethernet-phy@3 { * On some older versions of the platform (before R4.0) the phy address * may be 1 or 3. The address is fixed to 3 for R4.0 onwards. */ + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <3>; micrel,led-mode = <1>; };
arch/arm/boot/dts/r8a77470-iwg23s-sbc.dts +2 -0
@@ -79,6 +79,8 @@ &avb { status = "okay"; phy3: ethernet-phy@3 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <3>; interrupt-parent = <&gpio5>; interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
Signature · 1 line
2.25.1
RE: [PATCH 3/9] ARM: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
Hi Geert,
Thanks for the patch. Tested the patch on iWave RZ/G1N board.
Regards,
Biju
Quoted 88 lines
-----Original Message-----
From: Geert Uytterhoeven <[email protected]>
Sent: 09 September 2021 09:50
To: Magnus Damm <[email protected]>
Cc: Biju Das <[email protected]>; Adam Ford <[email protected]>; Florian Fainelli <[email protected]>; Andrew Lunn <[email protected]>; Heiner Kallweit <[email protected]>; Russell King <[email protected]>; Grygorii Strashko <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 3/9] ARM: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYsAdd compatible values to Ethernet PHY subnodes representing Micrel KSZ9031 PHYs on RZ/G1 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
Signed-off-by Geert Uytterhoeven <[email protected]>---
I could not verify the PHY revision number (least significant nibble of the ID), due to lack of hardware.--- arch/arm/boot/dts/iwg20d-q7-common.dtsi | 2 ++ arch/arm/boot/dts/r8a7742-iwg21d-q7.dts | 2 ++ arch/arm/boot/dts/r8a7745-iwg22d-sodimm.dts | 2 ++ arch/arm/boot/dts/r8a77470-iwg23s-sbc.dts | 2 ++ 4 files changed, 8 insertions(+)arch/arm/boot/dts/iwg20d-q7-common.dtsi +2
-0@@ -158,6 +158,8 @@ &avb { status = "okay"; phy3: ethernet-phy@3 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <3>; micrel,led-mode = <1>; };arch/arm/boot/dts/r8a7742-iwg21d-q7.dts +2
-0@@ -175,6 +175,8 @@ &avb { status = "okay"; phy3: ethernet-phy@3 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <3>; micrel,led-mode = <1>; };arch/arm/boot/dts/r8a7745-iwg22d-sodimm.dts +0
-0@@ -123,6 +123,8 @@ phy3: ethernet-phy@3 { * On some older versions of the platform (before R4.0) the phyaddress
arch/arm/boot/dts/r8a7745-iwg22d-sodimm.dts +2
-0* may be 1 or 3. The address is fixed to 3 for R4.0 onwards. */ + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <3>; micrel,led-mode = <1>; };arch/arm/boot/dts/r8a77470-iwg23s-sbc.dts +2
-1@@ -79,6 +79,8 @@ &avb { status = "okay"; phy3: ethernet-phy@3 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <3>; interrupt-parent = <&gpio5>; interrupts = <16 IRQ_TYPE_LEVEL_LOW>; --2.25.1
Geert Uytterhoeven
maintainerPATCH 4/9 iARM: dts: renesas: Add compatible properties to LAN8710A Ethernet PHYs
In reply to Geert UytterhoevenAdd compatible values to Ethernet PHY subnodes representing SMSC LAN8710A PHYs on RZ/A1 and R-Mobile A1 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
---
I could not verify the PHY revision number (least significant nibble of the ID) on gr-peach, due to lack of hardware.
--- arch/arm/boot/dts/r7s72100-gr-peach.dts | 2 ++ arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 2 ++ 2 files changed, 4 insertions(+)
arch/arm/boot/dts/r7s72100-gr-peach.dts +2 -0
@@ -129,6 +129,8 @@ ðer { phy-handle = <&phy0>; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0007.c0f0", + "ethernet-phy-ieee802.3-c22"; reg = <0>; reset-gpios = <&port4 2 GPIO_ACTIVE_LOW>;
arch/arm/boot/dts/r8a7740-armadillo800eva.dts +2 -0
@@ -180,6 +180,8 @@ ðer { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0007.c0f1", + "ethernet-phy-ieee802.3-c22"; reg = <0>; }; };
Signature · 1 line
2.25.1
Geert Uytterhoeven
maintainerPATCH 5/9 ARM: dts: renesas: Add compatible properties to RTL8201FL Ethernet PHYs
In reply to Geert UytterhoevenAdd compatible values to Ethernet PHY subnodes representing Realtek RTL8201FL PHYs on RZ/A2 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
--- arch/arm/boot/dts/r7s9210-rza2mevb.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/r7s9210-rza2mevb.dts +2 -0
@@ -100,6 +100,8 @@ ðer1 { renesas,no-ether-link; phy-handle = <&phy1>; phy1: ethernet-phy@1 { + compatible = "ethernet-phy-id001c.c816", + "ethernet-phy-ieee802.3-c22"; reg = <0>; }; };
Signature · 1 line
2.25.1
Geert Uytterhoeven
maintainerPATCH 6/9 ARM: dts: renesas: Add compatible properties to uPD6061x Ethernet PHYs
In reply to Geert UytterhoevenAdd compatible values to Ethernet PHY subnodes representing Renesas uPD60610 or uPD60611 PHYs on RZ/A1 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
--- arch/arm/boot/dts/r7s72100-genmai.dts | 2 ++ arch/arm/boot/dts/r7s72100-rskrza1.dts | 2 ++ 2 files changed, 4 insertions(+)
arch/arm/boot/dts/r7s72100-genmai.dts +2 -0
@@ -108,6 +108,8 @@ ðer { renesas,no-ether-link; phy-handle = <&phy0>; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-idb824.2814", + "ethernet-phy-ieee802.3-c22"; reg = <0>; }; };
arch/arm/boot/dts/r7s72100-rskrza1.dts +2 -0
@@ -193,6 +193,8 @@ ðer { renesas,no-ether-link; phy-handle = <&phy0>; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-idb824.2814", + "ethernet-phy-ieee802.3-c22"; reg = <0>; }; };
Signature · 1 line
2.25.1
Geert Uytterhoeven
maintainerPATCH 7/9 arm64: dts: renesas: Add compatible properties to AR8031 Ethernet PHYs
In reply to Geert UytterhoevenAdd compatible values to Ethernet PHY subnodes representing Atheros AR8031 PHYs on RZ/G2 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
--- arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi +2 -0
@@ -58,6 +58,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id004d.d074", + "ethernet-phy-ieee802.3-c22"; reg = <0>; interrupt-parent = <&gpio2>; interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
Signature · 1 line
2.25.1
Geert Uytterhoeven
maintainerPATCH 8/9 arm64: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
In reply to Geert UytterhoevenAdd compatible values to Ethernet PHY subnodes representing Micrel KSZ9031 PHYs on R-Car Gen3 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
---
I could not verify the PHY revision number (least significant nibble of the ID) on eagle, v3msk, conder, and v3hsk, due to lack of hardware.
--- arch/arm64/boot/dts/renesas/draak.dtsi | 2 ++ arch/arm64/boot/dts/renesas/ebisu.dtsi | 2 ++ arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 2 ++ arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts | 2 ++ arch/arm64/boot/dts/renesas/r8a77980-condor.dts | 2 ++ arch/arm64/boot/dts/renesas/r8a77980-v3hsk.dts | 2 ++ arch/arm64/boot/dts/renesas/r8a779a0-falcon.dts | 2 ++ arch/arm64/boot/dts/renesas/salvator-common.dtsi | 2 ++ arch/arm64/boot/dts/renesas/ulcb.dtsi | 2 ++ 9 files changed, 18 insertions(+)
arch/arm64/boot/dts/renesas/draak.dtsi +2 -0
@@ -243,6 +243,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; rxc-skew-ps = <1500>; reg = <0>; interrupt-parent = <&gpio5>;
arch/arm64/boot/dts/renesas/ebisu.dtsi +2 -0
@@ -302,6 +302,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; rxc-skew-ps = <1500>; reg = <0>; interrupt-parent = <&gpio2>;
arch/arm64/boot/dts/renesas/r8a77970-eagle.dts +2 -0
@@ -92,6 +92,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; rxc-skew-ps = <1500>; reg = <0>; interrupt-parent = <&gpio1>;
arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts +2 -0
@@ -107,6 +107,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; rxc-skew-ps = <1500>; reg = <0>; interrupt-parent = <&gpio1>;
arch/arm64/boot/dts/renesas/r8a77980-condor.dts +2 -0
@@ -132,6 +132,8 @@ &gether { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; rxc-skew-ps = <1500>; reg = <0>; interrupt-parent = <&gpio4>;
arch/arm64/boot/dts/renesas/r8a77980-v3hsk.dts +2 -0
@@ -113,6 +113,8 @@ &gether { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; reg = <0>; interrupt-parent = <&gpio4>; interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
arch/arm64/boot/dts/renesas/r8a779a0-falcon.dts +2 -0
@@ -27,6 +27,8 @@ &avb0 { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; rxc-skew-ps = <1500>; reg = <0>; interrupt-parent = <&gpio4>;
arch/arm64/boot/dts/renesas/salvator-common.dtsi +2 -0
@@ -346,6 +346,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; rxc-skew-ps = <1500>; reg = <0>; interrupt-parent = <&gpio2>;
arch/arm64/boot/dts/renesas/ulcb.dtsi +2 -0
@@ -154,6 +154,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id0022.1622", + "ethernet-phy-ieee802.3-c22"; rxc-skew-ps = <1500>; reg = <0>; interrupt-parent = <&gpio2>;
Signature · 1 line
2.25.1
Re: [PATCH 8/9] arm64: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
Quoted 8 lines · Geert Uytterhoeven
Add compatible values to Ethernet PHY subnodes representing Micrel KSZ9031 PHYs on R-Car Gen3 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
Signed-off-by Geert Uytterhoeven <[email protected]>---
I could not verify the PHY revision number (least significant nibble of the ID) on eagle, v3msk, conder, and v3hsk, due to lack of hardware.
In the meantime, I managed to verify the PHY revision number on Eagle.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Geert Uytterhoeven
maintainerPATCH 9/9 arm64: dts: renesas: Add compatible properties to RTL8211E Ethernet PHYs
In reply to Geert UytterhoevenAdd compatible values to Ethernet PHY subnodes representing Realtek RTL8211E PHYs on RZ/G2 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
--- arch/arm64/boot/dts/renesas/cat875.dtsi | 2 ++ arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi | 2 ++ 2 files changed, 4 insertions(+)
arch/arm64/boot/dts/renesas/cat875.dtsi +2 -0
@@ -21,6 +21,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id001c.c915", + "ethernet-phy-ieee802.3-c22"; reg = <0>; interrupt-parent = <&gpio2>; interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +2 -0
@@ -24,6 +24,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id001c.c915", + "ethernet-phy-ieee802.3-c22"; reg = <0>; interrupt-parent = <&gpio2>; interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
Signature · 1 line
2.25.1
RE: [PATCH 9/9] arm64: dts: renesas: Add compatible properties to RTL8211E Ethernet PHYs
Hi Geert,
Thanks for the patch. Tested the patch on Hihope RZ/G2M board.
Regards,
Biju
Quoted 54 lines
-----Original Message-----
From: Geert Uytterhoeven <[email protected]>
Sent: 09 September 2021 09:50
To: Magnus Damm <[email protected]>
Cc: Biju Das <[email protected]>; Adam Ford <[email protected]>; Florian Fainelli <[email protected]>; Andrew Lunn <[email protected]>; Heiner Kallweit <[email protected]>; Russell King <[email protected]>; Grygorii Strashko <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 9/9] arm64: dts: renesas: Add compatible properties to RTL8211E Ethernet PHYsAdd compatible values to Ethernet PHY subnodes representing Realtek RTL8211E PHYs on RZ/G2 boards. This allows software to identify the PHY model at any time, regardless of the state of the PHY reset line.
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/arm64/boot/dts/renesas/cat875.dtsi | 2 ++ arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi | 2 ++ 2 files changed, 4 insertions(+)arch/arm64/boot/dts/renesas/cat875.dtsi +2
-0@@ -21,6 +21,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id001c.c915", + "ethernet-phy-ieee802.3-c22"; reg = <0>; interrupt-parent = <&gpio2>; interrupts = <21 IRQ_TYPE_LEVEL_LOW>; diff --git
a/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsib/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi
indexdde3a07bc417c690..ad898c6db4e62df6100644arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +2
-1@@ -24,6 +24,8 @@ &avb { status = "okay"; phy0: ethernet-phy@0 { + compatible = "ethernet-phy-id001c.c915", + "ethernet-phy-ieee802.3-c22"; reg = <0>; interrupt-parent = <&gpio2>; interrupts = <11 IRQ_TYPE_LEVEL_LOW>; --2.25.1
Quoted 30 lines · Geert Uytterhoeven
If an Ethernet PHY reset is asserted when the Ethernet driver is initialized, the PHY cannot be probed:
mdio_busee700000.ethernet-ffffffff: MDIO device at address 1 is missingThis happens because the Linux PHY subsystem tries to read the PHY Identifier registers before handling PHY reset. Hence if the PHY reset was asserted before, identification fails.
An easy way to reproduce this issue is by using kexec to launch a new kernel (the PHY reset will be asserted before starting the new kernel), or by unbinding and rebinding the Ethernet driver (the PHY reset will be asserted during unbind), e.g. on koelsch:
echo ee700000.ethernet >
/sys/bus/platform/drivers/sh-eth/unbind$ echo ee700000.ethernet >/sys/bus/platform/drivers/sh-eth/bindThe recommended approach[1][2] seems to be working around this issue by adding compatible values to all ethernet-phy nodes, so Linux can identify the PHY at any time, without reading the PHY ID from the device, and regardless of the state of the PHY reset line.
Hence this patch series adds such compatible values to all Ethernet PHY subnodes representing PHYs on all boards with Renesas ARM and ARM64 SoCs. For easier review, I have split the series in one patch per PHY model.
On most boards, I could verify the actual PHY ID at runtime[3], on other boards I had to resort to schematics.
Quoted 6 lines
Kexec and Ethernet driver rebind have been tested on Koelsch and Salvator-XS.
I plan to queue these in renesas-devel for v5.16.
Thanks for your comments!
I'd be very grateful for comments (e.g. Acked-by) from the Ethernet PHY people.
Thanks again!
Quoted 8 lines
[1] "Re: [PATCH] RFC: net: phy: of phys probe/reset issue"
https://lore.kernel.org/r/[email protected]/[2] "PHY reset may still be asserted during MDIO probe"
https://lore.kernel.org/r/CAMuHMdXno2OUHqsAfO0z43JmGkFehD+FJ2dEjEsr_P53oAAPxA@mail.gmail.com
[3] The easiest way to obtain the PHY ID is by adding a debug print to drivers/net/phy/phy_device.c:get_phy_c22_id(), _before_ applying this patch.
Quoted 14 lines
Geert Uytterhoeven (9):
ARM: dts: renesas: Add compatible properties to KSZ8041 Ethernet PHYs
ARM: dts: renesas: Add compatible properties to KSZ8081 Ethernet PHYs
ARM: dts: renesas: Add compatible properties to KSZ9031 Ethernet PHYs
iARM: dts: renesas: Add compatible properties to LAN8710A Ethernet
PHYs
ARM: dts: renesas: Add compatible properties to RTL8201FL Ethernet
PHYs
ARM: dts: renesas: Add compatible properties to uPD6061x Ethernet PHYs
arm64: dts: renesas: Add compatible properties to AR8031 Ethernet PHYs
arm64: dts: renesas: Add compatible properties to KSZ9031 Ethernet
PHYs
arm64: dts: renesas: Add compatible properties to RTL8211E Ethernet
PHYs
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Andrew Lunn
Reviewed-byQuoted 24 lines · Geert Uytterhoeven
Quoted 22 lines · Geert Uytterhoeven
If an Ethernet PHY reset is asserted when the Ethernet driver is initialized, the PHY cannot be probed:
mdio_busee700000.ethernet-ffffffff: MDIO device at address 1 is missingThis happens because the Linux PHY subsystem tries to read the PHY Identifier registers before handling PHY reset. Hence if the PHY reset was asserted before, identification fails.
An easy way to reproduce this issue is by using kexec to launch a new kernel (the PHY reset will be asserted before starting the new kernel), or by unbinding and rebinding the Ethernet driver (the PHY reset will be asserted during unbind), e.g. on koelsch:
echo ee700000.ethernet >
/sys/bus/platform/drivers/sh-eth/unbind$ echo ee700000.ethernet >/sys/bus/platform/drivers/sh-eth/bindThe recommended approach[1][2] seems to be working around this issue by adding compatible values to all ethernet-phy nodes, so Linux can identify the PHY at any time, without reading the PHY ID from the device, and regardless of the state of the PHY reset line.
Quoted 4 lines
Quoted 4 lines
Hence this patch series adds such compatible values to all Ethernet PHY subnodes representing PHYs on all boards with Renesas ARM and ARM64 SoCs. For easier review, I have split the series in one patch per PHY model.
It is a reasonable approach.
Andrew