Documentation / devicetree / bindings / net / mdio-mux-gpio.yaml


Based on kernel version 6.15. Page generated on 2025-05-29 09:09 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/mdio-mux-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Properties for an MDIO bus multiplexer/switch controlled by GPIO pins.

maintainers:
  - Andrew Lunn <andrew@lunn.ch>

description:
  This is a special case of a MDIO bus multiplexer.  One or more GPIO
  lines are used to control which child bus is connected.

allOf:
  - $ref: /schemas/net/mdio-mux.yaml#

properties:
  compatible:
    const: mdio-mux-gpio

  gpios:
    description:
      List of GPIOs used to control the multiplexer, least significant bit first.
    minItems: 1
    maxItems: 32

required:
  - compatible
  - gpios

unevaluatedProperties: false

examples:
  - |
    /*
     An NXP sn74cbtlv3253 dual 1-of-4 switch controlled by a
     pair of GPIO lines.  Child busses 2 and 3 populated with 4
     PHYs each.
     */
    mdio-mux {
        compatible = "mdio-mux-gpio";
        gpios = <&gpio1 3 0>, <&gpio1 4 0>;
        mdio-parent-bus = <&smi1>;
        #address-cells = <1>;
        #size-cells = <0>;
 
        mdio@2 {
            reg = <2>;
            #address-cells = <1>;
            #size-cells = <0>;
 
            ethernet-phy@1 {
                reg = <1>;
                interrupt-parent = <&gpio>;
                interrupts = <10 8>; /* Pin 10, active low */
            };
            ethernet-phy@2 {
                reg = <2>;
                interrupt-parent = <&gpio>;
                interrupts = <10 8>; /* Pin 10, active low */
            };
            ethernet-phy@3 {
                reg = <3>;
                interrupt-parent = <&gpio>;
                interrupts = <10 8>; /* Pin 10, active low */
            };
            ethernet-phy@4 {
                reg = <4>;
                interrupt-parent = <&gpio>;
                interrupts = <10 8>; /* Pin 10, active low */
            };
        };
 
        mdio@3 {
            reg = <3>;
            #address-cells = <1>;
            #size-cells = <0>;
 
            ethernet-phy@1 {
                reg = <1>;
                interrupt-parent = <&gpio>;
                interrupts = <12 8>; /* Pin 12, active low */
            };
            ethernet-phy@2 {
                reg = <2>;
                interrupt-parent = <&gpio>;
                interrupts = <12 8>; /* Pin 12, active low */
            };
            ethernet-phy@3 {
                reg = <3>;
                interrupt-parent = <&gpio>;
                interrupts = <12 8>; /* Pin 12, active low */
            };
            ethernet-phy@4 {
                reg = <4>;
                interrupt-parent = <&gpio>;
                interrupts = <12 8>; /* Pin 12, active low */
            };
        };
    };
...