xref: /freebsd-src/sys/contrib/device-tree/src/arm/gemini/gemini-dlink-dns-313.dts (revision 01950c46b8155250f64374fb72fc11faa44bf099)
1f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0
2f126890aSEmmanuel Vadot/*
3f126890aSEmmanuel Vadot * Device Tree file for D-Link DNS-313 1-Bay Network Storage Enclosure
4f126890aSEmmanuel Vadot */
5f126890aSEmmanuel Vadot
6f126890aSEmmanuel Vadot/dts-v1/;
7f126890aSEmmanuel Vadot
8f126890aSEmmanuel Vadot#include "gemini.dtsi"
9f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h>
10f126890aSEmmanuel Vadot#include <dt-bindings/thermal/thermal.h>
11f126890aSEmmanuel Vadot
12f126890aSEmmanuel Vadot/ {
13f126890aSEmmanuel Vadot	model = "D-Link DNS-313 1-Bay Network Storage Enclosure";
14f126890aSEmmanuel Vadot	compatible = "dlink,dns-313", "cortina,gemini";
15f126890aSEmmanuel Vadot	#address-cells = <1>;
16f126890aSEmmanuel Vadot	#size-cells = <1>;
17f126890aSEmmanuel Vadot
18f126890aSEmmanuel Vadot	memory@0 {
19f126890aSEmmanuel Vadot		/* 64 MB SDRAM in a Nanya NT5DS32M16BS-6K package */
20f126890aSEmmanuel Vadot		device_type = "memory";
21f126890aSEmmanuel Vadot		reg = <0x00000000 0x4000000>;
22f126890aSEmmanuel Vadot	};
23f126890aSEmmanuel Vadot
24f126890aSEmmanuel Vadot	aliases {
25f126890aSEmmanuel Vadot		mdio-gpio0 = &mdio0;
26f126890aSEmmanuel Vadot	};
27f126890aSEmmanuel Vadot
28f126890aSEmmanuel Vadot	chosen {
29f126890aSEmmanuel Vadot		bootargs = "console=ttyS0,19200n8 root=/dev/sda4 rw rootwait";
30f126890aSEmmanuel Vadot		stdout-path = "uart0:19200n8";
31f126890aSEmmanuel Vadot	};
32f126890aSEmmanuel Vadot
33f126890aSEmmanuel Vadot	gpio_keys {
34f126890aSEmmanuel Vadot		compatible = "gpio-keys";
35f126890aSEmmanuel Vadot
36*01950c46SEmmanuel Vadot		button-reset {
37f126890aSEmmanuel Vadot			debounce-interval = <100>;
38f126890aSEmmanuel Vadot			wakeup-source;
39*01950c46SEmmanuel Vadot			linux,code = <KEY_RESTART>;
40f126890aSEmmanuel Vadot			label = "reset";
41f126890aSEmmanuel Vadot			gpios = <&gpio1 31 GPIO_ACTIVE_LOW>;
42f126890aSEmmanuel Vadot		};
43f126890aSEmmanuel Vadot	};
44f126890aSEmmanuel Vadot
45f126890aSEmmanuel Vadot	leds {
46f126890aSEmmanuel Vadot		compatible = "gpio-leds";
47f126890aSEmmanuel Vadot		led-power {
48f126890aSEmmanuel Vadot			label = "dns313:blue:power";
49f126890aSEmmanuel Vadot			gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
50f126890aSEmmanuel Vadot			default-state = "on";
51f126890aSEmmanuel Vadot			linux,default-trigger = "heartbeat";
52f126890aSEmmanuel Vadot		};
53f126890aSEmmanuel Vadot		led-disk-blue {
54f126890aSEmmanuel Vadot			label = "dns313:blue:disk";
55f126890aSEmmanuel Vadot			gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
56f126890aSEmmanuel Vadot			default-state = "off";
57f126890aSEmmanuel Vadot		};
58f126890aSEmmanuel Vadot		led-disk-green {
59f126890aSEmmanuel Vadot			label = "dns313:green:disk";
60f126890aSEmmanuel Vadot			gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
61f126890aSEmmanuel Vadot			default-state = "off";
62f126890aSEmmanuel Vadot			linux,default-trigger = "disk-read";
63f126890aSEmmanuel Vadot		};
64f126890aSEmmanuel Vadot		led-disk-red {
65f126890aSEmmanuel Vadot			label = "dns313:red:disk";
66f126890aSEmmanuel Vadot			gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
67f126890aSEmmanuel Vadot			default-state = "off";
68f126890aSEmmanuel Vadot			linux,default-trigger = "disk-write";
69f126890aSEmmanuel Vadot		};
70f126890aSEmmanuel Vadot	};
71f126890aSEmmanuel Vadot
72f126890aSEmmanuel Vadot	/*
73f126890aSEmmanuel Vadot	 * This is a ADDA AD0405GB-G73 fan @3000 and 6000 RPM.
74f126890aSEmmanuel Vadot	 */
75f126890aSEmmanuel Vadot	fan0: gpio-fan {
76f126890aSEmmanuel Vadot		compatible = "gpio-fan";
77f126890aSEmmanuel Vadot		gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
78f126890aSEmmanuel Vadot			<&gpio0 12 GPIO_ACTIVE_HIGH>;
79f126890aSEmmanuel Vadot		gpio-fan,speed-map = <0 0>, <3000 1>, <6000 2>;
80f126890aSEmmanuel Vadot		#cooling-cells = <2>;
81f126890aSEmmanuel Vadot	};
82f126890aSEmmanuel Vadot
83f126890aSEmmanuel Vadot	/*
84f126890aSEmmanuel Vadot	 * This is the type B USB connector on the device,
85f126890aSEmmanuel Vadot	 * a GPIO-controlled USB VBUS detect
86f126890aSEmmanuel Vadot	 */
87f126890aSEmmanuel Vadot	usb1_phy: phy {
88f126890aSEmmanuel Vadot		compatible = "gpio-usb-b-connector", "usb-b-connector";
89f126890aSEmmanuel Vadot		#phy-cells = <0>;
90f126890aSEmmanuel Vadot		vbus-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
91f126890aSEmmanuel Vadot	};
92f126890aSEmmanuel Vadot
93f126890aSEmmanuel Vadot	/* Global Mixed-Mode Technology G751 mounted on GPIO I2C */
94f126890aSEmmanuel Vadot	i2c {
95f126890aSEmmanuel Vadot		compatible = "i2c-gpio";
96f126890aSEmmanuel Vadot		sda-gpios = <&gpio0 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
97f126890aSEmmanuel Vadot		scl-gpios = <&gpio0 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
98f126890aSEmmanuel Vadot		#address-cells = <1>;
99f126890aSEmmanuel Vadot		#size-cells = <0>;
100f126890aSEmmanuel Vadot
101f126890aSEmmanuel Vadot		g751: temperature-sensor@48 {
102f126890aSEmmanuel Vadot			compatible = "gmt,g751";
103f126890aSEmmanuel Vadot			reg = <0x48>;
104f126890aSEmmanuel Vadot			#thermal-sensor-cells = <0>;
105f126890aSEmmanuel Vadot		};
106f126890aSEmmanuel Vadot	};
107f126890aSEmmanuel Vadot
108f126890aSEmmanuel Vadot	thermal-zones {
109f126890aSEmmanuel Vadot		chassis-thermal {
110f126890aSEmmanuel Vadot			/* Poll every 20 seconds */
111f126890aSEmmanuel Vadot			polling-delay = <20000>;
112f126890aSEmmanuel Vadot			/* Poll every 2nd second when cooling */
113f126890aSEmmanuel Vadot			polling-delay-passive = <2000>;
114f126890aSEmmanuel Vadot
115f126890aSEmmanuel Vadot			thermal-sensors = <&g751>;
116f126890aSEmmanuel Vadot
117f126890aSEmmanuel Vadot			/* Tripping points from the fan.script in the rootfs */
118f126890aSEmmanuel Vadot			trips {
119f126890aSEmmanuel Vadot				chassis_alert0: chassis-alert0 {
120f126890aSEmmanuel Vadot					/* At 43 degrees turn on low speed */
121f126890aSEmmanuel Vadot					temperature = <43000>;
122f126890aSEmmanuel Vadot					hysteresis = <3000>;
123f126890aSEmmanuel Vadot					type = "active";
124f126890aSEmmanuel Vadot				};
125f126890aSEmmanuel Vadot				chassis_alert1: chassis-alert1 {
126f126890aSEmmanuel Vadot					/* At 47 degrees turn on high speed */
127f126890aSEmmanuel Vadot					temperature = <47000>;
128f126890aSEmmanuel Vadot					hysteresis = <3000>;
129f126890aSEmmanuel Vadot					type = "active";
130f126890aSEmmanuel Vadot				};
131f126890aSEmmanuel Vadot				chassis_crit: chassis-crit {
132f126890aSEmmanuel Vadot					/* Just shut down at 60 degrees */
133f126890aSEmmanuel Vadot					temperature = <60000>;
134f126890aSEmmanuel Vadot					hysteresis = <2000>;
135f126890aSEmmanuel Vadot					type = "critical";
136f126890aSEmmanuel Vadot				};
137f126890aSEmmanuel Vadot			};
138f126890aSEmmanuel Vadot
139f126890aSEmmanuel Vadot			cooling-maps {
140f126890aSEmmanuel Vadot				map0 {
141f126890aSEmmanuel Vadot					trip = <&chassis_alert0>;
142f126890aSEmmanuel Vadot					cooling-device = <&fan0 1 1>;
143f126890aSEmmanuel Vadot				};
144f126890aSEmmanuel Vadot				map1 {
145f126890aSEmmanuel Vadot					trip = <&chassis_alert1>;
146f126890aSEmmanuel Vadot					cooling-device = <&fan0 2 2>;
147f126890aSEmmanuel Vadot				};
148f126890aSEmmanuel Vadot			};
149f126890aSEmmanuel Vadot		};
150f126890aSEmmanuel Vadot	};
151f126890aSEmmanuel Vadot
152f126890aSEmmanuel Vadot	mdio0: mdio {
153f126890aSEmmanuel Vadot		compatible = "virtual,mdio-gpio";
154f126890aSEmmanuel Vadot		/* Uses MDC and MDIO */
155f126890aSEmmanuel Vadot		gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>, /* MDC */
156f126890aSEmmanuel Vadot			<&gpio0 21 GPIO_ACTIVE_HIGH>; /* MDIO */
157f126890aSEmmanuel Vadot		#address-cells = <1>;
158f126890aSEmmanuel Vadot		#size-cells = <0>;
159f126890aSEmmanuel Vadot
160f126890aSEmmanuel Vadot		/* This is a Realtek RTL8211B Gigabit ethernet transceiver */
161f126890aSEmmanuel Vadot		phy0: ethernet-phy@1 {
162f126890aSEmmanuel Vadot			reg = <1>;
163f126890aSEmmanuel Vadot			device_type = "ethernet-phy";
164f126890aSEmmanuel Vadot		};
165f126890aSEmmanuel Vadot	};
166f126890aSEmmanuel Vadot
167f126890aSEmmanuel Vadot	soc {
168f126890aSEmmanuel Vadot		flash@30000000 {
169f126890aSEmmanuel Vadot			/*
170f126890aSEmmanuel Vadot			 * This is a Eon EN29LV400AB 512 KiB flash with
171f126890aSEmmanuel Vadot			 * three partitions.
172f126890aSEmmanuel Vadot			 */
173f126890aSEmmanuel Vadot			compatible = "cortina,gemini-flash", "jedec-flash";
174f126890aSEmmanuel Vadot			status = "okay";
175f126890aSEmmanuel Vadot			reg = <0x30000000 0x00080000>;
176f126890aSEmmanuel Vadot			#address-cells = <1>;
177f126890aSEmmanuel Vadot			#size-cells = <1>;
178f126890aSEmmanuel Vadot
179f126890aSEmmanuel Vadot			/*
180f126890aSEmmanuel Vadot			 * This "RedBoot" is the Storlink derivative.
181f126890aSEmmanuel Vadot			 */
182f126890aSEmmanuel Vadot			partition@0 {
183f126890aSEmmanuel Vadot				label = "RedBoot";
184f126890aSEmmanuel Vadot				reg = <0x00000000 0x00040000>;
185f126890aSEmmanuel Vadot				read-only;
186f126890aSEmmanuel Vadot			};
187f126890aSEmmanuel Vadot			partition@40000 {
188f126890aSEmmanuel Vadot				label = "MTD1";
189f126890aSEmmanuel Vadot				reg = <0x00040000 0x00020000>;
190f126890aSEmmanuel Vadot				read-only;
191f126890aSEmmanuel Vadot			};
192f126890aSEmmanuel Vadot			partition@60000 {
193f126890aSEmmanuel Vadot				label = "MTD2";
194f126890aSEmmanuel Vadot				reg = <0x00060000 0x00020000>;
195f126890aSEmmanuel Vadot				read-only;
196f126890aSEmmanuel Vadot			};
197f126890aSEmmanuel Vadot		};
198f126890aSEmmanuel Vadot
199f126890aSEmmanuel Vadot		syscon: syscon@40000000 {
200f126890aSEmmanuel Vadot			pinctrl {
201f126890aSEmmanuel Vadot				/*
202f126890aSEmmanuel Vadot				 */
203f126890aSEmmanuel Vadot				gpio0_default_pins: pinctrl-gpio0 {
204f126890aSEmmanuel Vadot					mux {
205f126890aSEmmanuel Vadot						function = "gpio0";
206f126890aSEmmanuel Vadot						groups =
207f126890aSEmmanuel Vadot						/* Used by LEDs conflicts ICE */
208f126890aSEmmanuel Vadot						"gpio0bgrp",
209f126890aSEmmanuel Vadot						/* Used by ? conflicts ICE */
210f126890aSEmmanuel Vadot						"gpio0cgrp",
211f126890aSEmmanuel Vadot						/*
212f126890aSEmmanuel Vadot						 * Used by fan & G751, conflicts LPC,
213f126890aSEmmanuel Vadot						 * UART modem lines, SSP
214f126890aSEmmanuel Vadot						 */
215f126890aSEmmanuel Vadot						"gpio0egrp",
216f126890aSEmmanuel Vadot						/* Used by G751 */
217f126890aSEmmanuel Vadot						"gpio0fgrp",
218f126890aSEmmanuel Vadot						/* Used by MDIO */
219f126890aSEmmanuel Vadot						"gpio0igrp";
220f126890aSEmmanuel Vadot					};
221f126890aSEmmanuel Vadot				};
222f126890aSEmmanuel Vadot				gpio1_default_pins: pinctrl-gpio1 {
223f126890aSEmmanuel Vadot					mux {
224f126890aSEmmanuel Vadot						function = "gpio1";
225f126890aSEmmanuel Vadot						/* Used by "reset" button */
226f126890aSEmmanuel Vadot						groups = "gpio1dgrp";
227f126890aSEmmanuel Vadot					};
228f126890aSEmmanuel Vadot				};
229f126890aSEmmanuel Vadot				pinctrl-gmii {
230f126890aSEmmanuel Vadot					mux {
231f126890aSEmmanuel Vadot						function = "gmii";
232f126890aSEmmanuel Vadot						groups = "gmii_gmac0_grp";
233f126890aSEmmanuel Vadot					};
234f126890aSEmmanuel Vadot					/*
235f126890aSEmmanuel Vadot					 * In the vendor Linux tree, these values are set for the C3
236f126890aSEmmanuel Vadot					 * version of the SL3512 ASIC with the comment "benson suggest"
237f126890aSEmmanuel Vadot					 */
238f126890aSEmmanuel Vadot					conf0 {
239f126890aSEmmanuel Vadot						pins = "R8 GMAC0 RXDV", "U11 GMAC1 RXDV";
240f126890aSEmmanuel Vadot						skew-delay = <0>;
241f126890aSEmmanuel Vadot					};
242f126890aSEmmanuel Vadot					conf1 {
243f126890aSEmmanuel Vadot						pins = "T8 GMAC0 RXC";
244f126890aSEmmanuel Vadot						skew-delay = <10>;
245f126890aSEmmanuel Vadot					};
246f126890aSEmmanuel Vadot					conf2 {
247f126890aSEmmanuel Vadot						pins = "T11 GMAC1 RXC";
248f126890aSEmmanuel Vadot						skew-delay = <15>;
249f126890aSEmmanuel Vadot					};
250f126890aSEmmanuel Vadot					conf3 {
251f126890aSEmmanuel Vadot						pins = "P8 GMAC0 TXEN", "V11 GMAC1 TXEN";
252f126890aSEmmanuel Vadot						skew-delay = <7>;
253f126890aSEmmanuel Vadot					};
254f126890aSEmmanuel Vadot					conf4 {
255f126890aSEmmanuel Vadot						pins = "V7 GMAC0 TXC", "P10 GMAC1 TXC";
256f126890aSEmmanuel Vadot						skew-delay = <10>;
257f126890aSEmmanuel Vadot					};
258f126890aSEmmanuel Vadot					conf5 {
259f126890aSEmmanuel Vadot						/* The data lines all have default skew */
260f126890aSEmmanuel Vadot						pins = "U8 GMAC0 RXD0", "V8 GMAC0 RXD1",
261f126890aSEmmanuel Vadot						       "P9 GMAC0 RXD2", "R9 GMAC0 RXD3",
262f126890aSEmmanuel Vadot						       "R11 GMAC1 RXD0", "P11 GMAC1 RXD1",
263f126890aSEmmanuel Vadot						       "V12 GMAC1 RXD2", "U12 GMAC1 RXD3",
264f126890aSEmmanuel Vadot						       "R10 GMAC1 TXD0", "T10 GMAC1 TXD1",
265f126890aSEmmanuel Vadot						       "U10 GMAC1 TXD2", "V10 GMAC1 TXD3";
266f126890aSEmmanuel Vadot						skew-delay = <7>;
267f126890aSEmmanuel Vadot					};
268f126890aSEmmanuel Vadot					conf6 {
269f126890aSEmmanuel Vadot						pins = "U7 GMAC0 TXD0", "T7 GMAC0 TXD1",
270f126890aSEmmanuel Vadot						       "R7 GMAC0 TXD2", "P7 GMAC0 TXD3";
271f126890aSEmmanuel Vadot						skew-delay = <5>;
272f126890aSEmmanuel Vadot					};
273f126890aSEmmanuel Vadot					/* Set up drive strength on GMAC0 to 16 mA */
274f126890aSEmmanuel Vadot					conf7 {
275f126890aSEmmanuel Vadot						groups = "gmii_gmac0_grp";
276f126890aSEmmanuel Vadot						drive-strength = <16>;
277f126890aSEmmanuel Vadot					};
278f126890aSEmmanuel Vadot				};
279f126890aSEmmanuel Vadot			};
280f126890aSEmmanuel Vadot		};
281f126890aSEmmanuel Vadot
282f126890aSEmmanuel Vadot		sata: sata@46000000 {
283f126890aSEmmanuel Vadot			/* The ROM uses this muxmode */
284f126890aSEmmanuel Vadot			cortina,gemini-ata-muxmode = <0>;
285f126890aSEmmanuel Vadot			cortina,gemini-enable-sata-bridge;
286f126890aSEmmanuel Vadot			status = "okay";
287f126890aSEmmanuel Vadot		};
288f126890aSEmmanuel Vadot
289f126890aSEmmanuel Vadot		gpio0: gpio@4d000000 {
290f126890aSEmmanuel Vadot			pinctrl-names = "default";
291f126890aSEmmanuel Vadot			pinctrl-0 = <&gpio0_default_pins>;
292f126890aSEmmanuel Vadot		};
293f126890aSEmmanuel Vadot
294f126890aSEmmanuel Vadot		gpio1: gpio@4e000000 {
295f126890aSEmmanuel Vadot			pinctrl-names = "default";
296f126890aSEmmanuel Vadot			pinctrl-0 = <&gpio1_default_pins>;
297f126890aSEmmanuel Vadot		};
298f126890aSEmmanuel Vadot
299f126890aSEmmanuel Vadot		ethernet@60000000 {
300f126890aSEmmanuel Vadot			status = "okay";
301f126890aSEmmanuel Vadot
302f126890aSEmmanuel Vadot			ethernet-port@0 {
303f126890aSEmmanuel Vadot				phy-mode = "rgmii";
304f126890aSEmmanuel Vadot				phy-handle = <&phy0>;
305f126890aSEmmanuel Vadot			};
306f126890aSEmmanuel Vadot			ethernet-port@1 {
307f126890aSEmmanuel Vadot				/* Not used in this platform */
308f126890aSEmmanuel Vadot			};
309f126890aSEmmanuel Vadot		};
310f126890aSEmmanuel Vadot
311f126890aSEmmanuel Vadot		ide@63000000 {
312f126890aSEmmanuel Vadot			status = "okay";
313f126890aSEmmanuel Vadot		};
314f126890aSEmmanuel Vadot
315f126890aSEmmanuel Vadot		usb@69000000 {
316f126890aSEmmanuel Vadot			status = "okay";
317f126890aSEmmanuel Vadot			dr_mode = "peripheral";
318f126890aSEmmanuel Vadot			usb-phy = <&usb1_phy>;
319f126890aSEmmanuel Vadot			pinctrl-names = "default";
320f126890aSEmmanuel Vadot			pinctrl-0 = <&usb_default_pins>;
321f126890aSEmmanuel Vadot		};
322f126890aSEmmanuel Vadot	};
323f126890aSEmmanuel Vadot};
324