dd392c5a9beb13f11f9492288ec0d1e47d53bf17
[openwrt/staging/wigyori.git] / target / linux / realtek / dts-5.15 / rtl8393_zyxel_gs1900-48.dts
1 /dts-v1/;
2
3 #include "rtl839x.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 compatible = "zyxel,gs1900-48", "realtek,rtl8393-soc";
10 model = "Zyxel GS1900-48";
11
12 aliases {
13 led-boot = &led_sys;
14 led-failsafe = &led_sys;
15 led-running = &led_sys;
16 led-upgrade = &led_sys;
17 };
18
19 memory@0 {
20 device_type = "memory";
21 reg = <0x0 0x8000000>;
22 };
23
24 leds {
25 pinctrl-names = "default";
26 pinctrl-0 = <&pinmux_disable_sys_led>;
27 compatible = "gpio-leds";
28
29 led_sys: sys {
30 label = "green:sys";
31 gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
32 };
33 };
34
35 gpio1: rtl8231-gpio {
36 compatible = "realtek,rtl8231-gpio";
37 #gpio-cells = <2>;
38 indirect-access-bus-id = <3>;
39 gpio-controller;
40 };
41
42 gpio-restart {
43 compatible = "gpio-restart";
44 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
45 };
46
47 keys {
48 compatible = "gpio-keys-polled";
49 poll-interval = <20>;
50
51 mode {
52 label = "reset";
53 gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_RESTART>;
55 };
56 };
57
58 /* i2c of the left SFP cage: port 49 */
59 i2c0: i2c-gpio-0 {
60 compatible = "i2c-gpio";
61 sda-gpios = <&gpio1 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
62 scl-gpios = <&gpio1 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
63 i2c-gpio,delay-us = <2>;
64 #address-cells = <1>;
65 #size-cells = <0>;
66 };
67
68 sfp0: sfp-p9 {
69 compatible = "sff,sfp";
70 i2c-bus = <&i2c0>;
71 los-gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>;
72 tx-fault-gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
73 mod-def0-gpio = <&gpio1 26 GPIO_ACTIVE_LOW>;
74 tx-disable-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>;
75 };
76
77 /* i2c of the right SFP cage: port 50 */
78 i2c1: i2c-gpio-1 {
79 compatible = "i2c-gpio";
80 sda-gpios = <&gpio1 30 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
81 scl-gpios = <&gpio1 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
82 i2c-gpio,delay-us = <2>;
83 #address-cells = <1>;
84 #size-cells = <0>;
85 };
86
87 sfp1: sfp-p10 {
88 compatible = "sff,sfp";
89 i2c-bus = <&i2c1>;
90 los-gpio = <&gpio1 33 GPIO_ACTIVE_HIGH>;
91 tx-fault-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
92 mod-def0-gpio = <&gpio1 32 GPIO_ACTIVE_LOW>;
93 tx-disable-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>;
94 };
95 };
96
97 &spi0 {
98 status = "okay";
99 flash@0 {
100 compatible = "jedec,spi-nor";
101 reg = <0>;
102 spi-max-frequency = <10000000>;
103
104 partitions {
105 compatible = "fixed-partitions";
106 #address-cells = <1>;
107 #size-cells = <1>;
108
109 partition@0 {
110 label = "u-boot";
111 reg = <0x0 0x40000>;
112 read-only;
113 };
114 partition@40000 {
115 label = "u-boot-env";
116 reg = <0x40000 0x10000>;
117 read-only;
118 };
119 partition@50000 {
120 label = "u-boot-env2";
121 reg = <0x50000 0x10000>;
122 read-only;
123 };
124 partition@60000 {
125 label = "jffs";
126 reg = <0x60000 0x100000>;
127 };
128 partition@160000 {
129 label = "jffs2";
130 reg = <0x160000 0x100000>;
131 };
132 partition@b260000 {
133 label = "firmware";
134 reg = <0x260000 0xda0000>;
135 compatible = "openwrt,uimage", "denx,uimage";
136 openwrt,ih-magic = <0x83800000>;
137 };
138 partition@930000 {
139 label = "runtime2";
140 reg = <0x930000 0x6d0000>;
141 };
142 };
143 };
144 };
145
146 &ethernet0 {
147 mdio: mdio-bus {
148 compatible = "realtek,rtl838x-mdio";
149 regmap = <&ethernet0>;
150 #address-cells = <1>;
151 #size-cells = <0>;
152
153 /* External phy RTL8218B #1 */
154 EXTERNAL_PHY(0)
155 EXTERNAL_PHY(1)
156 EXTERNAL_PHY(2)
157 EXTERNAL_PHY(3)
158 EXTERNAL_PHY(4)
159 EXTERNAL_PHY(5)
160 EXTERNAL_PHY(6)
161 EXTERNAL_PHY(7)
162
163 /* External phy RTL8218B #2 */
164 EXTERNAL_PHY(8)
165 EXTERNAL_PHY(9)
166 EXTERNAL_PHY(10)
167 EXTERNAL_PHY(11)
168 EXTERNAL_PHY(12)
169 EXTERNAL_PHY(13)
170 EXTERNAL_PHY(14)
171 EXTERNAL_PHY(15)
172
173 /* External phy RTL8218B #3 */
174 EXTERNAL_PHY(16)
175 EXTERNAL_PHY(17)
176 EXTERNAL_PHY(18)
177 EXTERNAL_PHY(19)
178 EXTERNAL_PHY(20)
179 EXTERNAL_PHY(21)
180 EXTERNAL_PHY(22)
181 EXTERNAL_PHY(23)
182
183 /* External phy RTL8218B #4 */
184 EXTERNAL_PHY(24)
185 EXTERNAL_PHY(25)
186 EXTERNAL_PHY(26)
187 EXTERNAL_PHY(27)
188 EXTERNAL_PHY(28)
189 EXTERNAL_PHY(29)
190 EXTERNAL_PHY(30)
191 EXTERNAL_PHY(31)
192
193 /* External phy RTL8218B #5 */
194 EXTERNAL_PHY(32)
195 EXTERNAL_PHY(33)
196 EXTERNAL_PHY(34)
197 EXTERNAL_PHY(35)
198 EXTERNAL_PHY(36)
199 EXTERNAL_PHY(37)
200 EXTERNAL_PHY(38)
201 EXTERNAL_PHY(39)
202
203 /* External phy RTL8218B #6 */
204 EXTERNAL_PHY(40)
205 EXTERNAL_PHY(41)
206 EXTERNAL_PHY(42)
207 EXTERNAL_PHY(43)
208 EXTERNAL_PHY(44)
209 EXTERNAL_PHY(45)
210 EXTERNAL_PHY(46)
211 EXTERNAL_PHY(47)
212
213 /* RTL8393 Internal SerDes */
214 INTERNAL_PHY(48)
215 INTERNAL_PHY(49)
216 };
217 };
218
219 &switch0 {
220 ports {
221 #address-cells = <1>;
222 #size-cells = <0>;
223
224 SWITCH_PORT(0, 01, qsgmii)
225 SWITCH_PORT(1, 02, qsgmii)
226 SWITCH_PORT(2, 03, qsgmii)
227 SWITCH_PORT(3, 04, qsgmii)
228 SWITCH_PORT(4, 05, qsgmii)
229 SWITCH_PORT(5, 06, qsgmii)
230 SWITCH_PORT(6, 07, qsgmii)
231 SWITCH_PORT(7, 08, qsgmii)
232
233 SWITCH_PORT(8, 09, qsgmii)
234 SWITCH_PORT(9, 10, qsgmii)
235 SWITCH_PORT(10, 11, qsgmii)
236 SWITCH_PORT(11, 12, qsgmii)
237 SWITCH_PORT(12, 13, qsgmii)
238 SWITCH_PORT(13, 14, qsgmii)
239 SWITCH_PORT(14, 15, qsgmii)
240 SWITCH_PORT(15, 16, qsgmii)
241
242 SWITCH_PORT(16, 17, qsgmii)
243 SWITCH_PORT(17, 18, qsgmii)
244 SWITCH_PORT(18, 19, qsgmii)
245 SWITCH_PORT(19, 20, qsgmii)
246 SWITCH_PORT(20, 21, qsgmii)
247 SWITCH_PORT(21, 22, qsgmii)
248 SWITCH_PORT(22, 23, qsgmii)
249 SWITCH_PORT(23, 24, qsgmii)
250
251 SWITCH_PORT(24, 25, qsgmii)
252 SWITCH_PORT(25, 26, qsgmii)
253 SWITCH_PORT(26, 27, qsgmii)
254 SWITCH_PORT(27, 28, qsgmii)
255 SWITCH_PORT(28, 29, qsgmii)
256 SWITCH_PORT(29, 30, qsgmii)
257 SWITCH_PORT(30, 31, qsgmii)
258 SWITCH_PORT(31, 32, qsgmii)
259
260 SWITCH_PORT(32, 33, qsgmii)
261 SWITCH_PORT(33, 34, qsgmii)
262 SWITCH_PORT(34, 35, qsgmii)
263 SWITCH_PORT(35, 36, qsgmii)
264 SWITCH_PORT(36, 37, qsgmii)
265 SWITCH_PORT(37, 38, qsgmii)
266 SWITCH_PORT(38, 39, qsgmii)
267 SWITCH_PORT(39, 40, qsgmii)
268
269 SWITCH_PORT(40, 41, qsgmii)
270 SWITCH_PORT(41, 42, qsgmii)
271 SWITCH_PORT(42, 43, qsgmii)
272 SWITCH_PORT(43, 44, qsgmii)
273 SWITCH_PORT(44, 45, qsgmii)
274 SWITCH_PORT(45, 46, qsgmii)
275 SWITCH_PORT(46, 47, qsgmii)
276 SWITCH_PORT(47, 48, qsgmii)
277
278 /* SFP cages */
279 port@48 {
280 reg = <48>;
281 label = "lan49";
282 phy-mode = "sgmii";
283 phy-handle = <&phy48>;
284 sfp = <&sfp0>;
285
286 fixed-link {
287 speed = <1000>;
288 full-duplex;
289 pause;
290 };
291
292 };
293
294 port@49 {
295 reg = <49>;
296 label = "lan50";
297 phy-mode = "sgmii";
298 phy-handle = <&phy49>;
299 sfp = <&sfp1>;
300
301 fixed-link {
302 speed = <1000>;
303 full-duplex;
304 pause;
305 };
306
307 };
308
309 /* CPU-Port */
310 port@52 {
311 ethernet = <&ethernet0>;
312 reg = <52>;
313 phy-mode = "qsgmii";
314 fixed-link {
315 speed = <1000>;
316 full-duplex;
317 };
318 };
319 };
320 };