Device Tree Link Mode Configuration for Microchip Switch SoCs

1. Scope

This page describes how to bring up Ethernet and SerDes links on Microchip switch SoCs from device tree, on both the Linux and the U-Boot (mscc-muboot) sides. It covers these devices:

  • Sparx5 (VSC7558 family)

  • LAN969x (LAN9692/LAN9694/LAN9696/LAN9698)

  • LAN966x (LAN9662/LAN9668)

  • LAN9645x (KSZ9897/KSZ9567 class DSA)

The page focuses on cases the existing BSP doc does not currently cover:

  • Backplane-style links (1000BASE-KX, 10GBASE-KR).

  • MAC-to-MAC SerDes links with no external PHY and no SFP.

  • Fixed-speed links without autonegotiation.

  • Links with Clause 37 (1000BASE-X) or SGMII in-band autonegotiation.

The standard copper-PHY case (MDIO plus RGMII or SGMII to a Microchip VSC8221 or VSC8574) is already documented in the BSP doc, and this page reproduces it only as a reference point for the other examples.

2. Background: Linux phy-mode strings and what they mean

The Linux phy-mode property identifies the PCS between the MAC and the next physical block. It does NOT identify the medium. In particular:

For these the phy-mode is the PCS the switch MAC itself runs.

Scenario Linux phy-mode Description

1000BASE-X over optical SFP

1000base-x

1 Gbit/s serial over optical fibre in an SFP cage; in-band PCS autonegotiation at link bring-up

1000BASE-KX over backplane

1000base-x

1 Gbit/s serial over an AC-coupled backplane trace; same PCS as 1000BASE-X, different medium

2.5GBASE-X / 2.5GBASE-KX

2500base-x

Rate-scaled 1000BASE-X at 3.125 Gbit/s line rate (effective 2.5 Gbit/s); no PCS aneg

5GBASE-R / 5GBASE-KR

5gbase-r

Rate-scaled 10GBASE-R at 5.15625 Gbit/s; no PCS aneg; typical for short backplane / DAC use

10GBASE-R over optical SFP

10gbase-r

10 Gbit/s serial over optical SFP+ or DAC twinax (10GBASE-CR is the same mode electrically)

10GBASE-KR over backplane

10gbase-r

10 Gbit/s serial over AC-coupled backplane; optional link training and backplane autoneg

25GBASE-R / 25GBASE-KR

25gbase-r

25 Gbit/s serial over SFP28, DAC, or backplane; optional backplane autoneg; Sparx5 only

The -KX and -KR suffixes only describe the medium (AC-coupled backplane); they do not appear in mainline Linux phy-mode strings.

A BASE-T link uses an external Cu PHY; the wire-side PCS lives inside that PHY. The DT phy-mode therefore describes the MAC-to-PHY SerDes interface, not the wire-side PCS. The Microchip driver supports the following MAC-side interfaces toward a BASE-T PHY:

Scenario Linux phy-mode Description

1000BASE-T, single port

sgmii, rgmii{,-id,-rxid,-txid}

One 1 Gbit/s port to a single Cu PHY (e.g. VSC8221) over SGMII or RGMII

1000BASE-T, quad PHY

qsgmii

Four 1 Gbit/s Cu PHY channels muxed over one SerDes lane toward a quad PHY (VSC8574)

2.5GBASE-T, single port

2500base-x

One 2.5 Gbit/s port to a multigig Cu PHY over rate-scaled BASE-X

2.5GBASE-T, quad PHY

10g-qxgmii

Four 2.5 Gbit/s multigig Cu PHY channels muxed over one 10G SerDes lane

5GBASE-T, single port

5gbase-r

One 5 Gbit/s port to a multigig Cu PHY over rate-scaled BASE-R

10GBASE-T, single port

10gbase-r

One 10 Gbit/s port to a 10G Cu PHY over BASE-R

At the time of writing, Microchip does not offer multigig (2.5G, 5G, or 10G) copper PHYs in-house, so boards that need the lower four rows above pair a Microchip switch with a third-party PHY. The corresponding MAC-side modes are supported by the driver and usable with any PHY that speaks the right host interface.

