RGMII PHY connection doesn't come up 1000Mbps only 100Mbps
I use a STM32MP157C and connected to MAX24287 PHY by RGMII.
After linux booted there is only 100Mbps connection - I put the PHY into Diagnostic Loopback Mode and the situation is the same.
My dts:
ðernet0{
pinctrl-names = "default", "sleep";
pinctrl-0 = <ð1_pins_mx>;
pinctrl-1 = <ð1_sleep_pins_mx>;
status = "okay";
/* USER CODE BEGIN ethernet0 */
phy-mode = "rgmii-id";
max-speed = <1000>;
phy-handle = <&phy0>;
mdio0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
reset-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
reset-delay-us = <10000>;
post-reset-delay-us = <1000>;
phy0: ethernet-phy@3 {
reg = <3>;
sfp;
/* compatible = "ethernet-phy-ieee802.3-c22"; */
/* interrupt-parent = <&gpioa>; */
/* interrupts = <9 IRQ_TYPE_EDGE_FALLING>; */
};
};
/* USER CODE END ethernet0 */
};
The PHY has 25MHz external clock, it gives 125MHz RX_CLK clock to the MAC, and the MAC would have give 125MHz TX_CLK (as GTX_CLK) to the PHY.
But with auto-negotiation the output on TX_CLK is only 25Mhz as 100Mbps.
This readable in the MAC registers:
devmem 0x50000A10 w 0x10800
devmem 0x50020004
0x00200000
devmem 0x500008FC
0x00000000
devmem 0x50000218
0x01004701
devmem 0x5800a000
0x0807E203
here ought to be 0x08072203 but the mac_speed_o[1] bit is "0" after negotiation.
Operating mode configuration register (ETH_MACCR)
Address offset: 0x0000
Reset value: 0x0000 8000
Bit 15 PS: Port Select
This bit selects the Ethernet line speed.
0: For 1000 Mbps operations
1: For 10 or 100 Mbps operations
In 10 or 100 Mbps operations, this bit, along with Bit 14, selects the exact line speed. In the
10/100 Mbps-only (always 1) or 1000 Mbps-only (always 0) configurations, this bit is readonly (RO) with appropriate value. In default 10/100/1000 Mbps configurations, this bit is readwrite (rw). The mac_speed_o[1] signal reflects the value of this bit.
Debug result from MAC registers:
What could be the bad settings?
I could not have any idea more.
Thank you.
