bootlin / buildroot-external-st

External Buildroot tree for STMicroelectronics boards configurations
56 stars 28 forks source link

Ethernet does not work on STM32MP157F-DK2 #35

Closed Tidone closed 1 year ago

Tidone commented 1 year ago

Hi,

I've built the minimal image for the stm32mp157f-dk2. It's booting, but it won't connect to the network:

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:80:e1:42:81:f3 brd ff:ff:ff:ff:ff:ff

# dmesg | grep eth
[    0.000000] psci: probing for conduit method from DT.
[    0.276082] usbcore: registered new interface driver cdc_ether
[    0.292106] optee: probing for conduit method.
[    1.635561] stm32-dwmac 5800a000.ethernet: IRQ eth_lpi not found
[    1.641199] stm32-dwmac 5800a000.ethernet: User ID: 0x40, Synopsys ID: 0x42
[    1.647225] stm32-dwmac 5800a000.ethernet:   DWMAC4/5
[    1.652153] stm32-dwmac 5800a000.ethernet: DMA HW capability register supported
[    1.659475] stm32-dwmac 5800a000.ethernet: RX Checksum Offload Engine supported
[    1.666765] stm32-dwmac 5800a000.ethernet: TX Checksum insertion supported
[    1.673664] stm32-dwmac 5800a000.ethernet: Wake-Up On Lan supported
[    1.680083] stm32-dwmac 5800a000.ethernet: TSO supported
[    1.685158] stm32-dwmac 5800a000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    1.693107] stm32-dwmac 5800a000.ethernet: Enabled L3L4 Flow TC (entries=2)
[    1.700018] stm32-dwmac 5800a000.ethernet: Enabled RFS Flow TC (entries=8)
[    1.706904] stm32-dwmac 5800a000.ethernet: TSO feature enabled
[    1.712696] stm32-dwmac 5800a000.ethernet: Using 32 bits DMA width

It looks like the kernel does not load the PHY driver. If I load the official OpenSTLinux image, some additional messages show up, which are missing in the buildroot image:

[   18.237708] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:00] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
[   18.258405] stm32-dwmac 5800a000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   18.287737] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[   18.293876] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   18.308811] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[   18.322003] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[   22.563786] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

Do you know how to fix this?

Tidone commented 1 year ago

OK, I found the issue: You have to add the BR2_SYSTEM_DHCP="eth0" option to the defconfig file to automatically activate DHCP and the port itself.