Merge branch 'cleanup/blocksize-diet-part2' of git://git.kernel.org/pub/scm/linux...
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / armada-370-synology-ds213j.dts
1 /*
2  * Device Tree file for Synology DS213j
3  *
4  * Copyright (C) 2014, 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  * Note: this Device Tree assumes that the bootloader has remapped the
12  * internal registers to 0xf1000000 (instead of the old 0xd0000000).
13  * The 0xf1000000 is the default used by the recent, DT-capable, U-Boot
14  * bootloaders provided by Marvell. It is used in recent versions of
15  * DSM software provided by Synology. Nonetheless, some earlier boards
16  * were delivered with an older version of u-boot that left internal
17  * registers mapped at 0xd0000000. If you have such a device you will
18  * not be able to directly boot a kernel based on this Device Tree. In
19  * that case, the preferred solution is to update your bootloader (e.g.
20  * by upgrading to latest version of DSM, or building a new one and
21  * installing it from u-boot prompt) or adjust the Devive Tree
22  * (s/0xf1000000/0xd0000000/ in 'ranges' below).
23  */
24
25 /dts-v1/;
26
27 #include <dt-bindings/input/input.h>
28 #include <dt-bindings/gpio/gpio.h>
29 #include "armada-370.dtsi"
30
31 / {
32         model = "Synology DS213j";
33         compatible = "synology,ds213j", "marvell,armada370",
34                      "marvell,armada-370-xp";
35
36         chosen {
37                 bootargs = "console=ttyS0,115200 earlyprintk";
38                 stdout-path = &uart0;
39         };
40
41         memory {
42                 device_type = "memory";
43                 reg = <0x00000000 0x20000000>; /* 512 MB */
44         };
45
46         soc {
47                 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
48                           MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
49
50                 internal-regs {
51
52                         /* RTC provided by Seiko S-35390A I2C RTC chip below */
53                         rtc@10300 {
54                                 status = "disabled";
55                         };
56
57                         spi0: spi@10600 {
58                                 status = "okay";
59
60                                 spi-flash@0 {
61                                         #address-cells = <1>;
62                                         #size-cells = <1>;
63                                         compatible = "micron,n25q064";
64                                         reg = <0>; /* Chip select 0 */
65                                         spi-max-frequency = <20000000>;
66
67                                         /*
68                                          * Warning!
69                                          *
70                                          * Synology u-boot uses its compiled-in environment
71                                          * and it seems Synology did not care to change u-boot
72                                          * default configuration in order to allow saving a
73                                          * modified environment at a sensible location. So,
74                                          * if you do a 'saveenv' under u-boot, your modified
75                                          * environment will be saved at 1MB after the start
76                                          * of the flash, i.e. in the middle of the uImage.
77                                          * For that reason, it is strongly advised not to
78                                          * change the default environment, unless you know
79                                          * what you are doing.
80                                          */
81                                         partition@00000000 { /* u-boot */
82                                                 label = "RedBoot";
83                                                 reg = <0x00000000 0x000c0000>; /* 768KB */
84                                         };
85
86                                         partition@000c0000 { /* uImage */
87                                                 label = "zImage";
88                                                 reg = <0x000c0000 0x002d0000>; /* 2880KB */
89                                         };
90
91                                         partition@00390000 { /* uInitramfs */
92                                                 label = "rd.gz";
93                                                 reg = <0x00390000 0x00440000>; /* 4250KB */
94                                         };
95
96                                         partition@007d0000 { /* MAC address and serial number */
97                                                 label = "vendor";
98                                                 reg = <0x007d0000 0x00010000>; /* 64KB */
99                                         };
100
101                                         partition@007e0000 {
102                                                 label = "RedBoot config";
103                                                 reg = <0x007e0000 0x00010000>; /* 64KB */
104                                         };
105
106                                         partition@007f0000 {
107                                                 label = "FIS directory";
108                                                 reg = <0x007f0000 0x00010000>; /* 64KB */
109                                         };
110                                 };
111                         };
112
113                         i2c@11000 {
114                                 compatible = "marvell,mv64xxx-i2c";
115                                 pinctrl-0 = <&i2c0_pins>;
116                                 pinctrl-names = "default";
117                                 clock-frequency = <400000>;
118                                 status = "okay";
119
120                                 /* Main device RTC chip */
121                                 s35390a: s35390a@30 {
122                                          compatible = "sii,s35390a";
123                                          reg = <0x30>;
124                                 };
125                         };
126
127                         /* Connected to a header on device's PCB */
128                         serial@12000 {
129                                 status = "okay";
130                         };
131
132                         /* Connected to a TI MSP430F2111 for power control */
133                         serial@12100 {
134                                 status = "okay";
135                         };
136
137                         poweroff@12100 {
138                                 compatible = "synology,power-off";
139                                 reg = <0x12100 0x100>;
140                                 clocks = <&coreclk 0>;
141                         };
142
143                         /* rear USB port, near reset button */
144                         usb@50000 {
145                                 status = "okay";
146                         };
147
148                         /* rear USB port, near RJ45 port */
149                         usb@51000 {
150                                 status = "okay";
151                         };
152
153                         mdio {
154                                 phy1: ethernet-phy@1 { /* Marvell 88E1512 */
155                                         reg = <1>;
156                                 };
157                         };
158
159                         ethernet@70000 {
160                                status = "okay";
161                                phy = <&phy1>;
162                                phy-mode = "sgmii";
163                         };
164
165                         sata@a0000 {
166                                 nr-ports = <2>;
167                                 status = "okay";
168                         };
169                 };
170         };
171
172         gpio-fan-32-38 {
173                 status = "okay";
174                 compatible = "gpio-fan";
175                 pinctrl-0 = <&fan_ctrl_low_pin &fan_ctrl_mid_pin
176                              &fan_ctrl_high_pin &fan_alarm_pin>;
177                 pinctrl-names = "default";
178                 gpios = <&gpio1 31 GPIO_ACTIVE_HIGH
179                          &gpio2  0 GPIO_ACTIVE_HIGH
180                          &gpio2  1 GPIO_ACTIVE_HIGH>;
181                 alarm-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
182                 gpio-fan,speed-map = <    0 0
183                                        1000 1
184                                        1150 2
185                                        1350 4
186                                        1500 3
187                                        1650 5
188                                        1750 6
189                                        1900 7 >;
190         };
191
192         gpio-leds {
193                 compatible = "gpio-leds";
194                 pinctrl-0 = <&disk1_led_pin
195                              &disk2_led_pin>;
196                 pinctrl-names = "default";
197
198                 disk1-led-amber {
199                         label = "synology:amber:disk1";
200                         gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
201                         default-state = "keep";
202                 };
203
204                 disk2-led-amber {
205                         label = "synology:amber:disk2";
206                         gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
207                         default-state = "keep";
208                 };
209         };
210
211         regulators {
212                 compatible = "simple-bus";
213                 #address-cells = <1>;
214                 #size-cells = <0>;
215                 pinctrl-0 = <&sata1_pwr_pin &sata2_pwr_pin>;
216                 pinctrl-names = "default";
217
218                 sata1_regulator: sata1-regulator {
219                         compatible = "regulator-fixed";
220                         reg = <1>;
221                         regulator-name = "SATA1 Power";
222                         regulator-min-microvolt = <5000000>;
223                         regulator-max-microvolt = <5000000>;
224                         startup-delay-us = <2000000>;
225                         enable-active-high;
226                         regulator-always-on;
227                         regulator-boot-on;
228                         gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
229                 };
230
231                 sata2_regulator: sata2-regulator {
232                         compatible = "regulator-fixed";
233                         reg = <2>;
234                         regulator-name = "SATA2 Power";
235                         regulator-min-microvolt = <5000000>;
236                         regulator-max-microvolt = <5000000>;
237                         startup-delay-us = <4000000>;
238                         enable-active-high;
239                         regulator-always-on;
240                         regulator-boot-on;
241                         gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>;
242                 };
243         };
244 };
245
246 &pinctrl {
247         disk1_led_pin: disk1-led-pin {
248                 marvell,pins = "mpp31";
249                 marvell,function = "gpio";
250         };
251
252         disk2_led_pin: disk2-led-pin {
253                 marvell,pins = "mpp32";
254                 marvell,function = "gpio";
255         };
256
257         sata1_pwr_pin: sata1-pwr-pin {
258                 marvell,pins = "mpp37";
259                 marvell,function = "gpio";
260         };
261
262         sata2_pwr_pin: sata2-pwr-pin {
263                 marvell,pins = "mpp62";
264                 marvell,function = "gpio";
265         };
266
267         sata1_pres_pin: sata1-pres-pin {
268                 marvell,pins = "mpp60";
269                 marvell,function = "gpio";
270         };
271
272         sata2_pres_pin: sata2-pres-pin {
273                 marvell,pins = "mpp48";
274                 marvell,function = "gpio";
275         };
276
277         syno_id_bit0_pin: syno-id-bit0-pin {
278                 marvell,pins = "mpp55";
279                 marvell,function = "gpio";
280         };
281
282         syno_id_bit1_pin: syno-id-bit1-pin {
283                 marvell,pins = "mpp56";
284                 marvell,function = "gpio";
285         };
286
287         syno_id_bit2_pin: syno-id-bit2-pin {
288                 marvell,pins = "mpp57";
289                 marvell,function = "gpio";
290         };
291
292         syno_id_bit3_pin: syno-id-bit3-pin {
293                 marvell,pins = "mpp58";
294                 marvell,function = "gpio";
295         };
296
297         fan_ctrl_low_pin: fan-ctrl-low-pin {
298                 marvell,pins = "mpp65";
299                 marvell,function = "gpio";
300         };
301
302         fan_ctrl_mid_pin: fan-ctrl-mid-pin {
303                 marvell,pins = "mpp64";
304                 marvell,function = "gpio";
305         };
306
307         fan_ctrl_high_pin: fan-ctrl-high-pin {
308                 marvell,pins = "mpp63";
309                 marvell,function = "gpo";
310         };
311
312         fan_alarm_pin: fan-alarm-pin {
313                 marvell,pins = "mpp38";
314                 marvell,function = "gpio";
315         };
316 };