xref: /freebsd-src/sys/contrib/device-tree/src/arm/gemini/gemini-sq201.dts (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1*f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0
2*f126890aSEmmanuel Vadot/*
3*f126890aSEmmanuel Vadot * Device Tree file for ITian Square One SQ201 NAS
4*f126890aSEmmanuel Vadot */
5*f126890aSEmmanuel Vadot
6*f126890aSEmmanuel Vadot/dts-v1/;
7*f126890aSEmmanuel Vadot
8*f126890aSEmmanuel Vadot#include "gemini.dtsi"
9*f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h>
10*f126890aSEmmanuel Vadot
11*f126890aSEmmanuel Vadot/ {
12*f126890aSEmmanuel Vadot	model = "ITian Square One SQ201";
13*f126890aSEmmanuel Vadot	compatible = "itian,sq201", "cortina,gemini";
14*f126890aSEmmanuel Vadot	#address-cells = <1>;
15*f126890aSEmmanuel Vadot	#size-cells = <1>;
16*f126890aSEmmanuel Vadot
17*f126890aSEmmanuel Vadot	memory@0 { /* 128 MB */
18*f126890aSEmmanuel Vadot		device_type = "memory";
19*f126890aSEmmanuel Vadot		reg = <0x00000000 0x8000000>;
20*f126890aSEmmanuel Vadot	};
21*f126890aSEmmanuel Vadot
22*f126890aSEmmanuel Vadot	chosen {
23*f126890aSEmmanuel Vadot		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait";
24*f126890aSEmmanuel Vadot		stdout-path = &uart0;
25*f126890aSEmmanuel Vadot	};
26*f126890aSEmmanuel Vadot
27*f126890aSEmmanuel Vadot	gpio_keys {
28*f126890aSEmmanuel Vadot		compatible = "gpio-keys";
29*f126890aSEmmanuel Vadot
30*f126890aSEmmanuel Vadot		button-setup {
31*f126890aSEmmanuel Vadot			debounce-interval = <100>;
32*f126890aSEmmanuel Vadot			wakeup-source;
33*f126890aSEmmanuel Vadot			linux,code = <KEY_SETUP>;
34*f126890aSEmmanuel Vadot			label = "factory reset";
35*f126890aSEmmanuel Vadot			/* Conflict with NAND flash */
36*f126890aSEmmanuel Vadot			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
37*f126890aSEmmanuel Vadot		};
38*f126890aSEmmanuel Vadot	};
39*f126890aSEmmanuel Vadot
40*f126890aSEmmanuel Vadot	leds {
41*f126890aSEmmanuel Vadot		compatible = "gpio-leds";
42*f126890aSEmmanuel Vadot		led-green-info {
43*f126890aSEmmanuel Vadot			label = "sq201:green:info";
44*f126890aSEmmanuel Vadot			gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
45*f126890aSEmmanuel Vadot			default-state = "on";
46*f126890aSEmmanuel Vadot			linux,default-trigger = "heartbeat";
47*f126890aSEmmanuel Vadot		};
48*f126890aSEmmanuel Vadot		led-green-usb {
49*f126890aSEmmanuel Vadot			label = "sq201:green:usb";
50*f126890aSEmmanuel Vadot			gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
51*f126890aSEmmanuel Vadot			default-state = "off";
52*f126890aSEmmanuel Vadot			linux,default-trigger = "usb-host";
53*f126890aSEmmanuel Vadot		};
54*f126890aSEmmanuel Vadot	};
55*f126890aSEmmanuel Vadot
56*f126890aSEmmanuel Vadot	mdio0: mdio {
57*f126890aSEmmanuel Vadot		compatible = "virtual,mdio-gpio";
58*f126890aSEmmanuel Vadot		/* Uses MDC and MDIO */
59*f126890aSEmmanuel Vadot		gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>, /* MDC */
60*f126890aSEmmanuel Vadot			<&gpio0 21 GPIO_ACTIVE_HIGH>; /* MDIO */
61*f126890aSEmmanuel Vadot		#address-cells = <1>;
62*f126890aSEmmanuel Vadot		#size-cells = <0>;
63*f126890aSEmmanuel Vadot
64*f126890aSEmmanuel Vadot		/* This is a Marvell 88E1111 ethernet transciever */
65*f126890aSEmmanuel Vadot		phy0: ethernet-phy@1 {
66*f126890aSEmmanuel Vadot			reg = <1>;
67*f126890aSEmmanuel Vadot		};
68*f126890aSEmmanuel Vadot	};
69*f126890aSEmmanuel Vadot
70*f126890aSEmmanuel Vadot	spi {
71*f126890aSEmmanuel Vadot		compatible = "spi-gpio";
72*f126890aSEmmanuel Vadot		#address-cells = <1>;
73*f126890aSEmmanuel Vadot		#size-cells = <0>;
74*f126890aSEmmanuel Vadot		/* Check pin collisions */
75*f126890aSEmmanuel Vadot		sck-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
76*f126890aSEmmanuel Vadot		miso-gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
77*f126890aSEmmanuel Vadot		mosi-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
78*f126890aSEmmanuel Vadot		cs-gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>;
79*f126890aSEmmanuel Vadot		num-chipselects = <1>;
80*f126890aSEmmanuel Vadot
81*f126890aSEmmanuel Vadot		switch@0 {
82*f126890aSEmmanuel Vadot			compatible = "vitesse,vsc7395";
83*f126890aSEmmanuel Vadot			reg = <0>;
84*f126890aSEmmanuel Vadot			/* Specified for 2.5 MHz or below */
85*f126890aSEmmanuel Vadot			spi-max-frequency = <2500000>;
86*f126890aSEmmanuel Vadot			gpio-controller;
87*f126890aSEmmanuel Vadot			#gpio-cells = <2>;
88*f126890aSEmmanuel Vadot
89*f126890aSEmmanuel Vadot			ports {
90*f126890aSEmmanuel Vadot				#address-cells = <1>;
91*f126890aSEmmanuel Vadot				#size-cells = <0>;
92*f126890aSEmmanuel Vadot
93*f126890aSEmmanuel Vadot				port@0 {
94*f126890aSEmmanuel Vadot					reg = <0>;
95*f126890aSEmmanuel Vadot					label = "lan1";
96*f126890aSEmmanuel Vadot				};
97*f126890aSEmmanuel Vadot				port@1 {
98*f126890aSEmmanuel Vadot					reg = <1>;
99*f126890aSEmmanuel Vadot					label = "lan2";
100*f126890aSEmmanuel Vadot				};
101*f126890aSEmmanuel Vadot				port@2 {
102*f126890aSEmmanuel Vadot					reg = <2>;
103*f126890aSEmmanuel Vadot					label = "lan3";
104*f126890aSEmmanuel Vadot				};
105*f126890aSEmmanuel Vadot				port@3 {
106*f126890aSEmmanuel Vadot					reg = <3>;
107*f126890aSEmmanuel Vadot					label = "lan4";
108*f126890aSEmmanuel Vadot				};
109*f126890aSEmmanuel Vadot				vsc: port@6 {
110*f126890aSEmmanuel Vadot					reg = <6>;
111*f126890aSEmmanuel Vadot					label = "cpu";
112*f126890aSEmmanuel Vadot					ethernet = <&gmac1>;
113*f126890aSEmmanuel Vadot					phy-mode = "rgmii";
114*f126890aSEmmanuel Vadot					fixed-link {
115*f126890aSEmmanuel Vadot						speed = <1000>;
116*f126890aSEmmanuel Vadot						full-duplex;
117*f126890aSEmmanuel Vadot						pause;
118*f126890aSEmmanuel Vadot					};
119*f126890aSEmmanuel Vadot				};
120*f126890aSEmmanuel Vadot			};
121*f126890aSEmmanuel Vadot		};
122*f126890aSEmmanuel Vadot	};
123*f126890aSEmmanuel Vadot
124*f126890aSEmmanuel Vadot
125*f126890aSEmmanuel Vadot	soc {
126*f126890aSEmmanuel Vadot		flash@30000000 {
127*f126890aSEmmanuel Vadot			status = "okay";
128*f126890aSEmmanuel Vadot			pinctrl-names = "enabled", "disabled";
129*f126890aSEmmanuel Vadot			pinctrl-0 = <&pflash_default_pins>;
130*f126890aSEmmanuel Vadot			pinctrl-1 = <&pflash_disabled_pins>;
131*f126890aSEmmanuel Vadot			/* 16MB of flash */
132*f126890aSEmmanuel Vadot			reg = <0x30000000 0x01000000>;
133*f126890aSEmmanuel Vadot
134*f126890aSEmmanuel Vadot			partitions {
135*f126890aSEmmanuel Vadot				compatible = "redboot-fis";
136*f126890aSEmmanuel Vadot				/* Eraseblock at 0xfe0000 */
137*f126890aSEmmanuel Vadot				fis-index-block = <0x1fc>;
138*f126890aSEmmanuel Vadot			};
139*f126890aSEmmanuel Vadot		};
140*f126890aSEmmanuel Vadot
141*f126890aSEmmanuel Vadot		syscon: syscon@40000000 {
142*f126890aSEmmanuel Vadot			pinctrl {
143*f126890aSEmmanuel Vadot				/*
144*f126890aSEmmanuel Vadot				 * gpio0fgrp cover line 18 used by reset button
145*f126890aSEmmanuel Vadot				 * gpio0ggrp cover line 20 used by info LED
146*f126890aSEmmanuel Vadot				 * gpio0hgrp cover line 21, 22 used by MDIO for Marvell PHY
147*f126890aSEmmanuel Vadot				 * gpio0kgrp cover line 31 used by USB LED
148*f126890aSEmmanuel Vadot				 */
149*f126890aSEmmanuel Vadot				gpio0_default_pins: pinctrl-gpio0 {
150*f126890aSEmmanuel Vadot					mux {
151*f126890aSEmmanuel Vadot						function = "gpio0";
152*f126890aSEmmanuel Vadot						groups = "gpio0fgrp",
153*f126890aSEmmanuel Vadot						"gpio0hgrp";
154*f126890aSEmmanuel Vadot					};
155*f126890aSEmmanuel Vadot				};
156*f126890aSEmmanuel Vadot				/*
157*f126890aSEmmanuel Vadot				 * gpio0dgrp cover lines used by the SPI
158*f126890aSEmmanuel Vadot				 * to the Vitesse G5x chip.
159*f126890aSEmmanuel Vadot				 */
160*f126890aSEmmanuel Vadot				gpio1_default_pins: pinctrl-gpio1 {
161*f126890aSEmmanuel Vadot					mux {
162*f126890aSEmmanuel Vadot						function = "gpio1";
163*f126890aSEmmanuel Vadot						groups = "gpio1dgrp";
164*f126890aSEmmanuel Vadot					};
165*f126890aSEmmanuel Vadot				};
166*f126890aSEmmanuel Vadot				/*
167*f126890aSEmmanuel Vadot				 * These GPIO groups will be mapped in over some
168*f126890aSEmmanuel Vadot				 * of the flash pins when the flash is not in
169*f126890aSEmmanuel Vadot				 * active use.
170*f126890aSEmmanuel Vadot				 */
171*f126890aSEmmanuel Vadot				pflash_disabled_pins: pinctrl-pflash-disabled {
172*f126890aSEmmanuel Vadot					mux {
173*f126890aSEmmanuel Vadot						function = "gpio0";
174*f126890aSEmmanuel Vadot						groups = "gpio0ggrp", "gpio0igrp", "gpio0jgrp",
175*f126890aSEmmanuel Vadot							 "gpio0kgrp";
176*f126890aSEmmanuel Vadot					};
177*f126890aSEmmanuel Vadot				};
178*f126890aSEmmanuel Vadot				pinctrl-gmii {
179*f126890aSEmmanuel Vadot					mux {
180*f126890aSEmmanuel Vadot						function = "gmii";
181*f126890aSEmmanuel Vadot						groups = "gmii_gmac0_grp", "gmii_gmac1_grp";
182*f126890aSEmmanuel Vadot					};
183*f126890aSEmmanuel Vadot					/* Settings come from memory dump in PLATO */
184*f126890aSEmmanuel Vadot					conf0 {
185*f126890aSEmmanuel Vadot						pins = "V8 GMAC0 RXDV";
186*f126890aSEmmanuel Vadot						skew-delay = <0>;
187*f126890aSEmmanuel Vadot					};
188*f126890aSEmmanuel Vadot					conf1 {
189*f126890aSEmmanuel Vadot						pins = "Y7 GMAC0 RXC";
190*f126890aSEmmanuel Vadot						skew-delay = <15>;
191*f126890aSEmmanuel Vadot					};
192*f126890aSEmmanuel Vadot					conf2 {
193*f126890aSEmmanuel Vadot						pins = "T8 GMAC0 TXEN";
194*f126890aSEmmanuel Vadot						skew-delay = <7>;
195*f126890aSEmmanuel Vadot					};
196*f126890aSEmmanuel Vadot					conf3 {
197*f126890aSEmmanuel Vadot						pins = "U8 GMAC0 TXC";
198*f126890aSEmmanuel Vadot						skew-delay = <10>;
199*f126890aSEmmanuel Vadot					};
200*f126890aSEmmanuel Vadot					conf4 {
201*f126890aSEmmanuel Vadot						pins = "T10 GMAC1 RXDV";
202*f126890aSEmmanuel Vadot						skew-delay = <7>;
203*f126890aSEmmanuel Vadot					};
204*f126890aSEmmanuel Vadot					conf5 {
205*f126890aSEmmanuel Vadot						pins = "Y11 GMAC1 RXC";
206*f126890aSEmmanuel Vadot						skew-delay = <8>;
207*f126890aSEmmanuel Vadot					};
208*f126890aSEmmanuel Vadot					conf6 {
209*f126890aSEmmanuel Vadot						pins = "W11 GMAC1 TXEN";
210*f126890aSEmmanuel Vadot						skew-delay = <7>;
211*f126890aSEmmanuel Vadot					};
212*f126890aSEmmanuel Vadot					conf7 {
213*f126890aSEmmanuel Vadot						pins = "V11 GMAC1 TXC";
214*f126890aSEmmanuel Vadot						skew-delay = <5>;
215*f126890aSEmmanuel Vadot					};
216*f126890aSEmmanuel Vadot					conf8 {
217*f126890aSEmmanuel Vadot						/* The data lines all have default skew */
218*f126890aSEmmanuel Vadot						pins = "W8 GMAC0 RXD0", "V9 GMAC0 RXD1",
219*f126890aSEmmanuel Vadot						       "Y8 GMAC0 RXD2", "U9 GMAC0 RXD3",
220*f126890aSEmmanuel Vadot						       "T7 GMAC0 TXD0", "U6 GMAC0 TXD1",
221*f126890aSEmmanuel Vadot						       "V7 GMAC0 TXD2", "U7 GMAC0 TXD3",
222*f126890aSEmmanuel Vadot						       "Y12 GMAC1 RXD0", "V12 GMAC1 RXD1",
223*f126890aSEmmanuel Vadot						       "T11 GMAC1 RXD2", "W12 GMAC1 RXD3",
224*f126890aSEmmanuel Vadot						       "U10 GMAC1 TXD0", "Y10 GMAC1 TXD1",
225*f126890aSEmmanuel Vadot						       "W10 GMAC1 TXD2", "T9 GMAC1 TXD3";
226*f126890aSEmmanuel Vadot						skew-delay = <7>;
227*f126890aSEmmanuel Vadot					};
228*f126890aSEmmanuel Vadot					/* Set up drive strength on GMAC0 and GMAC1 to 16 mA */
229*f126890aSEmmanuel Vadot					conf9 {
230*f126890aSEmmanuel Vadot						groups = "gmii_gmac0_grp", "gmii_gmac1_grp";
231*f126890aSEmmanuel Vadot						drive-strength = <16>;
232*f126890aSEmmanuel Vadot					};
233*f126890aSEmmanuel Vadot				};
234*f126890aSEmmanuel Vadot			};
235*f126890aSEmmanuel Vadot		};
236*f126890aSEmmanuel Vadot
237*f126890aSEmmanuel Vadot		sata: sata@46000000 {
238*f126890aSEmmanuel Vadot			cortina,gemini-ata-muxmode = <0>;
239*f126890aSEmmanuel Vadot			cortina,gemini-enable-sata-bridge;
240*f126890aSEmmanuel Vadot			status = "okay";
241*f126890aSEmmanuel Vadot		};
242*f126890aSEmmanuel Vadot
243*f126890aSEmmanuel Vadot		gpio0: gpio@4d000000 {
244*f126890aSEmmanuel Vadot			pinctrl-names = "default";
245*f126890aSEmmanuel Vadot			pinctrl-0 = <&gpio0_default_pins>;
246*f126890aSEmmanuel Vadot		};
247*f126890aSEmmanuel Vadot
248*f126890aSEmmanuel Vadot		gpio1: gpio@4e000000 {
249*f126890aSEmmanuel Vadot			pinctrl-names = "default";
250*f126890aSEmmanuel Vadot			pinctrl-0 = <&gpio1_default_pins>;
251*f126890aSEmmanuel Vadot		};
252*f126890aSEmmanuel Vadot
253*f126890aSEmmanuel Vadot		pci@50000000 {
254*f126890aSEmmanuel Vadot			status = "okay";
255*f126890aSEmmanuel Vadot		};
256*f126890aSEmmanuel Vadot
257*f126890aSEmmanuel Vadot		ethernet@60000000 {
258*f126890aSEmmanuel Vadot			status = "okay";
259*f126890aSEmmanuel Vadot
260*f126890aSEmmanuel Vadot			ethernet-port@0 {
261*f126890aSEmmanuel Vadot				phy-mode = "rgmii";
262*f126890aSEmmanuel Vadot				phy-handle = <&phy0>;
263*f126890aSEmmanuel Vadot			};
264*f126890aSEmmanuel Vadot			ethernet-port@1 {
265*f126890aSEmmanuel Vadot				phy-mode = "rgmii";
266*f126890aSEmmanuel Vadot				fixed-link {
267*f126890aSEmmanuel Vadot					speed = <1000>;
268*f126890aSEmmanuel Vadot					full-duplex;
269*f126890aSEmmanuel Vadot					pause;
270*f126890aSEmmanuel Vadot				};
271*f126890aSEmmanuel Vadot			};
272*f126890aSEmmanuel Vadot		};
273*f126890aSEmmanuel Vadot
274*f126890aSEmmanuel Vadot		ide@63000000 {
275*f126890aSEmmanuel Vadot			status = "okay";
276*f126890aSEmmanuel Vadot		};
277*f126890aSEmmanuel Vadot
278*f126890aSEmmanuel Vadot		usb@68000000 {
279*f126890aSEmmanuel Vadot			status = "okay";
280*f126890aSEmmanuel Vadot		};
281*f126890aSEmmanuel Vadot
282*f126890aSEmmanuel Vadot		usb@69000000 {
283*f126890aSEmmanuel Vadot			status = "okay";
284*f126890aSEmmanuel Vadot		};
285*f126890aSEmmanuel Vadot	};
286*f126890aSEmmanuel Vadot};
287