xref: /linux/Documentation/devicetree/bindings/net/dsa/smsc,lan9303.yaml (revision b2128290c29902315e632ea59e0504d6bc9e9b42)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/net/dsa/smsc,lan9303.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: SMSC/MicroChip LAN9303 three port ethernet switch
8
9maintainers:
10  - Frank Li <Frank.Li@nxp.com>
11
12description:
13  The LAN9303 is a three port ethernet switch with integrated PHYs for the
14  two external ports. The third port is an RMII/MII interface to a host
15  processor. The device can be managed via I2C or MDIO.
16
17  Note - always use 'reg = <0/1/2>;' for the three DSA ports, even if the
18  device is configured to use 1/2/3 instead. This hardware configuration
19  will be auto-detected and mapped accordingly.
20
21properties:
22  compatible:
23    enum:
24      - smsc,lan9303-i2c
25      - smsc,lan9303-mdio
26
27  reg:
28    maxItems: 1
29
30  reset-gpios:
31    description:
32      GPIO to be used to reset the whole device
33    maxItems: 1
34
35  reset-duration:
36    description:
37      Reset duration in milliseconds
38    default: 200
39    $ref: /schemas/types.yaml#/definitions/uint32
40
41required:
42  - compatible
43  - reg
44
45unevaluatedProperties: false
46
47allOf:
48  - $ref: dsa.yaml#
49
50examples:
51  - |
52    #include <dt-bindings/gpio/gpio.h>
53
54    /* I2C managed mode */
55    i2c {
56        #address-cells = <1>;
57        #size-cells = <0>;
58
59        switch@a {
60            compatible = "smsc,lan9303-i2c";
61            reg = <0xa>;
62            reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
63            reset-duration = <200>;
64
65            ports {
66                #address-cells = <1>;
67                #size-cells = <0>;
68
69                port@0 {
70                    reg = <0>;
71                    label = "cpu";
72                    ethernet = <&master>;
73                };
74
75                port@1 {
76                    reg = <1>;
77                    label = "lan1";
78                };
79
80                port@2 {
81                    reg = <2>;
82                    label = "lan2";
83                };
84            };
85        };
86    };
87
88  - |
89    #include <dt-bindings/gpio/gpio.h>
90
91    /* MDIO managed mode */
92    mdio {
93        #address-cells = <1>;
94        #size-cells = <0>;
95
96        switch@0 {
97            compatible = "smsc,lan9303-mdio";
98            reg = <0>;
99            reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
100            reset-duration = <100>;
101
102            ports {
103                #address-cells = <1>;
104                #size-cells = <0>;
105
106                port@0 {
107                    reg = <0>;
108                    label = "cpu";
109                    ethernet = <&master>;
110                };
111
112                port@1 {
113                    reg = <1>;
114                    label = "lan1";
115                };
116
117                port@2 {
118                    reg = <2>;
119                    label = "lan2";
120                };
121            };
122        };
123    };
124