2023-10-18 01:57 AM
STM32MP157AAAC custom board. Ethernet works with ECO 1 & 3.
1. Used CubeMX to a add ethernet. PHY provided clock to MAC. RGMII interface. 1000Mb/s
2. Applied changes exactly as based on the WIKI and as generated by CubeMX to OP-TEE U-boot and Kernel
Boot Log shows
[ 1.548830] stm32-dwmac 5800a000.ethernet: IRQ eth_lpi not found => this also happens on working boards.
[ 1.689460] stm32-dwmac: probe of 5800a000.ethernet failed with error 1
[ 22.383311] using random self ethernet address
[ 22.386439] using random host ethernet address
u-boot seems the interface and mii command work
ifconfig does not show eth0 interface
No other dwmac messages in boot log that those above
Solved! Go to Solution.
2023-10-18 06:49 PM - edited 2023-10-19 12:01 AM
1. The WIKI is incorrect for Reset GPIO, it should have () around GPIO statements.
2. The reset GPIO pin added.. et voila... the PHY now worked . IPv4 address ok
3. The datasheet of PHY's PHY ID seem to mentioned a different ID than the ID read back with u-boot mii read <page> <address>. Uusing the ID from the datasheet worked, the actual ID form the PHY did not. I don't understand this, perhaps it's a driver expecting this value.
2023-10-18 09:35 AM - edited 2023-10-18 09:52 AM
Fixed, Wrong config of PHY (forgot to check the CLK125 in Cube-MX)
https://wiki.st.com/stm32mpu/wiki/Ethernet_device_tree_configuration#DT_configuration
[a] The wiki is ambiguous
<STM32_PINMUX('G', 8, AF2)>, /* ETH_RGMII_ETHCK */
This applies to 3.3.4 (not sure it applies to 3.3.5)
[b] "Need also to update TFA to generate 25 MHz clock (from PLL4P or PLL3Q):"
This should be done in OPTEE, not TF-A
[c] And the code shown for that in the WIKI is probably outdated as MX generates a very different set of parameters
Now Is see this but the problem now is it does not get an IP4 address from DHCP but it has an IPV6 and network cable is connected and the board connects to the network fine using the ECO 1 based boot.
end0 Link encap:Ethernet HWaddr 12:34:56:78:9A:BC
inet6 addr: fe80::1034:56ff:fe78:9abc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:11471 (11.2 KiB)
Interrupt:42
RX bytes is 0, that is strange.
created a file:
/etc/network/interfaces
auto end0
iface end0 inet dhcp
and then ifup end0
root@stm32mp1:~# ifup end0
udhcpc: started, v1.36.0
Dropped protocol specifier '.udhcpc' from 'end0.udhcpc'. Using 'end0' (ifindex=2).
udhcpc: broadcasting discover
[ 2194.399263] stm32-dwmac 5800a000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx
udhcpc: broadcasting discover
udhcpc: broadcasting discover
udhcpc: no lease, forking to background
run-parts: /etc/network/if-up.d: No such file or directory
root@stm32mp1:~# [ 2220.395144] stm32-dwmac 5800a000.ethernet end0: Link is Down
[ 2222.478890] stm32-dwmac 5800a000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx
and RX packets is still 0.
2023-10-18 06:49 PM - edited 2023-10-19 12:01 AM
1. The WIKI is incorrect for Reset GPIO, it should have () around GPIO statements.
2. The reset GPIO pin added.. et voila... the PHY now worked . IPv4 address ok
3. The datasheet of PHY's PHY ID seem to mentioned a different ID than the ID read back with u-boot mii read <page> <address>. Uusing the ID from the datasheet worked, the actual ID form the PHY did not. I don't understand this, perhaps it's a driver expecting this value.