The PHY runs Clause 28 autonegotiation (or its multigig extensions) toward the cable partner and reports the resolved state in-band to the MAC. The DT side uses phy-handle = <&phyX> to reach the PHY on MDIO and, for SGMII / QSGMII / 10G-QXGMII, managed = "in-band-status" so the MAC tracks the PHY’s in-band status updates. See Example A for SGMII, Example E for QSGMII, and Example F for 10G-QXGMII.

2.3. MDIO management clauses (Clause 22 and Clause 45)

Two IEEE 802.3 clauses often come up in this area but describe MDIO bus transactions, not link operation, and therefore do not drive the DT link-mode choice:

Clause Role Where it applies

22

Legacy MDIO with 5-bit register addresses and direct register access

Microchip 1G Cu PHYs (VSC8221, VSC8574)

45

MDIO MMD with two-stage access, 16-bit register addresses, device IDs

SFP+ / SFP28 modules and anything that needs > 32 regs

These clauses describe how the kernel talks to the PHY on the MDIO bus, not how the MAC-PHY link comes up. phylib selects the right clause from the PHY’s compatible string, so the DT rarely has to say anything about it. When the MDIO controller defaults to Clause 22 and the PHY needs Clause 45, a use-mdio-c45 property on the MDIO bus node switches the default.

2.4. Property summary

The DT expresses the backplane-vs-optical distinction, the fixed-vs-autoneg distinction, and the PHY-vs-SerDes distinction through a small set of link-management properties. The next subsection lists them.

Property Meaning

managed = "in-band-status"

PCS autonegotiation is active (Clause 37 for 1000BASE-X, SGMII in-band for SGMII).

managed = "auto"

Default. phylink picks based on other properties. Use only if behaviour is clearly safe.

fixed-link subnode

No aneg. DT asserts speed / duplex / pause. Typical for MAC-to-MAC and backplane-no-aneg.

phy-handle = <&phyN>

External PHY on MDIO does the aneg; the MAC runs a fixed SerDes mode toward the PHY.

sfp = <&sfpN>

SFP cage. phylink reacts to insertion/removal and to SFP module EEPROM.

2.6. The phys property (Sparx5 / LAN969x)

On Sparx5 and LAN969x each MAC port binds to a specific SerDes lane via the phys property, pointing at the serdes phandle with a lane index:

phys = <&serdes 13>;

The lane index has hard capability limits (next section). The Microchip SerDes driver rejects a lane bind if the requested phy-mode exceeds the lane’s maximum rate.

3. SerDes lane capabilities

3.1. Sparx5

The SerDes driver declares three lane classes at lines 24-25 of sparx5_serdes.c, with maximum rates and supported modes as shown below.

Lane range SerDes type Max rate Modes

0-12

6G

5 Gbit/s

SGMII, QSGMII, 1000BASE-X, 2500BASE-X, 5GBASE-R

13-24

10G

10 Gbit/s

above + 10GBASE-R, 10G-QXGMII

25-32

25G

25 Gbit/s

above + 25GBASE-R

3.2. LAN969x

LAN969x provides only 10G-class SerDes lanes; it has no 25G lanes. Each lane supports the same mode set as a Sparx5 10G lane, with a maximum of 10 Gbit/s per lane.

3.3. LAN966x

LAN966x has no KR-class rates. The driver accepts the following phy-mode strings (see lines 917-931 of lan966x_main.c): MII, RMII, GMII, SGMII, QSGMII, QUSGMII, 1000BASE-X, and 2500BASE-X. For this page that puts LAN966x out of scope for KR work, but in scope for 1000BASE-X/KX links and MAC-to-MAC 2.5G-X links.

3.4. LAN9645x

LAN9645x is a DSA switch that attaches to a host MAC, typically the LAN966x SoC. Its DT structure differs from the other SoCs in several ways, which the LAN9645x section below documents. The driver reports the following per-port phylink capabilities in lan9645x_phylink.c:

