Ok iv done some more testing, @daniel / @bmork iv seen that you where able to assist in resolving something similar on the EX5601
I have tested a few mdio / reset configurations, I either get a failed probe of lan6 or it show as a "Generic Clause 45 PHY", so there is somthing wrong with the init process.
Below are the mdio DTS setups I have tried along with the resulting logs for the mdio-bus pobing
&mdio {
reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
reset-delay-us = <1500000>;
reset-post-delay-us = <1000000>;
phy5: phy@5 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <5>;
};
phy6: phy@6 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <6>;
};
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 5 0>;
};
};
[ 4.150439] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[ 4.159390] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[ 4.170119] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 4.192168] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 4.213984] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 4.235777] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 4.257560] mt7530-mdio mdio-bus:1f wan (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 4.268739] mt7530-mdio mdio-bus:1f lan6 (uninitialized): validation of with support 00,00000000,00000000,00006000
[ 4.284734] mt7530-mdio mdio-bus:1f lan6 (uninitialized): failed to connect to PHY: -EINVAL
[ 4.293066] mt7530-mdio mdio-bus:1f lan6 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 5
[ 4.303473] mtk_soc_eth 15100000.ethernet eth0: entered promiscuous mode
&mdio {
phy5: phy@5 {
reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
reset-delay-us = <1500000>;
reset-post-delay-us = <1000000>;
compatible = "ethernet-phy-ieee802.3-c45";
reg = <5>;
};
phy6: phy@6 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <6>;
};
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 5 0>;
};
};
[ 1.530241] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[ 1.539192] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[ 1.549921] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.572001] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.593800] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.615600] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.637405] mt7530-mdio mdio-bus:1f wan (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.648606] mt7530-mdio mdio-bus:1f lan6 (uninitialized): validation of with support 00,00000000,00000000,00006000
[ 1.664601] mt7530-mdio mdio-bus:1f lan6 (uninitialized): failed to connect to PHY: -EINVAL
[ 1.672937] mt7530-mdio mdio-bus:1f lan6 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 5
[ 1.683360] mtk_soc_eth 15100000.ethernet eth0: entered promiscuous mode
&mdio {
reset-delay-us = <1500000>;
reset-post-delay-us = <1000000>;
phy5: phy@5 {
reg = <5>;
reset-gpios = <&pio 6 1>;
reset-deassert-us = <20000>;
compatible = "ethernet-phy-ieee802.3-c45";
};
phy6: phy@6 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <6>;
};
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 5 0>;
};
};
[ 1.570327] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[ 1.579028] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[ 1.590012] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.612104] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.633915] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.655724] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.677521] mt7530-mdio mdio-bus:1f wan (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.768218] mt7530-mdio mdio-bus:1f lan6 (uninitialized): PHY [mdio-bus:05] driver [Generic Clause 45 PHY] (irq=POLL)
&mdio {
reset-delay-us = <1500000>;
reset-post-delay-us = <1000000>;
phy5: phy@5 {
reg = <5>;
compatible = "ethernet-phy-ieee802.3-c45";
reset-gpios = <&pio 6 1>;
reset-assert-us = <50000>;
reset-deassert-us = <20000>;
phy-mode = "2500base-x";
};
phy6: phy@6 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <6>;
};
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 5 0>;
};
};
[ 1.640253] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[ 1.648949] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[ 1.659933] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.682035] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.703859] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.725663] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.747492] mt7530-mdio mdio-bus:1f wan (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=POLL)
[ 1.838184] mt7530-mdio mdio-bus:1f lan6 (uninitialized): PHY [mdio-bus:05] driver [Generic Clause 45 PHY] (irq=POLL)
Also note the switch port setup is always the same (shown below).
&switch {
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "lan1";
};
port@1 {
reg = <1>;
label = "lan2";
};
port@2 {
reg = <2>;
label = "lan3";
};
port@3 {
reg = <3>;
label = "lan4";
};
port@5 {
reg = <5>;
label = "lan6";
phy-mode = "2500base-x";
phy = <&phy5>;
};
port@6 {
reg = <6>;
ethernet = <&gmac0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};
Any advice on debugging this would be appreciated