cancel
Showing results for 
Search instead for 
Did you mean: 

No PHY link with DP83867 (RGMII) on STM32MP2 — missing 125MHz clock config?

Bar01
Associate II

 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:

 

&eth2 {
	status = "okay";
	pinctrl-0 = <&eth2_rgmii_pins_a>;
	pinctrl-1 = <&eth2_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!

1 REPLY 1
Erwan SZYMANSKI
ST Employee

Hello @Bar01 ,
I think there is a misunderstanding somewhere regarding your inputs.

eth2 node refers to ETH2 that is the standalone ethernet interface (not linked to the internal TSN switch)

/usr/sbin/ttt-ip-init-systemd.sh script refers to the switch configuration script, involving ETH1 + ETH3 that are connected to the internal switch. They both have their own PHY and this is what you see here 

sw0p3: Connected PHY TI DP83867 at 'stmmac-1:00' to port
sw0p2: Connected PHY TI DP83867 at 'stmmac-1:03' to port

Can you precise on which Ethernet you have trouble that you want to fix ? Maybe you also have some schematics ?

(From my understanding, your issue is only on standalone Ethernet right ?)

Kind regards,
Erwan. 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.