Port Capabilities

0-3

Internal Cu PHY, GMII only

4

Internal Cu PHY (GMII) or external RGMII (shadow-port)

5-6

SerDes: QSGMII / 1000BASE-X / 2500BASE-X / SGMII

7-8

CPU / uplink: QSGMII or RGMII{,_RXID,_TXID,_ID}

The MACs support 10, 100, 1000FD, and 2500FD rates. LAN9645x has no 5G, 10G, or 25G MACs, and therefore no KR support.

4. Linux device tree examples

Port nodes in the examples below live under the switch’s ethernet-ports child node, which is typically filled out in a board DTSI via an &switch overlay. Lane indices are schematic-specific.

4.1. Prerequisite nodes (defined once at SoC/board level)

These are the nodes the examples reference via phandle. They are already present in the SoC .dtsi (e.g. sparx5.dtsi) and shown here so the example snippets are unambiguous.

/* SoC-level: serdes and at least one MDIO controller and the switch.
 * Provided by sparx5.dtsi / lan969x.dtsi - reproduced here for reference.
 */
axi: axi@600000000 {
    serdes: serdes@610808000 {
        compatible = "microchip,sparx5-serdes";
        #phy-cells = <1>;
        clocks = <&sys_clk>;
        reg = <0x6 0x10808000 0x5d0000>;
    };

    mdio3: mdio@61101031c {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "mscc,ocelot-miim";
        reg = <0x6 0x1101031c 0x24>;
        status = "disabled";           /* enable in board DTSI */
    };

    switch: switch@600000000 {
        compatible = "microchip,sparx5-switch";
        /* ... reg, interrupts, clocks etc. ... */

        ethernet-ports {
            #address-cells = <1>;
            #size-cells = <0>;
            /* port@N nodes appended by board DTSI via &switch overlay */
        };
    };
};

Examples below use the &switch / &mdio3 overlay style.

4.2. Example A: external Cu PHY via MDIO (baseline)

This is an example of a single-port 1 Gbit/s Cu PHY setup (VSC8221). The PHY runs Clause 28 autonegotiation toward the cable partner over MDIO, and the MAC runs SGMII toward the PHY. The PHY reports the resolved link state in-band to the MAC, so the DT does not need managed = "in-band-status": the phy-handle is sufficient.

Source: the snippet below is the minimal form of the example used on Microchip reference boards with a VSC8221-class PHY.

&mdio3 {
    status = "okay";

    phy10: ethernet-phy@1 {
        reg = <1>;
    };
};

&switch {
    ethernet-ports {
        port10: port@10 {
            reg = <10>;
            microchip,bandwidth = <1000>;
            phys = <&serdes 11>;
            phy-mode = "sgmii";
            phy-handle = <&phy10>;
        };
    };
};

4.3. Example B: 1000BASE-X over optical or copper SFP

The switch MAC drives the SerDes in 1000BASE-X mode and attaches to an SFP cage. The switch PCS performs Clause 37 autonegotiation against the SFP module’s own PCS at link bring-up. phylink reacts to SFP insert and remove events on the cage.

The SFP cage node describes the board-level wiring (I2C bus for the EEPROM, GPIOs for los / mod-def0 / tx-disable / tx-fault).

/ {
    sfp_eth12: sfp-eth12 {
        compatible = "sff,sfp";
        i2c-bus          = <&i2c_sfp1>;
        los-gpios        = <&sgpio_in2  11 1 GPIO_ACTIVE_HIGH>;
        mod-def0-gpios   = <&sgpio_in2  11 2 GPIO_ACTIVE_LOW>;
        tx-disable-gpios = <&sgpio_out2 11 1 GPIO_ACTIVE_LOW>;
        tx-fault-gpios   = <&sgpio_in2  12 0 GPIO_ACTIVE_HIGH>;
    };
};

