Merge tag 'pinctrl-v3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[cascardo/linux.git] / arch / arm / boot / dts / armada-xp-netgear-rn2120.dts
1 /*
2  * Device Tree file for NETGEAR ReadyNAS 2120
3  *
4  * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version
9  * 2 of the License, or (at your option) any later version.
10  */
11
12 /dts-v1/;
13
14 #include <dt-bindings/input/input.h>
15 #include <dt-bindings/gpio/gpio.h>
16 #include "armada-xp-mv78230.dtsi"
17
18 / {
19         model = "NETGEAR ReadyNAS 2120";
20         compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
21
22         chosen {
23                 bootargs = "console=ttyS0,115200 earlyprintk";
24         };
25
26         memory {
27                 device_type = "memory";
28                 reg = <0 0x00000000 0 0x80000000>; /* 2GB */
29         };
30
31         soc {
32                 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
33                           MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
34
35                 pcie-controller {
36                         status = "okay";
37
38                         /* Connected to first Marvell 88SE9170 SATA controller */
39                         pcie@1,0 {
40                                 /* Port 0, Lane 0 */
41                                 status = "okay";
42                         };
43
44                         /* Connected to second Marvell 88SE9170 SATA controller */
45                         pcie@2,0 {
46                                 /* Port 0, Lane 1 */
47                                 status = "okay";
48                         };
49
50                         /* Connected to Fresco Logic FL1009 USB 3.0 controller */
51                         pcie@5,0 {
52                                 /* Port 1, Lane 0 */
53                                 status = "okay";
54                         };
55                 };
56
57                 internal-regs {
58                         /* Two rear eSATA ports */
59                         sata@a0000 {
60                                 nr-ports = <2>;
61                                 status = "okay";
62                         };
63
64                         serial@12000 {
65                                 status = "okay";
66                         };
67
68                         mdio {
69                                 phy0: ethernet-phy@0 { /* Marvell 88E1318 */
70                                         reg = <0>;
71                                 };
72
73                                 phy1: ethernet-phy@1 { /* Marvell 88E1318 */
74                                         reg = <1>;
75                                 };
76                         };
77
78                         ethernet@70000 {
79                                 status = "okay";
80                                 phy = <&phy0>;
81                                 phy-mode = "rgmii-id";
82                         };
83
84                         ethernet@74000 {
85                                 status = "okay";
86                                 phy = <&phy1>;
87                                 phy-mode = "rgmii-id";
88                         };
89
90                         /* Front USB 2.0 port */
91                         usb@50000 {
92                                 status = "okay";
93                         };
94
95                         i2c@11000 {
96                                 compatible = "marvell,mv64xxx-i2c";
97                                 clock-frequency = <400000>;
98                                 status = "okay";
99
100                                 isl12057: isl12057@68 {
101                                         compatible = "isil,isl12057";
102                                         reg = <0x68>;
103                                 };
104
105                                 /* Controller for rear fan #1 of 3 (Protechnic
106                                  * MGT4012XB-O20, 8000RPM) near eSATA port */
107                                 g762_fan1: g762@3e {
108                                         compatible = "gmt,g762";
109                                         reg = <0x3e>;
110                                         clocks = <&g762_clk>; /* input clock */
111                                         fan_gear_mode = <0>;
112                                         fan_startv = <1>;
113                                         pwm_polarity = <0>;
114                                 };
115
116                                 /*  Controller for rear (center) fan #2 of 3 */
117                                 g762_fan2: g762@48 {
118                                         compatible = "gmt,g762";
119                                         reg = <0x48>;
120                                         clocks = <&g762_clk>; /* input clock */
121                                         fan_gear_mode = <0>;
122                                         fan_startv = <1>;
123                                         pwm_polarity = <0>;
124                                 };
125
126                                 /*  Controller for rear fan #3 of 3 */
127                                 g762_fan3: g762@49 {
128                                         compatible = "gmt,g762";
129                                         reg = <0x49>;
130                                         clocks = <&g762_clk>; /* input clock */
131                                         fan_gear_mode = <0>;
132                                         fan_startv = <1>;
133                                         pwm_polarity = <0>;
134                                 };
135
136                                 /* Temperature sensor */
137                                 g751: g751@4c {
138                                         compatible = "gmt,g751";
139                                         reg = <0x4c>;
140                                 };
141                         };
142
143                         nand@d0000 {
144                                 status = "okay";
145                                 num-cs = <1>;
146                                 marvell,nand-keep-config;
147                                 marvell,nand-enable-arbiter;
148                                 nand-on-flash-bbt;
149
150                                 /* Use Hardware BCH ECC */
151                                 nand-ecc-strength = <4>;
152                                 nand-ecc-step-size = <512>;
153
154                                 partition@0 {
155                                         label = "u-boot";
156                                         reg = <0x0000000 0x180000>;  /* 1.5MB */
157                                         read-only;
158                                 };
159
160                                 partition@180000 {
161                                         label = "u-boot-env";
162                                         reg = <0x180000 0x20000>;    /* 128KB */
163                                         read-only;
164                                 };
165
166                                 partition@200000 {
167                                         label = "uImage";
168                                         reg = <0x0200000 0x600000>;    /* 6MB */
169                                 };
170
171                                 partition@800000 {
172                                         label = "minirootfs";
173                                         reg = <0x0800000 0x400000>;    /* 4MB */
174                                 };
175
176                                 /* Last MB is for the BBT, i.e. not writable */
177                                 partition@c00000 {
178                                         label = "ubifs";
179                                         reg = <0x0c00000 0x7400000>; /* 116MB */
180                                 };
181                         };
182                 };
183         };
184
185         clocks {
186                g762_clk: g762-oscillator {
187                          compatible = "fixed-clock";
188                          #clock-cells = <0>;
189                          clock-frequency = <32768>;
190                };
191         };
192
193         gpio-leds {
194                 compatible = "gpio-leds";
195                 pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin
196                              &sata3_led_pin &sata4_led_pin>;
197                 pinctrl-names = "default";
198
199                 red-sata1-led {
200                         label = "rn2120:red:sata1";
201                         gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
202                         default-state = "off";
203                 };
204
205                 red-sata2-led {
206                         label = "rn2120:red:sata2";
207                         gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
208                         default-state = "off";
209                 };
210
211                 red-sata3-led {
212                         label = "rn2120:red:sata3";
213                         gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
214                         default-state = "off";
215                 };
216
217                 red-sata4-led {
218                         label = "rn2120:red:sata4";
219                         gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
220                         default-state = "off";
221                 };
222
223                 red-err-led {
224                         label = "rn2120:red:err";
225                         gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
226                         default-state = "off";
227                 };
228         };
229
230         gpio-keys {
231                 compatible = "gpio-keys";
232                 pinctrl-0 = <&power_button_pin &reset_button_pin>;
233                 pinctrl-names = "default";
234
235                 power-button {
236                         label = "Power Button";
237                         linux,code = <KEY_POWER>;
238                         gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
239                 };
240
241                 reset-button {
242                         label = "Reset Button";
243                         linux,code = <KEY_RESTART>;
244                         gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
245                 };
246         };
247
248         gpio-poweroff {
249                 compatible = "gpio-poweroff";
250                 pinctrl-0 = <&poweroff>;
251                 pinctrl-names = "default";
252                 gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
253         };
254 };
255
256 &pinctrl {
257         poweroff: poweroff {
258                 marvell,pins = "mpp42";
259                 marvell,function = "gpio";
260         };
261
262         power_button_pin: power-button-pin {
263                 marvell,pins = "mpp27";
264                 marvell,function = "gpio";
265         };
266
267         reset_button_pin: reset-button-pin {
268                 marvell,pins = "mpp41";
269                 marvell,function = "gpio";
270         };
271
272         sata1_led_pin: sata1-led-pin {
273                 marvell,pins = "mpp31";
274                 marvell,function = "gpio";
275         };
276
277         sata2_led_pin: sata2-led-pin {
278                 marvell,pins = "mpp40";
279                 marvell,function = "gpio";
280         };
281
282         sata3_led_pin: sata3-led-pin {
283                 marvell,pins = "mpp44";
284                 marvell,function = "gpio";
285         };
286
287         sata4_led_pin: sata4-led-pin {
288                 marvell,pins = "mpp47";
289                 marvell,function = "gpio";
290         };
291
292         sata1_power_pin: sata1-power-pin {
293                 marvell,pins = "mpp24";
294                 marvell,function = "gpio";
295         };
296
297         sata2_power_pin: sata2-power-pin {
298                 marvell,pins = "mpp25";
299                 marvell,function = "gpio";
300         };
301
302         sata3_power_pin: sata3-power-pin {
303                 marvell,pins = "mpp26";
304                 marvell,function = "gpio";
305         };
306
307         sata4_power_pin: sata4-power-pin {
308                 marvell,pins = "mpp28";
309                 marvell,function = "gpio";
310         };
311
312         sata1_pres_pin: sata1-pres-pin {
313                 marvell,pins = "mpp32";
314                 marvell,function = "gpio";
315         };
316
317         sata2_pres_pin: sata2-pres-pin {
318                 marvell,pins = "mpp33";
319                 marvell,function = "gpio";
320         };
321
322         sata3_pres_pin: sata3-pres-pin {
323                 marvell,pins = "mpp34";
324                 marvell,function = "gpio";
325         };
326
327         sata4_pres_pin: sata4-pres-pin {
328                 marvell,pins = "mpp35";
329                 marvell,function = "gpio";
330         };
331
332         err_led_pin: err-led-pin {
333                 marvell,pins = "mpp45";
334                 marvell,function = "gpio";
335         };
336 };