No PHY link with DP83867 (RGMII) on STM32MP2 — missing 125MHz clock config?
Hi,
I've been struggling for a while now with the STM32MP257D, specifically trying to get the TI DP83867 Ethernet PHY working over RGMII. The issue is that my custom board layout doesn't provide a CLK_125MHZ signal from the PHY, so based on the ST tutorial from this link, I add the st,ext-phyclk flag to the eth1/eth2 nodes in the stm32mp251.dtsi and stm32mp253.dtsi files. I also updated my board's .dtsi with the proper compatible and reg entries. Here’s what the eth2 node looks like:
ð2 {
status = "okay";
pinctrl-0 = <ð2_rgmii_pins_a>;
pinctrl-1 = <ð2_rgmii_sleep_pins_a>;
pinctrl-names = "default", "sleep";
phy-mode = "rgmii-id";
max-speed = <100>;
phy-handle = <&phy1_eth2>;
st,eth-ptp-from-rcc;
mdio1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
phy1_eth2: ethernet-phy@12 {
reg = <12>;
compatible = "ethernet-phy-id2000.a231";
ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_75_NS>;
};
};
};But when I boot the board I get this error:
stm32-dwmac 482d0000.eth2 end2: __stmmac_open: Cannot attach to PHY (error: -22)
Interestingly, if I patch /usr/sbin/ttt-ip-init-systemd.sh to tweak the reg addresses, I do get this in the logs:
sw0p3: Connected PHY TI DP83867 at 'stmmac-1:00' to port
sw0p2: Connected PHY TI DP83867 at 'stmmac-1:03' to port
So it looks like the driver sees the PHY, but still, no actual communication is happening on any port.
Now, according to the ST guide I linked above, I should be generating the 125 MHz clock from pll4p or pll3q, but that part of the page seems incomplete (especially for MP2 devices), and I'm not sure if it's even required or how exactly I should do it.
Can someone confirm if that 125MHz clock generation from RCC is mandatory in this case, and maybe give a quick example of how to do it correctly for STM32MP25x?
Thanks in advance!