&switch {
    ethernet-ports {
        port12: port@12 {
            reg = <12>;
            microchip,bandwidth = <1000>;
            phys = <&serdes 13>;
            phy-mode = "1000base-x";
            sfp = <&sfp_eth12>;
            managed = "in-band-status";
        };
    };
};

A 10G SFP cage uses the same structure with phy-mode = "10gbase-r" and a 10G-capable SerDes lane; PCB134 does this for its four 10G SFP+ ports.

This example describes a SerDes link with no autonegotiation, no SFP cage, and no external PHY. The board designer fixes both ends to the same rate. Typical use cases are a backplane trace, an on-board MAC-to-MAC connection, and an SFP+ DAC cable (the SerDes driver treats a DAC cable as the same link type as an optical BASE-R or a backplane -KR).

The template is the same at every rate; only speed, phy-mode, microchip,bandwidth, and the SerDes lane index change.

&switch {
    ethernet-ports {
        portN: port@N {
            reg = <N>;
            microchip,bandwidth = <SPEED_MBPS>;
            phys = <&serdes LANE>;
            phy-mode = "PHY_MODE";
            fixed-link {
                speed = <SPEED_MBPS>;
                full-duplex;
                /* optional: pause; if both ends agree on flow control */
            };
        };
    };
};

Rate-specific substitutions (Sparx5 lane ranges from the SerDes capability table above; LAN969x has only 10G lanes):

Link type phy-mode speed Sparx5 lane ranges

1000BASE-X / -KX

1000base-x

1000

0-32 (any lane)

2500BASE-X / -KX

2500base-x

2500

0-32 (any lane)

5GBASE-R / -KR

5gbase-r

5000

0-32 (any lane)

10GBASE-R / -KR

10gbase-r

10000

13-32 (10G and 25G lanes)

25GBASE-R / -KR

25gbase-r

25000

25-32 (25G lanes, Sparx5 only)

All these modes require full-duplex. The SerDes driver rejects a lane assignment when the lane’s maximum rate falls below the requested rate; see sparx5_serdes_validate() in sparx5_serdes.c.

With no autonegotiation the pause configuration defaults to off or follows an out-of-band agreement. Add pause; inside fixed-link when both ends have agreed on flow control.

4.5. Example D: MAC-to-MAC, 1000BASE-X with Clause 37 aneg

This example uses the same physical setup as example C at 1 Gbit/s, with PCS autonegotiation enabled at both ends. The switch PCS exchanges speed, duplex, and pause with the link partner via the Clause 37 base page. Among the direct-SerDes rates that the Microchip SerDes driver supports, 1000BASE-X is the only one with standard PCS autonegotiation; 2500BASE-X has no aneg by spec, and the BASE-R rates would need Clause 73 backplane autoneg (see Known Limitations).

&switch {
    ethernet-ports {
        port4: port@4 {
            reg = <4>;
            microchip,bandwidth = <1000>;
            phys = <&serdes 4>;
            phy-mode = "1000base-x";
            managed = "in-band-status";
        };
    };
};

4.6. Example E: QSGMII to a Microchip quad 1 Gbit/s Cu PHY

This example carries four independent 1 Gbit/s ports over a single SerDes lane to a Microchip quad Cu PHY (VSC8574). Each port declares its own phy-handle that targets a distinct PHY address on the shared MDIO bus. All four ports share the same SerDes lane through an identical phys value, because QSGMII multiplexes four sub-ports onto one 10G SerDes lane. The SerDes driver configures the lane once; the four MAC blocks on the switch side then de-multiplex the sub-channels.

&mdio0 {
    status = "okay";

    phy0: ethernet-phy@0 { reg = <0>; };
    phy1: ethernet-phy@1 { reg = <1>; };
    phy2: ethernet-phy@2 { reg = <2>; };
    phy3: ethernet-phy@3 { reg = <3>; };
};

