STM32MP157C Odyssey - Ethernet Support in U-Boot

Hi there,

Dam , Seeed :grin: I guess they thought anyone would want to update the thing, Jeeez…
So I ran tis in the AI and here is what It thinks.

What Works and What Doesn’t?

:white_check_mark: Precompiled U-Boot (from Seeed)Does NOT have the net command.
:white_check_mark: User-compiled U-BootHas net command but no working Ethernet
:white_check_mark: Correct PHY driver enabled (Micrel KSZ9031)
:white_check_mark: Using RGMII (Correct interface for STM32MP1)

:rotating_light: Issue: Device Tree (DTB) configuration is incorrect, causing:

  • U-Boot warnings in DTB compilation (clocks, interrupts, power domains)
  • U-Boot Ethernet fails to initialize (No ethernet found)

It’s fairly accurate on Errors in the compiler so I checked and verified the warnings are interpreted correctly.

  • The Ethernet node in the device tree is missing required clock definitions.
  • STM32MP1 requires a reference clock for EQOS Ethernet.

:small_blue_diamond: Fix: Modify the Ethernet node (ethernet@5800a000) to include the correct clock reference:

ethernet@5800a000 {
    compatible = "st,stm32mp1-dwmac";
    reg = <0x5800a000 0x2000>;
    interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
    interrupt-names = "macirq";
    clocks = <&rcc ETHMAC>;
    clock-names = "stmmaceth";
    status = "okay";
};
  • The Ethernet MAC is missing a proper interrupt configuration.

:small_blue_diamond: Fix: Modify the interrupts-extended property in the ethernet@5800a000 node:

interrupts-extended = <&exti 72 IRQ_TYPE_LEVEL_HIGH>;
  • The device tree is missing a power domain reference for Ethernet.

:small_blue_diamond: Fix: Ensure the Ethernet node includes:

power-domains = <&pd_core>;

Why Is No Ethernet Found in U-Boot?
Answer:

Possible Causes:

  1. Incorrect Pinmux (GPIOs not configured properly for Ethernet MAC & PHY)
  2. Clock, Interrupt, or Power Domain Issues in the DTB
  3. PHY Reset GPIO Not Configured
  4. MDIO Not Properly Linked to the PHY Driver
  5. U-Boot Environment Variables Not Configured for Ethernet

Update the stm32mp157c-odyssey.dts file:

&ethernet0 {
    status = "okay";
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&ethernet0_pins_a>;
    pinctrl-1 = <&ethernet0_pins_sleep_a>;
    phy-mode = "rgmii";
    phy-handle = <&eth_phy>;

    mdio {
        #address-cells = <1>;
        #size-cells = <0>;

        eth_phy: ethernet-phy@7 {
            compatible = "micrel,ksz9031";
            reg = <7>;
            interrupt-parent = <&gpioz>;
            interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
            reset-gpios = <&gpioz 5 GPIO_ACTIVE_LOW>;
        };
    };
};

:small_blue_diamond: What This Fixes:

  • Adds MDIO and PHY node (ethernet-phy@7).
  • Sets phy-handle correctly.
  • Configures PHY reset GPIO (reset-gpios = <&gpioz 5 GPIO_ACTIVE_LOW>;).

After fixing the DTB, rebuild U-Boot and flash
do the tests again…

mdio list
mii info

:white_check_mark: Expected Output:

ethernet@5800a000:
7 - Micrel ksz9031 ↔ ethernet@5800a000

if that is good try the Network interface.
setenv ethaddr xx:xx:xx:xx:xx:xx
setenv ipaddr 192.168.1.100
setenv serverip 192.168.1.1
ping 192.168.1.1

It’s quite the laundry list, maybe it will help. Can’t hurt to try.

GL :slight_smile: PJ :v: