summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml
blob: b99d7a694b70ed38b4442c5e998b4cfac262f532 (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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/dsa/vitesse,vsc73xx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Vitesse VSC73xx DSA Switches

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>

description:
  The Vitesse DSA Switches were produced in the early-to-mid 2000s.

  The Vitesse company has been acquired by Microsemi and Microsemi has
  been acquired Microchip but the new owner retains this vendor branding.

  The currently supported switch chips are
  Vitesse VSC7385 SparX-G5 5+1-port Integrated Gigabit Ethernet Switch
  Vitesse VSC7388 SparX-G8 8-port Integrated Gigabit Ethernet Switch
  Vitesse VSC7395 SparX-G5e 5+1-port Integrated Gigabit Ethernet Switch
  Vitesse VSC7398 SparX-G8e 8-port Integrated Gigabit Ethernet Switch

  This switch can use one of two different management interfaces.

  If SPI interface is used, the device tree node is an SPI device so it must
  reside inside a SPI bus device tree node, see spi/spi-bus.txt

  When the chip is connected to a parallel memory bus and work in memory-mapped
  I/O mode, a platform device is used to represent the vsc73xx. In this case it
  must reside inside a platform bus device tree node.

properties:
  compatible:
    enum:
      - vitesse,vsc7385
      - vitesse,vsc7388
      - vitesse,vsc7395
      - vitesse,vsc7398

  reg:
    maxItems: 1

  gpio-controller: true
  "#gpio-cells":
    const: 2

  reset-gpios:
    description: GPIO to be used to reset the whole device
    maxItems: 1

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

# This checks if reg is a chipselect so the device is on an SPI
# bus, the if-clause will fail if reg is a tuple such as for a
# platform device.
if:
  properties:
    reg:
      minimum: 0
      maximum: 256
then:
  $ref: /schemas/spi/spi-peripheral-props.yaml#

required:
  - compatible
  - reg

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

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

      ethernet-switch@0 {
        compatible = "vitesse,vsc7395";
        reg = <0>;
        spi-max-frequency = <2500000>;
        gpio-controller;
        #gpio-cells = <2>;

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

          ethernet-port@0 {
            reg = <0>;
            label = "lan1";
          };
          ethernet-port@1 {
            reg = <1>;
            label = "lan2";
          };
          ethernet-port@2 {
            reg = <2>;
            label = "lan3";
          };
          ethernet-port@3 {
            reg = <3>;
            label = "lan4";
          };
          ethernet-port@6 {
            reg = <6>;
            ethernet = <&gmac1>;
            phy-mode = "rgmii";
            fixed-link {
              speed = <1000>;
              full-duplex;
              pause;
            };
          };
        };
      };
    };

    bus {
      #address-cells = <1>;
      #size-cells = <1>;

      ethernet-switch@10000000 {
        compatible = "vitesse,vsc7385";
        reg = <0x10000000 0x20000>;
        reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;

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

          ethernet-port@0 {
            reg = <0>;
            label = "lan1";
          };
          ethernet-port@1 {
            reg = <1>;
            label = "lan2";
          };
          ethernet-port@2 {
            reg = <2>;
            label = "lan3";
          };
          ethernet-port@3 {
            reg = <3>;
            label = "lan4";
          };
          ethernet-port@6 {
            reg = <6>;
            ethernet = <&enet0>;
            phy-mode = "rgmii";
            fixed-link {
              speed = <1000>;
              full-duplex;
              pause;
            };
          };
        };
      };
    };