&switch {
    ethernet-ports {
        port0: port@0 {
            reg = <0>;
            microchip,bandwidth = <1000>;
            phys = <&serdes 13>;
            phy-handle = <&phy0>;
            phy-mode = "qsgmii";
        };
        port1: port@1 {
            reg = <1>;
            microchip,bandwidth = <1000>;
            phys = <&serdes 13>;
            phy-handle = <&phy1>;
            phy-mode = "qsgmii";
        };
        port2: port@2 {
            reg = <2>;
            microchip,bandwidth = <1000>;
            phys = <&serdes 13>;
            phy-handle = <&phy2>;
            phy-mode = "qsgmii";
        };
        port3: port@3 {
            reg = <3>;
            microchip,bandwidth = <1000>;
            phys = <&serdes 13>;
            phy-handle = <&phy3>;
            phy-mode = "qsgmii";
        };
    };
};

The four switch ports that form a QSGMII group are not arbitrary. Consult the chip’s port-map table for the valid port-to-SerDes-lane groupings on the target SoC.

4.7. Example F: 10G-QXGMII to a quad 2.5 Gbit/s multigig Cu PHY

This example carries four independent 2.5 Gbit/s ports over a single 10G SerDes lane to an external quad multigig Cu PHY. Like QSGMII, all four ports share the same phys value; unlike QSGMII, the MAC-side PCS is USXGMII-based and carries full in-band rate and status signalling per sub-port, so each port can independently run at 10 Mbit/s, 100 Mbit/s, 1 Gbit/s, or 2.5 Gbit/s. The port requires managed = "in-band-status" so that the MAC tracks the PHY’s per-sub-port rate and link state.

The Microchip driver supports this mode on Sparx5 and LAN969x. At the time of writing Microchip does not produce a quad multigig Cu PHY, so boards using this example pair the switch with a third-party PHY that exposes a 10G-QXGMII host interface.

The switch-side port numbers that form a valid 10G-QXGMII quartet are chip-specific. Consult the SoC datasheet for the valid port-to-SerDes-lane groupings.

&mdio3 {
    status = "okay";

    phy0_ext: ethernet-phy@0 { reg = <0>; };
    phy1_ext: ethernet-phy@1 { reg = <1>; };
    phy2_ext: ethernet-phy@2 { reg = <2>; };
    phy3_ext: ethernet-phy@3 { reg = <3>; };
};

&switch {
    ethernet-ports {
        port8: port@8 {
            reg = <8>;
            microchip,bandwidth = <2500>;
            phys = <&serdes 25>;
            phy-handle = <&phy1_ext>;
            phy-mode = "10g-qxgmii";
            managed = "in-band-status";
        };
        port24: port@24 {
            reg = <24>;
            microchip,bandwidth = <2500>;
            phys = <&serdes 25>;
            phy-handle = <&phy2_ext>;
            phy-mode = "10g-qxgmii";
            managed = "in-band-status";
        };
        port40: port@40 {
            reg = <40>;
            microchip,bandwidth = <2500>;
            phys = <&serdes 25>;
            phy-handle = <&phy3_ext>;
            phy-mode = "10g-qxgmii";
            managed = "in-band-status";
        };
        port56: port@56 {
            reg = <56>;
            microchip,bandwidth = <2500>;
            phys = <&serdes 25>;
            phy-handle = <&phy0_ext>;
            phy-mode = "10g-qxgmii";
            managed = "in-band-status";
        };
    };
};

Two further notes apply to this example:

  • The shared SerDes lane must be 10G-capable. On Sparx5 this means lane 13 or higher; on LAN969x every lane is 10G-class.

  • When the PHY needs a post-reset delay before it answers MDIO, set reset-post-delay-us on the MDIO bus node.

5. LAN9645x device tree

LAN9645x is a DSA switch. The DT structure differs from the switchdev-based SoCs (Sparx5, LAN969x, LAN966x) in three main ways:

  1. Port naming: user-visible interfaces use names like lan0 and lan1 instead of eth0. Each port sets its own name through the label property.

  2. CPU / uplink port: one port is the DSA CPU port. It points at the host MAC via ethernet = <&hostPortPhandle> and typically uses fixed-link, because the switch-to-host link is a fixed internal connection that does not run autonegotiation.

  3. SerDes phandle tuple: the phys property takes three cells, <&lan9645x_serdes lane LAN9645X_SERDES6G(index)>, with macros from phy-lan9645x-serdes.h.

