AM69 Configuring SGMII Phys

You raise an excellent point about SGMII interfaces and MDIO addressing. Let me clarify the CPSW architecture for you.

CPSW MDIO Bus Architecture

All ports on the CPSW (Common Platform Ethernet Switch) typically share a single MDIO bus (1). This means that even though you have different SGMII interfaces (SERDES lanes), the PHY management still occurs through one shared MDIO controller. Therefore, each PHY connected to any CPSW port must have a unique MDIO address on that shared bus (1).

CPSW Port Structure

The CPSW is an Ethernet switch with multiple ports, where:

  • Each port can have its own MAC interface (RGMII, SGMII, etc.)
  • Each port connects to its own external PHY
  • All PHYs are managed through the shared MDIO bus
  • Each port gets its own network interface in Linux (eth0, eth1, etc.)

Your Configuration Issue

In your device tree, both PHYs are configured on the same MDIO bus (&main_cpsw0_mdio) with the same address:

&main_cpsw0_mdio {
    status = "okay";
    
    /* Both PHYs have reg = <4> - this creates a conflict */
    cpsw0_port4_phy4: ethernet-phy@4 {
        reg = <4>;
    };
    
    cpsw0_port3_phy4: ethernet-phy@4 {
        reg = <4>;
    };
};

Even though these PHYs connect through different SERDES lanes (SGMII interfaces), they both appear on the same MDIO bus and therefore need unique addresses (2).

Correct Configuration

Each PHY needs a unique MDIO address:

&main_cpsw0_mdio {
    status = "okay";
    
    cpsw0_port4_phy4: ethernet-phy@4 {
        reg = <4>;
        compatible = "ethernet-phy-ieee802.3-c22";
    };
    
    cpsw0_port3_phy3: ethernet-phy@3 {
        reg = <3>;
        compatible = "ethernet-phy-ieee802.3-c22";
    };
};

The SGMII interfaces provide the high-speed serial data paths, but PHY management (reading status, configuring settings) still happens through the shared MDIO bus, which is why unique addressing is required (1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.