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