One further quirk: placing microchip,shadow-ports = <4 8> in the switch node tells the driver that ports 4 and 8 each have two variants (internal Cu PHY and external RGMII), and that only one variant per shadow pair may be status = "okay" at a time.

5.1. Prerequisite nodes (LAN9645x)

The LAN9645x block lives under an MFD parent on the LAN966x SoC. The examples below reference these nodes. Layout follows lan966x-pcb8385-lan9645x-evb.dts.

/* LAN9645x MFD parent - holds all sub-blocks */
lan9645x: lan9645x@<addr> {
    compatible = "microchip,lan9645x";
    /* ... reg, interrupts, clocks ... */

    /* External MDIO bus for optional RGMII PHYs (ports 4/8 shadow) */
    mdio@4098 {
        reg = <0x4098>;
        compatible = "microchip,lan966x-miim";
        #address-cells = <1>;
        #size-cells = <0>;

        rgmii1: ethernet-phy@1 {
            reg = <1>;
            status = "disabled";     /* enable per-board */
        };
    };

    /* Internal MDIO bus to the on-chip Cu PHYs (ports 0-4) */
    mdio@40bc {
        reg = <0x40bc>, <0>;
        compatible = "microchip,lan966x-miim";
        #address-cells = <1>;
        #size-cells = <0>;

        cuphy0: ethernet-phy@1 { reg = <1>; };
        cuphy1: ethernet-phy@2 { reg = <2>; };
        cuphy2: ethernet-phy@3 { reg = <3>; };
        cuphy3: ethernet-phy@4 { reg = <4>; };
        cuphy4: ethernet-phy@5 { reg = <5>; };
    };

    /* SerDes block - targeted by port@5/6 phys property */
    lan9645x_serdes: serdes@b0000 {
        compatible = "microchip,lan9645x-serdes";
        #phy-cells = <2>;
        reg = <0xb0000 0x10000>;
    };

    /* SFP cages wired to the SerDes ports (board-specific I2C/GPIO) */
    lan_sfp0: sfp0 {
        compatible = "sff,sfp";
        i2c-bus            = <&i2c_sfp0>;
        tx-disable-gpios   = <&gpio_lan9645x 11 GPIO_ACTIVE_HIGH>;
        mod-def0-gpios     = <&gpio_lan9645x 29 GPIO_ACTIVE_LOW>;
        los-gpios          = <&gpio_lan9645x 42 GPIO_ACTIVE_HIGH>;
    };

    /* The DSA switch node itself */
    switch: switch {
        compatible = "microchip,lan9645x-switch";
        dsa,member = <0 0>;

        ethernet-ports {
            #address-cells = <1>;
            #size-cells = <0>;
            /* port@N nodes appended by board DTSI via &switch overlay */
        };
    };
};

/* Host (LAN966x) MAC port that the DSA CPU port conduits to.
 * Provided by lan966x.dtsi, reproduced here as the target of
 * `ethernet = <&port2>` in Example L4.
 */
&lan966x_switch {
    ethernet-ports {
        port2: port@2 {
            reg = <2>;
            phy-mode = "rgmii-id";
            /* fixed-link mirrored on the lan9645x side */
        };
    };
};

5.2. Example L1: internal Cu PHY port (ports 0-3)

Each of ports 0-3 pairs with a dedicated on-chip Cu PHY. The MAC-side interface runs GMII, and the Cu PHY handles Clause 28 autonegotiation toward the cable partner.

&switch {
    ethernet-ports {
        lan0: port@0 {
            reg = <0>;
            label = "lan0";
            phy-mode = "gmii";
            phy-handle = <&cuphy0>;
        };
    };
};

5.3. Example L2: SerDes port with SFP (SGMII in-band)

