[PATCH net-next RFC 0/5] net: phy: Introduce a port representation

Oleksij Rempel o.rempel at pengutronix.de
Sun Dec 22 10:54:37 PST 2024


On Sun, Dec 22, 2024 at 04:59:43PM +0100, Oleksij Rempel wrote:
> ### Proposed Port Description Schema
> 
> Here’s how I imagine the port description could look to address these issues:
> 
> #### **Device Tree Example**
> /* Ports should be in the root of DT */
> ports {
>     /* Twisted-Pair Example */
>     port0: ethernet-port at 0 {
>         reg = <0>; /* Port index */
>         label = "ETH0"; /* Physical label on the device */
>         connector = "RJ45"; /* Connector type */
>         supported-modes = <10BaseT 100BaseTX>; /* Supported modes */
> 
>         pairs {
>             pair at 0 {
>                 name = "A"; /* Pair A */
>                 pins = <1 2>; /* Connector pins */
>                 phy-mapping = <PHY_TX0_P PHY_TX0_N>; /* PHY pin mapping */
>                 pse-mapping = <PSE_OUT0_P PSE_OUT0_N>; /* PSE pin mapping */
>             };
>             pair at 1 {
>                 name = "B"; /* Pair B */
>                 pins = <3 6>;
>                 phy-mapping = <PHY_RX0_P PHY_RX0_N>;
>                 pse-mapping = <PSE_OUT1_P PSE_OUT1_N>;
>             };
>         };
> 
>         pse = <&pse1>; /* Reference to attached PSE controller */
> 
>         leds {
>             link = <&led0>; /* Link status LED */
>             activity = <&led1>; /* Activity LED */
>         };
>     };

Here is updated version:

ports {
    /* 1000BaseT Port with Ethernet and simple PoE */
    port0: ethernet-port at 0 {
        reg = <0>; /* Port index */
        label = "ETH0"; /* Physical label on the device */
        connector = "RJ45"; /* Connector type */
        supported-modes = <10BaseT 100BaseTX 1000BaseT>; /* Supported modes */

        transformer {
            model = "ABC123"; /* Transformer model number */
            manufacturer = "TransformerCo"; /* Manufacturer name */

            pairs {
                pair at 0 {
                    name = "A"; /* Pair A */
                    pins = <1 2>; /* Connector pins */
                    phy-mapping = <PHY_TX0_P PHY_TX0_N>; /* PHY pin mapping */
                    center-tap = "CT0"; /* Central tap identifier */
                    pse-negative = <PSE_GND>; /* CT0 connected to GND */
                };
                pair at 1 {
                    name = "B"; /* Pair B */
                    pins = <3 6>; /* Connector pins */
                    phy-mapping = <PHY_RX0_P PHY_RX0_N>;
                    center-tap = "CT1"; /* Central tap identifier */
                    pse-positive = <PSE_OUT0>; /* CT1 connected to PSE_OUT0 */
                };
                pair at 2 {
                    name = "C"; /* Pair C */
                    pins = <4 5>; /* Connector pins */
                    phy-mapping = <PHY_TXRX1_P PHY_TXRX1_N>; /* PHY connection only */
                    center-tap = "CT2"; /* Central tap identifier */
                    /* No power connection to CT2 */
                };
                pair at 3 {
                    name = "D"; /* Pair D */
                    pins = <7 8>; /* Connector pins */
                    phy-mapping = <PHY_TXRX2_P PHY_TXRX2_N>; /* PHY connection only */
                    center-tap = "CT3"; /* Central tap identifier */
                    /* No power connection to CT3 */
                };
            };
        };

        pse = <&pse1>; /* Reference to the attached PSE controller */

        leds {
            ethernet-leds {
                link = <&eth_led0>; /* Link status LED */
                activity = <&eth_led1>; /* Activity LED */
                speed = <&eth_led2>; /* Speed indication LED */
            };

            poe-leds {
                power = <&poe_led0>; /* PoE power status LED */
                fault = <&poe_led1>; /* PoE fault indication LED */
                budget = <&poe_led2>; /* PoE budget usage LED */
            };
        };
    };
};

A port with fully configurable PoE support:

ports {
    /* 1000BaseT Port with Fully Configurable PoE */
    port0: ethernet-port at 0 {
        reg = <0>; /* Port index */
        label = "ETH0"; /* Physical label on the device */
        connector = "RJ45"; /* Connector type */
        supported-modes = <10BaseT 100BaseTX 1000BaseT>; /* Supported modes */
        shielding = "grounded"; /* Indicates the connector is shielded */
	/* 
	  grounded: Shield is connected to chassis or earth ground.
	  floating: Shield is not electrically connected.
	  capacitive: Shield is connected to ground via a capacitor.
	  signal: Shield is connected to the signal ground.
         */


        transformer {
            model = "ABC123"; /* Transformer model number */
            manufacturer = "TransformerCo"; /* Manufacturer name */

            pairs {
                pair at 0 {
                    name = "A"; /* Pair A */
                    pins = <1 2>; /* Connector pins */
                    phy-mapping = <PHY_TX0_P PHY_TX0_N>; /* PHY pin mapping */
                    center-tap = "CT0"; /* Central tap identifier */
                    /* if pse-positive and pse-negative are present - polarity is configurable */
                    pse-positive = <PSE_OUT0_0>; /* PSE-controlled positive pin -> CT0 */
                    pse-negative = <PSE_OUT0_1>; /* PSE-controlled negative pin -> CT0 */
                };
                pair at 1 {
                    name = "B"; /* Pair B */
                    pins = <3 6>; /* Connector pins */
                    phy-mapping = <PHY_RX0_P PHY_RX0_N>;
                    center-tap = "CT1"; /* Central tap identifier */
                    pse-positive = <PSE_OUT1_0>;
                    pse-negative = <PSE_OUT1_1>;
                };
                pair at 2 {
                    name = "C"; /* Pair C */
                    pins = <4 5>; /* Connector pins */
                    phy-mapping = <PHY_TXRX1_P PHY_TXRX1_N>; /* PHY connection only */
                    center-tap = "CT2"; /* Central tap identifier */
                    pse-positive = <PSE_OUT2_0>;
                    pse-negative = <PSE_OUT2_1>;
                };
                pair at 3 {
                    name = "D"; /* Pair D */
                    pins = <7 8>; /* Connector pins */
                    phy-mapping = <PHY_TXRX2_P PHY_TXRX2_N>; /* PHY connection only */
                    center-tap = "CT3"; /* Central tap identifier */
                    pse-positive = <PSE_OUT3_0>;
                    pse-negative = <PSE_OUT3_1>;
                };
            };
        };

        pse = <&pse1>; /* Reference to the attached PSE controller */

        thermal {
            temp-sensor = <&tsensor0>; /* Reference to temperature sensor */
            /* or */
            thermal-zone = <&thermal_zone0>; /* Reference to thermal zone */
        }

	fuses {
	    overcurrent-fuse {
	        type = "resettable"; /* Resettable polyfuse */
	        max-current = <1000>; /* Maximum current in milliamps */
	        location = "data-pairs"; /* Fuse protects data pairs */
	    };

	    overvoltage-fuse {
	        type = "tvs-diode"; /* TVS diode for surge protection */
	        clamp-voltage = <60>; /* Clamping voltage in volts */
	        location = "poe-pairs"; /* Fuse protects PoE pairs */
	    };
	};

        leds {
            ethernet-leds {
                link = <&eth_led0>; /* Link status LED */
                activity = <&eth_led1>; /* Activity LED */
                speed = <&eth_led2>; /* Speed indication LED */
            };

            poe-leds {
                power = <&poe_led0>; /* PoE power status LED */
                fault = <&poe_led1>; /* PoE fault indication LED */
                budget = <&poe_led2>; /* PoE budget usage LED */
            };
        };
    };
};

In case of PoDL, we will have something like this:

pair at 0 {
    name = "A"; /* Single pair for 10BaseT1L */
    pins = <1 2>; /* Connector pins */
    phy-mapping = <PHY_TXRX0_P PHY_TXRX0_N>; /* PHY pin mapping */
    podl-mapping = <PODL_OUT0_P PODL_OUT0_N>; /* PoDL mapping: Positive and negative outputs */
};


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the linux-arm-kernel mailing list