aboutsummaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
blob: f3154b19af78adb75552227a3dc41dbfd0a83ea3 (plain)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/dsa/lantiq,gswip.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Lantiq GSWIP Ethernet switches

allOf:
  - $ref: dsa.yaml#/$defs/ethernet-ports

maintainers:
  - Hauke Mehrtens <hauke@hauke-m.de>

properties:
  compatible:
    enum:
      - lantiq,xrx200-gswip
      - lantiq,xrx300-gswip
      - lantiq,xrx330-gswip

  reg:
    minItems: 3
    maxItems: 3

  reg-names:
    items:
      - const: switch
      - const: mdio
      - const: mii

  mdio:
    $ref: /schemas/net/mdio.yaml#
    unevaluatedProperties: false

    properties:
      compatible:
        const: lantiq,xrx200-mdio

    required:
      - compatible

  gphy-fw:
    type: object
    properties:
      '#address-cells':
        const: 1

      '#size-cells':
        const: 0

      compatible:
        items:
          - enum:
              - lantiq,xrx200-gphy-fw
              - lantiq,xrx300-gphy-fw
              - lantiq,xrx330-gphy-fw
          - const: lantiq,gphy-fw

      lantiq,rcu:
        $ref: /schemas/types.yaml#/definitions/phandle
        description: phandle to the RCU syscon

    patternProperties:
      "^gphy@[0-9a-f]{1,2}$":
        type: object

        additionalProperties: false

        properties:
          reg:
            minimum: 0
            maximum: 255
            description:
              Offset of the GPHY firmware register in the RCU register range

          resets:
            items:
              - description: GPHY reset line

          reset-names:
            items:
              - const: gphy

        required:
          - reg

    required:
      - compatible
      - lantiq,rcu

    additionalProperties: false

required:
  - compatible
  - reg

unevaluatedProperties: false

examples:
  - |
    switch@e108000 {
            compatible = "lantiq,xrx200-gswip";
            reg = <0xe108000 0x3100>,  /* switch */
                  <0xe10b100 0xd8>,    /* mdio */
                  <0xe10b1d8 0x130>;   /* mii */
            dsa,member = <0 0>;

            ports {
                    #address-cells = <1>;
                    #size-cells = <0>;

                    port@0 {
                            reg = <0>;
                            label = "lan3";
                            phy-mode = "rgmii";
                            phy-handle = <&phy0>;
                    };

                    port@1 {
                            reg = <1>;
                            label = "lan4";
                            phy-mode = "rgmii";
                            phy-handle = <&phy1>;
                    };

                    port@2 {
                            reg = <2>;
                            label = "lan2";
                            phy-mode = "internal";
                            phy-handle = <&phy11>;
                    };

                    port@4 {
                            reg = <4>;
                            label = "lan1";
                            phy-mode = "internal";
                            phy-handle = <&phy13>;
                    };

                    port@5 {
                            reg = <5>;
                            label = "wan";
                            phy-mode = "rgmii";
                            phy-handle = <&phy5>;
                    };

                    port@6 {
                            reg = <0x6>;
                            phy-mode = "internal";
                            ethernet = <&eth0>;

                            fixed-link {
                                    speed = <1000>;
                                    full-duplex;
                            };
                    };
            };

            mdio {
                    #address-cells = <1>;
                    #size-cells = <0>;
                    compatible = "lantiq,xrx200-mdio";

                    phy0: ethernet-phy@0 {
                            reg = <0x0>;
                    };
                    phy1: ethernet-phy@1 {
                            reg = <0x1>;
                    };
                    phy5: ethernet-phy@5 {
                            reg = <0x5>;
                    };
                    phy11: ethernet-phy@11 {
                            reg = <0x11>;
                    };
                    phy13: ethernet-phy@13 {
                            reg = <0x13>;
                    };
            };

            gphy-fw {
                    #address-cells = <1>;
                    #size-cells = <0>;
                    compatible = "lantiq,xrx200-gphy-fw", "lantiq,gphy-fw";
                    lantiq,rcu = <&rcu0>;

                    gphy@20 {
                            reg = <0x20>;

                            resets = <&reset0 31 30>;
                            reset-names = "gphy";
                    };

                    gphy@68 {
                            reg = <0x68>;

                            resets = <&reset0 29 28>;
                            reset-names = "gphy";
                    };
            };
    };