Ports 5 and 6 are the SerDes ports. A port running at up to 1 Gbit/s attaches to an SFP cage and uses SGMII in-band autonegotiation between the switch PCS and the SFP module.

&switch {
    ethernet-ports {
        lan5: port@5 {
            reg = <5>;
            label = "lan5";
            phys = <&lan9645x_serdes 5 LAN9645X_SERDES6G(0)>;
            phy-mode = "sgmii";
            managed = "in-band-status";
            sfp = <&lan_sfp0>;
        };
    };
};

A 2.5G SFP uses phy-mode = "2500base-x" and drops managed = "in-band-status", because the 2500BASE-X PCS has no standard in-band autonegotiation.

5.4. Example L3: SerDes port MAC-to-MAC, 1000BASE-X/KX fixed

Port 5 or port 6 drives a peer MAC directly, without autonegotiation and without an SFP cage. This example is the LAN9645x equivalent of Example C at 1 Gbit/s.

&switch {
    ethernet-ports {
        lan6: port@6 {
            reg = <6>;
            label = "lan6";
            phys = <&lan9645x_serdes 6 LAN9645X_SERDES6G(1)>;
            phy-mode = "1000base-x";
            fixed-link {
                speed = <1000>;
                full-duplex;
            };
        };
    };
};

To reach 2.5 Gbit/s over the same SerDes port, replace 1000base-x with 2500base-x and speed = <1000> with speed = <2500>.

Port 7 (and, when a second uplink is in use, port 8) connects the LAN9645x DSA switch to the host MAC on the LAN966x SoC. The link is a fixed internal connection with clocking agreed at board design time, so the DT describes it as a fixed-link. The ethernet property marks this port as the DSA CPU port and points at the LAN966x MAC port shown in the prerequisite nodes above.

&switch {
    ethernet-ports {
        lan7: port@7 {
            reg = <7>;
            label = "lan7";
            phy-mode = "rgmii-id";
            ethernet = <&port2>;
            fixed-link {
                speed = <1000>;
                full-duplex;
                pause;
            };
        };
    };
};

The phy-mode string selects which side inserts the 2 ns RGMII clock delay: rgmii-id puts the delay on both sides, rgmii-rxid and rgmii-txid put it on one side, and plain rgmii relies on external delay. The MAC-side delay logic lives in lan9645x_phylink.c.

5.6. Example L5: external RGMII port (ports 4 or 8 via shadow)

When port 4 or port 8 runs in its RGMII variant, it attaches to an external RGMII Cu PHY on the corresponding chip RGMII interface. The board DTSI enables the PHY node that the prerequisite section declared as disabled, and disables the other member of the shadow pair so only one variant is active.

&rgmii1 {
    status = "okay";
};

&switch {
    microchip,shadow-ports = <4 8>;

    ethernet-ports {
        lan8: port@8 {
            reg = <8>;
            label = "lan8";
            phy-mode = "rgmii-id";
            phy-handle = <&rgmii1>;
        };
    };
};

6. U-Boot (mscc-muboot) device tree

The U-Boot MSCC eswitch driver does not use the Linux phy-mode string. Port interfaces are expressed as a 3-tuple in the phys property of the port node:

phys = <IF_<type> FA_SERDES_TYPE_<n>G <lane>>;

with IF_* and FA_SERDES_TYPE_* from sparx5_data.h.

6.1. What the U-Boot driver supports

From lines 978-989 of sparx5_switch.c:

Constant phylink equivalent

IF_SGMII

PHY_INTERFACE_MODE_SGMII

IF_SGMII_CISCO

PHY_INTERFACE_MODE_SGMII

IF_QSGMII

PHY_INTERFACE_MODE_QSGMII

IF_RGMII

PHY_INTERFACE_MODE_NA (RGMII handled outside phylink)

Anything else returns PHY_INTERFACE_MODE_NA and the port will not come up in U-Boot.

