1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree file for the Storm Semiconductor SL93512R_BRD
4 * Gemini reference design, also initially called
5 * "Gemini324 EV-Board" before Storm acquired Storlink Semiconductor.
6 * The series were later acquired by Cortina Systems.
7 */
8
9/dts-v1/;
10
11#include "gemini.dtsi"
12#include <dt-bindings/input/input.h>
13
14/ {
15	model = "Storlink Semiconductor Gemini324 EV-Board / Storm Semiconductor SL93512R_BRD";
16	compatible = "storlink,gemini324", "storm,sl93512r", "cortina,gemini";
17	#address-cells = <1>;
18	#size-cells = <1>;
19
20	memory@0 {
21		/* 64 MB Samsung K4H511638B */
22		device_type = "memory";
23		reg = <0x00000000 0x4000000>;
24	};
25
26	chosen {
27		bootargs = "console=ttyS0,19200n8 root=/dev/mtdblock3 rw rootfstype=squashfs,jffs2 rootwait";
28		stdout-path = &uart0;
29	};
30
31	gpio_keys {
32		compatible = "gpio-keys";
33
34		button-wps {
35			debounce-interval = <50>;
36			wakeup-source;
37			linux,code = <KEY_WPS_BUTTON>;
38			label = "WPS";
39			/* Conflicts with TVC and extended flash */
40			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
41		};
42
43		button-setup {
44			debounce-interval = <50>;
45			wakeup-source;
46			linux,code = <KEY_RESTART>;
47			label = "factory reset";
48			/* Conflict with NAND flash */
49			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
50		};
51	};
52
53	leds {
54		compatible = "gpio-leds";
55		led-green-harddisk {
56			label = "sq201:green:harddisk";
57			/* Conflict with LCD (no problem) */
58			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
59			default-state = "off";
60			linux,default-trigger = "disk-activity";
61		};
62		led-green-wireless {
63			label = "sq201:green:wireless";
64			/* Conflict with NAND flash CE0 (no problem) */
65			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
66			default-state = "on";
67			linux,default-trigger = "heartbeat";
68		};
69	};
70
71	mdio0: mdio {
72		compatible = "virtual,mdio-gpio";
73		/* Uses MDC and MDIO */
74		gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>, /* MDC */
75			<&gpio0 21 GPIO_ACTIVE_HIGH>; /* MDIO */
76		#address-cells = <1>;
77		#size-cells = <0>;
78
79		/* This is a Marvell 88E1111 ethernet transciever */
80		phy0: ethernet-phy@1 {
81			reg = <1>;
82		};
83	};
84
85	spi {
86		compatible = "spi-gpio";
87		#address-cells = <1>;
88		#size-cells = <0>;
89		/* Check pin collisions */
90		sck-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
91		miso-gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
92		mosi-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
93		cs-gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>;
94		num-chipselects = <1>;
95
96		ethernet-switch@0 {
97			compatible = "vitesse,vsc7385";
98			reg = <0>;
99			/* Specified for 2.5 MHz or below */
100			spi-max-frequency = <2500000>;
101			gpio-controller;
102			#gpio-cells = <2>;
103
104			ethernet-ports {
105				#address-cells = <1>;
106				#size-cells = <0>;
107
108				ethernet-port@0 {
109					reg = <0>;
110					label = "lan1";
111				};
112				ethernet-port@1 {
113					reg = <1>;
114					label = "lan2";
115				};
116				ethernet-port@2 {
117					reg = <2>;
118					label = "lan3";
119				};
120				ethernet-port@3 {
121					reg = <3>;
122					label = "lan4";
123				};
124				vsc: ethernet-port@6 {
125					reg = <6>;
126					label = "cpu";
127					ethernet = <&gmac1>;
128					phy-mode = "rgmii";
129					fixed-link {
130						speed = <1000>;
131						full-duplex;
132						pause;
133					};
134				};
135			};
136		};
137	};
138
139
140	soc {
141		flash@30000000 {
142			status = "okay";
143			/* 16MB of flash */
144			reg = <0x30000000 0x01000000>;
145
146			partitions {
147				compatible = "redboot-fis";
148				/* Eraseblock at 0xfe0000 */
149				fis-index-block = <0x1fc>;
150			};
151		};
152
153		syscon: syscon@40000000 {
154			pinctrl {
155				/*
156				 * gpio0agrp cover line 0, used by WPS button
157				 * gpio0fgrp cover line 16 used by HD LED
158				 * gpio0ggrp cover line 17, 18 used by wireless LAN LED and
159				 * reset button OR USB ID select on 17 and USB VBUS select
160				 * on 18. (Confusing.)
161				 * gpio0igrp cover line 21, 22 used by MDIO for Marvell PHY
162				 */
163				gpio0_default_pins: pinctrl-gpio0 {
164					mux {
165						function = "gpio0";
166						groups = "gpio0agrp",
167						"gpio0fgrp",
168						"gpio0ggrp",
169						"gpio0igrp";
170					};
171				};
172				/*
173				 * gpio1dgrp cover lines used by SPI for
174				 * the Vitesse chip (28-31)
175				 */
176				gpio1_default_pins: pinctrl-gpio1 {
177					mux {
178						function = "gpio1";
179						groups = "gpio1dgrp";
180					};
181				};
182				pinctrl-gmii {
183					mux {
184						function = "gmii";
185						groups = "gmii_gmac0_grp", "gmii_gmac1_grp";
186					};
187					/* Control pad skew comes from sl_switch.c in the vendor code */
188					conf0 {
189						pins = "P10 GMAC1 TXC";
190						skew-delay = <5>;
191					};
192					conf1 {
193						pins = "V11 GMAC1 TXEN";
194						skew-delay = <7>;
195					};
196					conf2 {
197						pins = "T11 GMAC1 RXC";
198						skew-delay = <8>;
199					};
200					conf3 {
201						pins = "U11 GMAC1 RXDV";
202						skew-delay = <7>;
203					};
204					conf4 {
205						pins = "V7 GMAC0 TXC";
206						skew-delay = <10>;
207					};
208					conf5 {
209						pins = "P8 GMAC0 TXEN";
210						skew-delay = <7>; /* 5 at another place? */
211					};
212					conf6 {
213						pins = "T8 GMAC0 RXC";
214						skew-delay = <15>;
215					};
216					conf7 {
217						pins = "R8 GMAC0 RXDV";
218						skew-delay = <0>;
219					};
220					conf8 {
221						/* The data lines all have default skew */
222						pins = "U8 GMAC0 RXD0", "V8 GMAC0 RXD1",
223						       "P9 GMAC0 RXD2", "R9 GMAC0 RXD3",
224						       "R11 GMAC1 RXD0", "P11 GMAC1 RXD1",
225						       "V12 GMAC1 RXD2", "U12 GMAC1 RXD3",
226						       "R10 GMAC1 TXD0", "T10 GMAC1 TXD1",
227						       "U10 GMAC1 TXD2", "V10 GMAC1 TXD3";
228						skew-delay = <7>;
229					};
230					/* Appears in sl351x_gmac.c in the vendor code */
231					conf9 {
232						pins = "U7 GMAC0 TXD0", "T7 GMAC0 TXD1",
233						       "R7 GMAC0 TXD2", "P7 GMAC0 TXD3";
234						skew-delay = <5>;
235					};
236				};
237			};
238		};
239
240		/* Both interfaces brought out on SATA connectors */
241		sata: sata@46000000 {
242			cortina,gemini-ata-muxmode = <0>;
243			cortina,gemini-enable-sata-bridge;
244			status = "okay";
245		};
246
247		gpio0: gpio@4d000000 {
248			pinctrl-names = "default";
249			pinctrl-0 = <&gpio0_default_pins>;
250		};
251
252		gpio1: gpio@4e000000 {
253			pinctrl-names = "default";
254			pinctrl-0 = <&gpio1_default_pins>;
255		};
256
257		pci@50000000 {
258			status = "okay";
259		};
260
261		ethernet@60000000 {
262			status = "okay";
263
264			ethernet-port@0 {
265				phy-mode = "rgmii";
266				phy-handle = <&phy0>;
267			};
268			ethernet-port@1 {
269				phy-mode = "rgmii";
270				fixed-link {
271					speed = <1000>;
272					full-duplex;
273					pause;
274				};
275			};
276		};
277
278		ide@63000000 {
279			status = "okay";
280		};
281
282		ide@63400000 {
283			status = "okay";
284		};
285
286		usb@68000000 {
287			status = "okay";
288		};
289
290		usb@69000000 {
291			status = "okay";
292		};
293	};
294};
295