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-370-netgear-rn104.dts
1 /*
2  * Device Tree file for NETGEAR ReadyNAS 104
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-370.dtsi"
17
18 / {
19         model = "NETGEAR ReadyNAS 104";
20         compatible = "netgear,readynas-104", "marvell,armada370", "marvell,armada-370-xp";
21
22         chosen {
23                 bootargs = "console=ttyS0,115200 earlyprintk";
24         };
25
26         memory {
27                 device_type = "memory";
28                 reg = <0x00000000 0x20000000>; /* 512 MB */
29         };
30
31         soc {
32                 ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
33                           MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
34
35                 pcie-controller {
36                         status = "okay";
37
38                         /* Connected to FL1009 USB 3.0 controller */
39                         pcie@1,0 {
40                                 /* Port 0, Lane 0 */
41                                 status = "okay";
42                         };
43
44                         /* Connected to Marvell 88SE9215 SATA controller */
45                         pcie@2,0 {
46                                 /* Port 1, Lane 0 */
47                                 status = "okay";
48                         };
49                 };
50
51                 internal-regs {
52                         serial@12000 {
53                                 status = "okay";
54                         };
55
56                         mdio {
57                                 pinctrl-0 = <&mdio_pins>;
58                                 pinctrl-names = "default";
59                                 phy0: ethernet-phy@0 { /* Marvell 88E1318 */
60                                         reg = <0>;
61                                 };
62
63                                 phy1: ethernet-phy@1 { /* Marvell 88E1318 */
64                                         reg = <1>;
65                                 };
66                         };
67
68                         ethernet@70000 {
69                                 pinctrl-0 = <&ge0_rgmii_pins>;
70                                 pinctrl-names = "default";
71                                 status = "okay";
72                                 phy = <&phy0>;
73                                 phy-mode = "rgmii-id";
74                         };
75
76                         ethernet@74000 {
77                                 pinctrl-0 = <&ge1_rgmii_pins>;
78                                 pinctrl-names = "default";
79                                 status = "okay";
80                                 phy = <&phy1>;
81                                 phy-mode = "rgmii-id";
82                         };
83
84                         usb@50000 {
85                                 status = "okay";
86                         };
87
88                         i2c@11000 {
89                                 compatible = "marvell,mv64xxx-i2c";
90                                 clock-frequency = <100000>;
91                                 status = "okay";
92
93                                 isl12057: isl12057@68 {
94                                         compatible = "isil,isl12057";
95                                         reg = <0x68>;
96                                 };
97
98                                 g762: g762@3e {
99                                         compatible = "gmt,g762";
100                                         reg = <0x3e>;
101                                         clocks = <&g762_clk>; /* input clock */
102                                         fan_gear_mode = <0>;
103                                         fan_startv = <1>;
104                                         pwm_polarity = <0>;
105                                 };
106
107                                 pca9554: pca9554@23 {
108                                         compatible = "nxp,pca9554";
109                                         gpio-controller;
110                                         #gpio-cells = <2>;
111                                         reg = <0x23>;
112                                 };
113                         };
114
115                         nand@d0000 {
116                                 status = "okay";
117                                 num-cs = <1>;
118                                 marvell,nand-keep-config;
119                                 marvell,nand-enable-arbiter;
120                                 nand-on-flash-bbt;
121
122                                 /* Use Hardware BCH ECC */
123                                 nand-ecc-strength = <4>;
124                                 nand-ecc-step-size = <512>;
125
126                                 partition@0 {
127                                         label = "u-boot";
128                                         reg = <0x0000000 0x180000>;  /* 1.5MB */
129                                         read-only;
130                                 };
131
132                                 partition@180000 {
133                                         label = "u-boot-env";
134                                         reg = <0x180000 0x20000>;    /* 128KB */
135                                         read-only;
136                                 };
137
138                                 partition@200000 {
139                                         label = "uImage";
140                                         reg = <0x0200000 0x600000>;    /* 6MB */
141                                 };
142
143                                 partition@800000 {
144                                         label = "minirootfs";
145                                         reg = <0x0800000 0x400000>;    /* 4MB */
146                                 };
147
148                                 /* Last MB is for the BBT, i.e. not writable */
149                                 partition@c00000 {
150                                         label = "ubifs";
151                                         reg = <0x0c00000 0x7400000>; /* 116MB */
152                                 };
153                         };
154                 };
155         };
156
157         clocks {
158                g762_clk: g762-oscillator {
159                          compatible = "fixed-clock";
160                          #clock-cells = <0>;
161                          clock-frequency = <8192>;
162                };
163         };
164
165         gpio-leds {
166                 compatible = "gpio-leds";
167                 pinctrl-0 = <&backup_led_pin &power_led_pin>;
168                 pinctrl-names = "default";
169
170                 blue-backup-led {
171                         label = "rn104:blue:backup";
172                         gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>;
173                         default-state = "off";
174                 };
175
176                 blue-power-led {
177                         label = "rn104:blue:pwr";
178                         gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
179                         linux,default-trigger = "keep";
180                 };
181
182                 blue-sata1-led {
183                         label = "rn104:blue:sata1";
184                         gpios = <&pca9554 0 GPIO_ACTIVE_LOW>;
185                         default-state = "off";
186                 };
187
188                 blue-sata2-led {
189                         label = "rn104:blue:sata2";
190                         gpios = <&pca9554 1 GPIO_ACTIVE_LOW>;
191                         default-state = "off";
192                 };
193
194                 blue-sata3-led {
195                         label = "rn104:blue:sata3";
196                         gpios = <&pca9554 2 GPIO_ACTIVE_LOW>;
197                         default-state = "off";
198                 };
199
200                 blue-sata4-led {
201                         label = "rn104:blue:sata4";
202                         gpios = <&pca9554 3 GPIO_ACTIVE_LOW>;
203                         default-state = "off";
204                 };
205         };
206
207         gpio-keys {
208                 compatible = "gpio-keys";
209                 pinctrl-0 = <&backup_button_pin
210                              &power_button_pin
211                              &reset_button_pin>;
212                 pinctrl-names = "default";
213
214                 backup-button {
215                         label = "Backup Button";
216                         linux,code = <KEY_COPY>;
217                         gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
218                 };
219
220                 power-button {
221                         label = "Power Button";
222                         linux,code = <KEY_POWER>;
223                         gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
224                 };
225
226                 reset-button {
227                         label = "Reset Button";
228                         linux,code = <KEY_RESTART>;
229                         gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
230                 };
231         };
232
233         gpio-poweroff {
234                 compatible = "gpio-poweroff";
235                 pinctrl-0 = <&poweroff>;
236                 pinctrl-names = "default";
237                 gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
238         };
239 };
240
241 &pinctrl {
242         poweroff: poweroff {
243                 marvell,pins = "mpp60";
244                 marvell,function = "gpio";
245         };
246
247         backup_button_pin: backup-button-pin {
248                 marvell,pins = "mpp52";
249                 marvell,function = "gpio";
250         };
251
252         power_button_pin: power-button-pin {
253                 marvell,pins = "mpp62";
254                 marvell,function = "gpio";
255         };
256
257         backup_led_pin: backup-led-pin {
258                 marvell,pins = "mpp63";
259                 marvell,function = "gpo";
260         };
261
262         power_led_pin: power-led-pin {
263                 marvell,pins = "mpp64";
264                 marvell,function = "gpio";
265         };
266
267         reset_button_pin: reset-button-pin {
268                 marvell,pins = "mpp65";
269                 marvell,function = "gpio";
270         };
271 };