1/*
2 * Device Tree common file for the Seagate NAS 2 and 4-bay (Armada 370 SoC).
3 *
4 * Copyright (C) 2015 Seagate
5 *
6 * Author: Vincent Donnefort <vdonnefort@gmail.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2.  This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13/*
14 * TODO: add support for the white SATA LEDs associated with HDD 0 and 1.
15 */
16
17#include "armada-370.dtsi"
18#include <dt-bindings/gpio/gpio.h>
19#include <dt-bindings/input/input.h>
20
21/ {
22	chosen {
23		stdout-path = "serial0:115200n8";
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 0xf1000000 0x100000
33			  MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
34
35		pcie-controller {
36			status = "okay";
37
38			/* USB 3.0 bridge ASM1042A */
39			pcie@2,0 {
40				status = "okay";
41			};
42		};
43
44		internal-regs {
45			serial@12000 {
46				status = "okay";
47			};
48
49			sata@a0000 {
50				nr-ports = <2>;
51				status = "okay";
52			};
53
54			mdio {
55				pinctrl-0 = <&mdio_pins>;
56				pinctrl-names = "default";
57
58				phy0: ethernet-phy@0 {
59					reg = <0>;
60				};
61			};
62
63			ethernet@70000 {
64				status = "okay";
65				pinctrl-0 = <&ge0_rgmii_pins>;
66				pinctrl-names = "default";
67				phy = <&phy0>;
68				phy-mode = "rgmii-id";
69			};
70
71			i2c@11000 {
72				status = "okay";
73				pinctrl-0 = <&i2c0_pins>;
74				pinctrl-names = "default";
75				clock-frequency = <100000>;
76
77				/* RTC - NXP 8563T (second source) */
78				rtc@51 {
79					compatible = "nxp,pcf8563";
80					reg = <0x51>;
81					interrupts = <110>;
82				};
83				/* RTC - MCP7940NT */
84				rtc@6f {
85					compatible = "microchip,mcp7941x";
86					reg = <0x6f>;
87					interrupts = <110>;
88				};
89			};
90
91			nand@d0000 {
92				status = "okay";
93				num-cs = <1>;
94				marvell,nand-keep-config;
95				marvell,nand-enable-arbiter;
96				nand-on-flash-bbt;
97				nand-ecc-strength = <4>;
98				nand-ecc-step-size = <512>;
99
100				partition@0 {
101					label = "u-boot";
102					reg = <0x0 0x300000>;
103				};
104				partition@300000 {
105					label = "device-tree";
106					reg = <0x300000 0x20000>;
107				};
108				partition@320000 {
109					label = "linux";
110					reg = <0x320000 0x2000000>;
111				};
112				partition@2320000 {
113					label = "rootfs";
114					reg = <0x2320000 0xdce0000>;
115				};
116			};
117		};
118
119	};
120
121	regulators {
122		compatible = "simple-bus";
123		#address-cells = <1>;
124		#size-cells = <0>;
125		pinctrl-names = "default";
126
127		regulator@1 {
128			compatible = "regulator-fixed";
129			reg = <1>;
130			regulator-name = "SATA0 power";
131			regulator-min-microvolt = <5000000>;
132			regulator-max-microvolt = <5000000>;
133			enable-active-high;
134			regulator-always-on;
135			regulator-boot-on;
136			gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
137		};
138		regulator@2 {
139			compatible = "regulator-fixed";
140			reg = <2>;
141			regulator-name = "SATA1 power";
142			regulator-min-microvolt = <5000000>;
143			regulator-max-microvolt = <5000000>;
144			enable-active-high;
145			regulator-always-on;
146			regulator-boot-on;
147			gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
148		};
149	};
150
151	gpio-fan {
152		compatible = "gpio-fan";
153		gpios = <&gpio2 0 GPIO_ACTIVE_HIGH
154			 &gpio2 1 GPIO_ACTIVE_HIGH>;
155	};
156
157	gpio-keys {
158		compatible = "gpio-keys";
159		#address-cells = <1>;
160		#size-cells = <0>;
161
162		button@1 {
163			label = "Power button";
164			linux,code = <KEY_POWER>;
165			gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
166			debounce-interval = <100>;
167		};
168		button@2 {
169			label = "Backup button";
170			linux,code = <KEY_OPTION>;
171			gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
172			debounce-interval = <100>;
173		};
174		button@3 {
175			label = "Reset Button";
176			linux,code = <KEY_RESTART>;
177			gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
178			debounce-interval = <100>;
179		};
180	};
181
182	gpio-leds {
183		compatible = "gpio-leds";
184
185		white-power {
186			label = "dart:white:power";
187			gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
188			linux,default-trigger = "timer";
189
190		};
191		red-power {
192			label = "dart:red:power";
193			gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>;
194		};
195		red-sata0 {
196			label = "dart:red:sata0";
197			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
198		};
199		red-sata1 {
200			label = "dart:red:sata1";
201			gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
202		};
203	};
204
205	gpio_poweroff {
206		compatible = "gpio-poweroff";
207		gpios = <&gpio1 30 GPIO_ACTIVE_LOW>;
208	};
209};
210
211&pinctrl {
212	pinctrl-0 = <&hdd0_led_sata_pin>, <&hdd1_led_sata_pin>;
213	pinctrl-names = "default";
214
215	hdd0_led_sata_pin: hdd0-led-sata-pin {
216		marvell,pins = "mpp48";
217		marvell,function = "sata1";
218	};
219	hdd0_led_gpio_pin: hdd0-led-gpio-pin {
220		marvell,pins = "mpp48";
221		marvell,function = "gpio";
222	};
223	hdd1_led_sata_pin: hdd1-led-sata-pin {
224		marvell,pins = "mpp57";
225		marvell,function = "sata0";
226	};
227	hdd1_led_gpio_pin: hdd1-led-gpio-pin {
228		marvell,pins = "mpp57";
229		marvell,function = "gpio";
230	};
231};
232