GNU Linux-libre 4.14.259-gnu1
[releases.git] / arch / arm / boot / dts / gemini-dlink-dir-685.dts
1 /*
2  * Device Tree file for D-Link DIR-685 Xtreme N Storage Router
3  */
4
5 /dts-v1/;
6
7 #include "gemini.dtsi"
8 #include <dt-bindings/input/input.h>
9
10 / {
11         model = "D-Link DIR-685 Xtreme N Storage Router";
12         compatible = "dlink,dir-685", "cortina,gemini";
13         #address-cells = <1>;
14         #size-cells = <1>;
15
16         memory {
17                 /* 128 MB SDRAM in 2 x Hynix HY5DU121622DTP-D43 */
18                 device_type = "memory";
19                 reg = <0x00000000 0x8000000>;
20         };
21
22         chosen {
23                 stdout-path = "uart0:115200n8";
24         };
25
26         gpio_keys {
27                 compatible = "gpio-keys";
28                 #address-cells = <1>;
29                 #size-cells = <0>;
30                 button-esc {
31                         debounce_interval = <50>;
32                         wakeup-source;
33                         linux,code = <KEY_ESC>;
34                         label = "reset";
35                         /* Collides with LPC_LAD[0], UART DCD, SSP 97RST */
36                         gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
37                 };
38                 button-eject {
39                         debounce_interval = <50>;
40                         wakeup-source;
41                         linux,code = <KEY_EJECTCD>;
42                         label = "unmount";
43                         /* Collides with LPC LFRAME, UART RTS, SSP TXD */
44                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
45                 };
46         };
47
48         leds {
49                 compatible = "gpio-leds";
50                 led-wps {
51                         label = "dir685:blue:WPS";
52                         /* Collides with ICE */
53                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
54                         default-state = "on";
55                         linux,default-trigger = "heartbeat";
56                 };
57                 /*
58                  * These two LEDs are on the side of the device.
59                  * For electrical reasons, both LEDs cannot be active
60                  * at the same time so only blue or orange can on at
61                  * one time. Enabling both makes the LED go dark.
62                  * The LEDs both sit inside the unmount button and the
63                  * label on the case says "unmount".
64                  */
65                 led-blue-hd {
66                         label = "dir685:blue:HD";
67                         /* Collides with LPC_SERIRQ, UART DTR, SSP FSC pins */
68                         gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
69                         default-state = "off";
70                 };
71                 led-orange-hd {
72                         label = "dir685:orange:HD";
73                         /* Collides with LPC_LAD[2], UART DSR, SSP ECLK pins */
74                         gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
75                         default-state = "off";
76                 };
77         };
78
79         /*
80          * This is a Sunon Maglev GM0502PFV2-8 cooling fan @10000 RPM.
81          * Since the platform has no temperature sensor, this is controlled
82          * from userspace by using the hard disks S.M.A.R.T. temperature
83          * sensor. It is turned on when the temperature exceeds 46 degrees
84          * and turned off when the temperatures goes below 41 degrees
85          * (celsius).
86          */
87         gpio-fan {
88                 compatible = "gpio-fan";
89                 /* Collides with IDE */
90                 gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
91                 gpio-fan,speed-map = <0 0>, <10000 1>;
92                 #cooling-cells = <2>;
93         };
94
95         /*
96          * The touchpad input is connected to a GPIO bit-banged
97          * I2C bus.
98          */
99         gpio-i2c {
100                 compatible = "i2c-gpio";
101                 /* Collides with ICE */
102                 gpios = <&gpio0 5 0>, /* SDA */
103                         <&gpio0 6 0>; /* SCL */
104                 #address-cells = <1>;
105                 #size-cells = <0>;
106
107                 touchkeys@26 {
108                         compatible = "dlink,dir685-touchkeys";
109                         reg = <0x26>;
110                         interrupt-parent = <&gpio0>;
111                         /* Collides with NAND flash */
112                         interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
113                 };
114         };
115
116         soc {
117                 flash@30000000 {
118                         status = "okay";
119                         /* 32MB of flash */
120                         reg = <0x30000000 0x02000000>;
121
122                         /*
123                          * This "RedBoot" is the Storlink derivative.
124                          */
125                         partition@0 {
126                                 label = "RedBoot";
127                                 reg = <0x00000000 0x00040000>;
128                                 read-only;
129                         };
130                         /*
131                          * This firmware image contains the kernel catenated
132                          * with the squashfs root filesystem. For some reason
133                          * this is called "upgrade" on the vendor system.
134                          */
135                         partition@40000 {
136                                 label = "upgrade";
137                                 reg = <0x00040000 0x01f40000>;
138                                 read-only;
139                         };
140                         /* RGDB, Residental Gateway Database? */
141                         partition@1f80000 {
142                                 label = "rgdb";
143                                 reg = <0x01f80000 0x00040000>;
144                                 read-only;
145                         };
146                         /*
147                          * This partition contains MAC addresses for WAN,
148                          * WLAN and LAN, and the country code (for wireless
149                          * I guess).
150                          */
151                         partition@1fc0000 {
152                                 label = "nvram";
153                                 reg = <0x01fc0000 0x00020000>;
154                                 read-only;
155                         };
156                         partition@1fe0000 {
157                                 label = "LangPack";
158                                 reg = <0x01fe0000 0x00020000>;
159                                 read-only;
160                         };
161                 };
162
163                 syscon: syscon@40000000 {
164                         pinctrl {
165                                 /*
166                                  * gpio0bgrp cover line 5, 6 used by TK I2C
167                                  * gpio0bgrp cover line 7 used by WPS LED
168                                  * gpio0cgrp cover line 8, 13 used by keys
169                                  *           and 11, 12 used by the HD LEDs
170                                  * gpio0egrp cover line 16 used by VDISP
171                                  * gpio0fgrp cover line 17 used by TK IRQ
172                                  * gpio0ggrp cover line 20 used by panel CS
173                                  * gpio0hgrp cover line 21,22 used by RTL8366RB
174                                  */
175                                 gpio0_default_pins: pinctrl-gpio0 {
176                                         mux {
177                                                 function = "gpio0";
178                                                 groups = "gpio0bgrp",
179                                                 "gpio0cgrp",
180                                                 "gpio0egrp",
181                                                 "gpio0fgrp",
182                                                 "gpio0ggrp",
183                                                 "gpio0hgrp";
184                                         };
185                                 };
186                                 /*
187                                  * gpio1bgrp cover line 5,8,7 used by panel SPI
188                                  * also line 6 used by the fan
189                                  *
190                                  */
191                                 gpio1_default_pins: pinctrl-gpio1 {
192                                         mux {
193                                                 function = "gpio1";
194                                                 groups = "gpio1bgrp";
195                                         };
196                                 };
197                         };
198                 };
199
200                 sata: sata@46000000 {
201                         cortina,gemini-ata-muxmode = <0>;
202                         cortina,gemini-enable-sata-bridge;
203                         status = "okay";
204                 };
205
206                 gpio0: gpio@4d000000 {
207                         pinctrl-names = "default";
208                         pinctrl-0 = <&gpio0_default_pins>;
209                 };
210
211                 gpio1: gpio@4e000000 {
212                         pinctrl-names = "default";
213                         pinctrl-0 = <&gpio1_default_pins>;
214                 };
215
216                 pci@50000000 {
217                         status = "okay";
218                         interrupt-map-mask = <0xf800 0 0 7>;
219                         interrupt-map =
220                                 <0x4800 0 0 1 &pci_intc 0>, /* Slot 9 */
221                                 <0x4800 0 0 2 &pci_intc 1>,
222                                 <0x4800 0 0 3 &pci_intc 2>,
223                                 <0x4800 0 0 4 &pci_intc 3>,
224                                 <0x5000 0 0 1 &pci_intc 1>, /* Slot 10 */
225                                 <0x5000 0 0 2 &pci_intc 2>,
226                                 <0x5000 0 0 3 &pci_intc 3>,
227                                 <0x5000 0 0 4 &pci_intc 0>,
228                                 <0x5800 0 0 1 &pci_intc 2>, /* Slot 11 */
229                                 <0x5800 0 0 2 &pci_intc 3>,
230                                 <0x5800 0 0 3 &pci_intc 0>,
231                                 <0x5800 0 0 4 &pci_intc 1>,
232                                 <0x6000 0 0 1 &pci_intc 3>, /* Slot 12 */
233                                 <0x6000 0 0 2 &pci_intc 0>,
234                                 <0x6000 0 0 3 &pci_intc 1>,
235                                 <0x6000 0 0 4 &pci_intc 2>;
236                 };
237
238                 ata@63000000 {
239                         status = "okay";
240                 };
241         };
242 };