Ethernet not working when PHY configured in MII mode in custom board using a STM32MP153CA + automotive Ethernet PHY NXP TJA1101.
I cannot make the Ethernet work on my custom board (STM32MP153CA + automotive Ethernet PHY NXP TJA1101) in U-BOOT (haven't even tried loading kernel). The PHY is connected to an external 25MHz xtal. I'm working with 5-10-dunfell-mp1-21-11-17 files included on the 3.1.0 ecosystem. I tried the ecosystem 4.0.1 but got panic errors with RNG, UARTS, etc. After a few days I gave up and went back to 3.1.0
After U-Boot finishes loading, I configure the ethaddr, ipaddr, gatewayip, netmask and serverip, but whatever command I send I got straightaway:
STM32MP> ping 192.168.1.6
--- net_loop Entry
--- net_loop UDP handler set (00000000)
--- net_loop ARP handler set (00000000)
--- net_loop timeout handler cancelled
Trying ethernet@5800a000
eqos_start(dev=ddf05618):
eqos_start_clks_stm32(dev=ddf05618):
clk_enable(clk=ddf07290)
stm32mp1_clk_enable: id clock 105 has been enabled
clk_enable(clk=ddf072b0)
stm32mp1_clk_enable: id clock 104 has been enabled
clk_enable(clk=ddf072f0)
stm32mp1_clk_enable: id clock 103 has been enabled
clk_enable(clk=ddf07310)
stm32mp1_clk_enable: id clock 123 has been enabled
eqos_start_clks_stm32: OK
wait_for_bit_le32: Timeout (reg=5800b000 mask=1 wait_set=0)
EQOS_DMA_MODE_SWR stuckeqos_stop_clks_stm32(dev=ddf05618):
eqos_stop_clks_stm32: OK
FAILED: -110FAIL
ping failed; host 192.168.1.6 is not alive
Command failed, result=1.
I checked with the scope an there's no activity on the MDIO lines nor the TX/RX lines. (TX_CLK and RX_CLK look good though).
My U-Boot device tree looks like this:
ðernet0{
pinctrl-names = "default", "sleep";
pinctrl-0 = <ð1_pins_mx>;
pinctrl-1 = <ð1_sleep_pins_mx>;
status = "okay";
phy-mode = "mii";
max-speed = <100>;
phy-handle = <&phy0>;
nvmem-cells = <ðernet_mac_address>;
nvmem-cell-names = "mac-address";
//phy-reset-gpios = <&gpiof 11 GPIO_ACTIVE_LOW>; //PF11
mdio0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
reset-gpios = <&gpiof 11 GPIO_ACTIVE_LOW>;
reset-delay-us = <1000>;
phy0: ethernet-phy@0 {
compatible = "ethernet-phy-id0060.dd02", "ethernet-phy-ieee802.3-c22";
//reset-gpios = <&gpiof 11 GPIO_ACTIVE_LOW>;
reg = <0>;
};
};
};(It doesn't matter which reset line I activate, the reset doesn't work. I got :
gpio_request_tail: Node 'ethernet-phy@0', property 'reset-gpios', failed to request GPIO index 0: -2
I tried changing the PHY mode to RMII as it's set by default
phy-mode = "rmii";Then I see activity on the MDIO pins and TX pins. Of course I got errors because my PHY is configured in MII mode.
I checked my U-BOOT config and the default option CONFIG_PHY_REALTEK=y was set. I tried with other PHY such as :
CONFIG_PHY_MICREL=y
CONFIG_PHY_MICREL_KSZ8XXX=y
But it didn't work.
Has anyone had a Ethernet PHY working in MII mode?
Do I need a PHY driver for the NXP TJA1101 or I can work with a generic instead?
Any clue why the reset port cannot be configured (regardless of the PHY-MODE)? I got Node 'ethernet-phy@0', property 'reset-gpios', failed to request GPIO index 0: -2
during U-Boot initialization.
Thanks.
