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/vitesse,vsc73xx.yaml# 5$schema: http://devicetree.org/meta-schemas/core.yaml# 6 7title: Vitesse VSC73xx DSA Switches 8 9maintainers: 10 - Linus Walleij <linus.walleij@linaro.org> 11 12description: 13 The Vitesse DSA Switches were produced in the early-to-mid 2000s. 14 15 The Vitesse company has been acquired by Microsemi and Microsemi has 16 been acquired Microchip but the new owner retains this vendor branding. 17 18 The currently supported switch chips are 19 Vitesse VSC7385 SparX-G5 5+1-port Integrated Gigabit Ethernet Switch 20 Vitesse VSC7388 SparX-G8 8-port Integrated Gigabit Ethernet Switch 21 Vitesse VSC7395 SparX-G5e 5+1-port Integrated Gigabit Ethernet Switch 22 Vitesse VSC7398 SparX-G8e 8-port Integrated Gigabit Ethernet Switch 23 24 This switch can use one of two different management interfaces. 25 26 If SPI interface is used, the device tree node is an SPI device so it must 27 reside inside a SPI bus device tree node, see spi/spi-bus.txt 28 29 When the chip is connected to a parallel memory bus and work in memory-mapped 30 I/O mode, a platform device is used to represent the vsc73xx. In this case it 31 must reside inside a platform bus device tree node. 32 33properties: 34 compatible: 35 enum: 36 - vitesse,vsc7385 37 - vitesse,vsc7388 38 - vitesse,vsc7395 39 - vitesse,vsc7398 40 41 reg: 42 maxItems: 1 43 44 gpio-controller: true 45 "#gpio-cells": 46 const: 2 47 48 reset-gpios: 49 description: GPIO to be used to reset the whole device 50 maxItems: 1 51 52allOf: 53 - $ref: dsa.yaml#/$defs/ethernet-ports 54 55patternProperties: 56 "^(ethernet-)?ports$": 57 additionalProperties: true 58 patternProperties: 59 "^(ethernet-)?port@6$": 60 allOf: 61 - if: 62 properties: 63 phy-mode: 64 contains: 65 enum: 66 - rgmii 67 then: 68 properties: 69 rx-internal-delay-ps: 70 $ref: "#/$defs/internal-delay-ps" 71 tx-internal-delay-ps: 72 $ref: "#/$defs/internal-delay-ps" 73 74# This checks if reg is a chipselect so the device is on an SPI 75# bus, the if-clause will fail if reg is a tuple such as for a 76# platform device. 77if: 78 properties: 79 reg: 80 minimum: 0 81 maximum: 256 82then: 83 $ref: /schemas/spi/spi-peripheral-props.yaml# 84 85required: 86 - compatible 87 - reg 88 89$defs: 90 internal-delay-ps: 91 description: 92 Disable tunable delay lines using 0 ps, or enable them and select 93 the phase between 1400 ps and 2000 ps in increments of 300 ps. 94 default: 2000 95 enum: 96 [0, 1400, 1700, 2000] 97 98unevaluatedProperties: false 99 100examples: 101 - | 102 #include <dt-bindings/gpio/gpio.h> 103 104 spi { 105 #address-cells = <1>; 106 #size-cells = <0>; 107 108 ethernet-switch@0 { 109 compatible = "vitesse,vsc7395"; 110 reg = <0>; 111 spi-max-frequency = <2500000>; 112 gpio-controller; 113 #gpio-cells = <2>; 114 115 ethernet-ports { 116 #address-cells = <1>; 117 #size-cells = <0>; 118 119 ethernet-port@0 { 120 reg = <0>; 121 label = "lan1"; 122 }; 123 ethernet-port@1 { 124 reg = <1>; 125 label = "lan2"; 126 }; 127 ethernet-port@2 { 128 reg = <2>; 129 label = "lan3"; 130 }; 131 ethernet-port@3 { 132 reg = <3>; 133 label = "lan4"; 134 }; 135 ethernet-port@6 { 136 reg = <6>; 137 ethernet = <&gmac1>; 138 phy-mode = "rgmii"; 139 rx-internal-delay-ps = <0>; 140 tx-internal-delay-ps = <0>; 141 fixed-link { 142 speed = <1000>; 143 full-duplex; 144 pause; 145 }; 146 }; 147 }; 148 }; 149 }; 150 151 bus { 152 #address-cells = <1>; 153 #size-cells = <1>; 154 155 ethernet-switch@10000000 { 156 compatible = "vitesse,vsc7385"; 157 reg = <0x10000000 0x20000>; 158 reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; 159 160 ethernet-ports { 161 #address-cells = <1>; 162 #size-cells = <0>; 163 164 ethernet-port@0 { 165 reg = <0>; 166 label = "lan1"; 167 }; 168 ethernet-port@1 { 169 reg = <1>; 170 label = "lan2"; 171 }; 172 ethernet-port@2 { 173 reg = <2>; 174 label = "lan3"; 175 }; 176 ethernet-port@3 { 177 reg = <3>; 178 label = "lan4"; 179 }; 180 ethernet-port@6 { 181 reg = <6>; 182 ethernet = <&enet0>; 183 rx-internal-delay-ps = <0>; 184 tx-internal-delay-ps = <0>; 185 phy-mode = "rgmii"; 186 fixed-link { 187 speed = <1000>; 188 full-duplex; 189 pause; 190 }; 191 }; 192 }; 193 }; 194 }; 195