2021-07-15 03:16 AM
Hello,
we want to bring up our own board with STM32MP and ethernet phy LAN8720 (10/100 Mbps).
Seems that kernel is recognizing ethernet phy on boot up and configure it with 100 Mbps Full Duplex.
[ 2.907461] stm32-dwmac 5800a000.ethernet: IRQ eth_lpi not found
[ 2.912172] stm32-dwmac 5800a000.ethernet: PTP uses main clock
[ 2.917902] stm32-dwmac 5800a000.ethernet: no reset control found
[ 2.923940] stm32-dwmac 5800a000.ethernet: No phy clock provided...
[ 2.930837] stm32-dwmac 5800a000.ethernet: User ID: 0x40, Synopsys ID: 0x42
[ 2.937162] stm32-dwmac 5800a000.ethernet: DWMAC4/5
[ 2.942051] stm32-dwmac 5800a000.ethernet: DMA HW capability register supported
[ 2.949371] stm32-dwmac 5800a000.ethernet: RX Checksum Offload Engine supported
[ 2.956661] stm32-dwmac 5800a000.ethernet: TX Checksum insertion supported
[ 2.963500] stm32-dwmac 5800a000.ethernet: Wake-Up On Lan supported
[ 2.969774] stm32-dwmac 5800a000.ethernet: TSO supported
[ 2.975050] stm32-dwmac 5800a000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[ 2.982910] stm32-dwmac 5800a000.ethernet: TSO feature enabled
[ 14.414385] using random self ethernet address
[ 14.478328] using random host ethernet address
[ 17.106903] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [SMSC LAN8710/LAN8720]
[ 17.157900] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 17.163849] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 17.217406] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[ 17.248317] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rmii link mode
[ 19.369837] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 19.462378] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
However there is no connection to my router. I do not get an ip address.
~# ifconfig
eth0 Link encap:Ethernet HWaddr 86:6F:B4:A4:73:6B
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:570 errors:0 dropped:0 overruns:0 frame:0
TX packets:434 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:92105 (89.9 KiB) TX bytes:77256 (75.4 KiB)
Interrupt:50
If I change my ethernet configuration with `ethtool` to 10 Mbps Full Duplex I get an ip address and a connection.
~# ethtool -s eth0 speed 10 duplex full
[ 1980.176613] stm32-dwmac 5800a000.ethernet eth0: Link is Down
[ 1982.888396] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 10Mbps/Full - flow control rx/tx
~# ifconfig
eth0 Link encap:Ethernet HWaddr 86:6F:B4:A4:73:6B
inet addr:192.168.10.155 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::9ed8:22fe:9399:c183/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:729 errors:0 dropped:0 overruns:0 frame:0
TX packets:552 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:117708 (114.9 KiB) TX bytes:93743 (91.5 KiB)
Interrupt:50
~# iperf3 -c 192.168.10.203
Connecting to host 192.168.10.203, port 5201
[ 5] local 192.168.10.155 port 47588 connected to 192.168.10.203 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 1.20 MBytes 10.0 Mbits/sec 0 29.7 KBytes
[ 5] 1.00-2.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
[ 5] 2.00-3.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes
[ 5] 3.00-4.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
[ 5] 4.00-5.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes
[ 5] 5.00-6.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
[ 5] 6.00-7.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
[ 5] 7.00-8.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes
[ 5] 8.00-9.00 sec 1.14 MBytes 9.59 Mbits/sec 0 29.7 KBytes
[ 5] 9.00-10.00 sec 1.09 MBytes 9.17 Mbits/sec 0 29.7 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 11.3 MBytes 9.47 Mbits/sec 0 sender
[ 5] 0.00-10.01 sec 11.2 MBytes 9.41 Mbits/sec receiver
iperf Done.
This is my device tree configuration:
ethernet0: ethernet@5800a000 {
compatible = "st,stm32mp1-dwmac", "snps,dwmac-4.20a";
reg = <0x5800a000 0x2000>;
reg-names = "stmmaceth";
interrupts-extended = <&intc GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,
<&exti 70 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq",
"eth_wake_irq";
clock-names = "stmmaceth",
"mac-clk-tx",
"mac-clk-rx",
"ethstp";
clocks = <&rcc ETHMAC>,
<&rcc ETHTX>,
<&rcc ETHRX>,
<&rcc ETHSTP>;
st,syscon = <&syscfg 0x4>;
snps,mixed-burst;
snps,pbl = <2>;
snps,en-tx-lpi-clockgating;
snps,axi-config = <&stmmac_axi_config_0>;
snps,tso;
power-domains = <&pd_core>;
status = "disabled";
};
ðernet0{
pinctrl-names = "default", "sleep";
pinctrl-0 = <ð1_pins_mx>;
pinctrl-1 = <ð1_sleep_pins_mx>;
status = "okay";
phy-mode = "rmii";
max-speed = <100>;
phy-handle = <&phy0>;
mdio0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
reset-gpios = <&gpioz 7 GPIO_ACTIVE_LOW>;
reset-delay-us = <100000>;
phy0: ethernet-phy@1 {
reg = <1>;
smsc,disable-energy-detect;
};
};
};
eth1_pins_mx: eth1_mx-0 {
pins1 {
pinmux = <STM32_PINMUX('A', 1, AF11)>, /* ETH1_REF_CLK */
<STM32_PINMUX('C', 1, AF11)>, /* ETH1_MDC */
<STM32_PINMUX('G', 13, AF11)>, /* ETH1_TXD0 */
<STM32_PINMUX('G', 14, AF11)>; /* ETH1_TXD1 */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};
pins2 {
pinmux = <STM32_PINMUX('A', 2, AF11)>; /* ETH1_MDIO */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins3 {
pinmux = <STM32_PINMUX('A', 7, AF11)>, /* ETH1_CRS_DV */
<STM32_PINMUX('C', 4, AF11)>, /* ETH1_RXD0 */
<STM32_PINMUX('C', 5, AF11)>; /* ETH1_RXD1 */
bias-disable;
};
pins4 {
pinmux = <STM32_PINMUX('B', 11, AF11)>; /* ETH1_TX_EN */
};
};
I have also read this article but do not get a solution.
Is there a way to configure STM32MP MAC exactly for 100 Mbps?
Or are there any other configurations I can access?
It's strange that there is no problem with 10 Mbps, but 100 Mbps are not possible....
Thanks for help!
Kind regards
Solved! Go to Solution.
2021-07-15 05:40 AM
Hi,
I assume you checked your HW and RJ45 wiring and cable.
Please check Device Tree eth1_pins_mx pin4, seems "bias-disable; drive-push-pull; slew-rate = <1>;" are missing as TX_EN is an output of the STM32MP1.
Your issue is unlikely linked to reset signal, but please have a look to https://wiki.st.com/stm32mpu/wiki/Ethernet_device_tree_configuration#How_to_configure_a_PHY_reset_signal
Regards.
2021-07-15 05:40 AM
Hi,
I assume you checked your HW and RJ45 wiring and cable.
Please check Device Tree eth1_pins_mx pin4, seems "bias-disable; drive-push-pull; slew-rate = <1>;" are missing as TX_EN is an output of the STM32MP1.
Your issue is unlikely linked to reset signal, but please have a look to https://wiki.st.com/stm32mpu/wiki/Ethernet_device_tree_configuration#How_to_configure_a_PHY_reset_signal
Regards.
2021-07-15 07:04 AM
Thanks @PatrickF
bias-disable;
drive-push-pull;
slew-rate = <1>;
was missing in device tree TX_EN.
Now I have my 100 Mbps.
Thanks for good and fast answer!