6.2. What the U-Boot driver does NOT support today

  • 1000BASE-X / 1000BASE-KX: no IF_BASEX/IF_BASE_KX.

  • 10GBASE-R / 10GBASE-KR: no 10G interface at all.

  • 2500BASE-X, 5GBASE-R, 25GBASE-R.

  • SFP cage handling, managed = "in-band-status", fixed-link.

Consequence: customers needing a backplane or MAC-to-MAC 1G-X / 10G-R link that must be active during U-Boot (for example, netboot) cannot achieve this with the current U-Boot driver. Options:

  1. Use a different management path during U-Boot (RGMII to an on-board PHY, a separate SGMII port, or eMMC / USB boot) and let Linux bring up the backplane link.

  2. Extend the U-Boot eswitch driver to cover the needed modes. This is non-trivial: the driver would need to add 1000BASE-X and/or 10GBASE-R MAC setup plus SerDes preset selection, mirroring what the Linux sparx5_port.c and sparx5_serdes.c already do.

  3. For LAN969x specifically, evaluate whether the LAN969x U-Boot path (board/microchip/lan969x) has any additional modes the Sparx5 path lacks.

6.3. U-Boot DT example: customer’s current SGMII copper setup

Same as the example already used in mscc,sparx5_pcb134.dtsi:

&mdio3 {
    status = "okay";
    pinctrl-0 = <&miim3_pins>;
    pinctrl-names = "default";
    phy0: ethernet-phy@28 {
        reg = <28>;
    };
};

&switch {
    status = "okay";
    ethernet-ports {
        port64: port@64 {
            reg = <64>;
            phy-handle = <&phy0>;
            phys = <IF_SGMII FA_SERDES_TYPE_6G 0>;
        };
    };
};

7. Known limitations

7.1. Clause 73 / Clause 72 not implemented (optional)

The Microchip SerDes driver (sparx5_serdes.c) does not implement 802.3ap / Clause 73 backplane autonegotiation or Clause 72 adaptive equalisation (commonly called "KR link training"). These are OPTIONAL parts of the KR and KX family: the driver brings the link up with static SerDes equalisation presets, the same way the driver already handles DAC (10GBASE-CR) and optical 10GBASE-R links.

For the common cases (short on-board traces, midplane links of moderate length, and DAC cables) the static presets are sufficient, and this is not a functional gap. The board designer statically configures both ends to the same rate at design time.

Clause 73 and Clause 72 only matter when:

  • A long backplane trace needs per-lane equalisation tuned adaptively against the actual loss profile.

  • A blind-mate or mixed-vendor backplane hides the link partner’s rate capabilities from the board design.

Such cases require a different solution: a shorter trace, a retimer, or a rate fallback to 5GBASE-R or 2500BASE-X.

7.2. FEC selection

The driver does not expose BASE-R FEC (Clause 74) or RS-FEC (Clause 91, 25G) via DT. The driver picks a default FEC mode per rate. A link partner that requires a specific FEC behaviour currently requires driver changes.

7.3. U-Boot coverage

As described above, the U-Boot MSCC eswitch driver today supports only SGMII, QSGMII, and RGMII. U-Boot cannot bring up a KX, KR, BASE-X, or BASE-R link without additional driver work.

8. Debug / verification

The following checks help when a fixed-link or managed link fails to come up:

  • ip link show dev ethN reports NO-CARRIER until the PCS locks.

  • ethtool ethN shows the advertised vs. link-partner capabilities. For a fixed-link port, the advertised speed matches the DT.

  • ethtool -m ethN reads the SFP module EEPROM, when an SFP cage is present.

  • The SerDes debugfs directories dump the SerDes registers: check /sys/kernel/debug/mscc_sd10g28/ or /sys/kernel/debug/mscc_sd25g28/ to confirm that the rate preset matches the configured mode.

  • dmesg | grep -i phylink shows the mode that phylink resolved and the reason phylink rejects any mismatched DT at probe time.

  • On a MAC-to-MAC 10GBASE-R link with both ends statically 10G: if the PCS never locks, suspect polarity or pre-emphasis on the physical layer rather than the DT.

9. References