1279377Simp/*
2279377Simp * Device Tree file for NETGEAR ReadyNAS 2120
3279377Simp *
4279377Simp * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
5279377Simp *
6279377Simp * This file is dual-licensed: you can use it either under the terms
7279377Simp * of the GPL or the X11 license, at your option. Note that this dual
8279377Simp * licensing only applies to this file, and not this project as a
9279377Simp * whole.
10295436Sandrew *
11279377Simp *  a) This file is free software; you can redistribute it and/or
12279377Simp *     modify it under the terms of the GNU General Public License as
13279377Simp *     published by the Free Software Foundation; either version 2 of the
14279377Simp *     License, or (at your option) any later version.
15279377Simp *
16279377Simp *     This file is distributed in the hope that it will be useful
17279377Simp *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18279377Simp *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19279377Simp *     GNU General Public License for more details.
20279377Simp *
21279377Simp * Or, alternatively
22279377Simp *
23279377Simp *  b) Permission is hereby granted, free of charge, to any person
24279377Simp *     obtaining a copy of this software and associated documentation
25279377Simp *     files (the "Software"), to deal in the Software without
26279377Simp *     restriction, including without limitation the rights to use
27279377Simp *     copy, modify, merge, publish, distribute, sublicense, and/or
28279377Simp *     sell copies of the Software, and to permit persons to whom the
29279377Simp *     Software is furnished to do so, subject to the following
30279377Simp *     conditions:
31279377Simp *
32279377Simp *     The above copyright notice and this permission notice shall be
33279377Simp *     included in all copies or substantial portions of the Software.
34279377Simp *
35279377Simp *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
36279377Simp *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37279377Simp *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38279377Simp *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39279377Simp *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
40279377Simp *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41279377Simp *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42279377Simp *     OTHER DEALINGS IN THE SOFTWARE.
43279377Simp */
44279377Simp
45279377Simp/dts-v1/;
46279377Simp
47279377Simp#include <dt-bindings/input/input.h>
48279377Simp#include <dt-bindings/gpio/gpio.h>
49279377Simp#include "armada-xp-mv78230.dtsi"
50279377Simp
51279377Simp/ {
52279377Simp	model = "NETGEAR ReadyNAS 2120";
53279377Simp	compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
54279377Simp
55279377Simp	chosen {
56279377Simp		stdout-path = "serial0:115200n8";
57279377Simp	};
58279377Simp
59279377Simp	memory {
60279377Simp		device_type = "memory";
61279377Simp		reg = <0 0x00000000 0 0x80000000>; /* 2GB */
62279377Simp	};
63279377Simp
64279377Simp	soc {
65279377Simp		ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
66279377Simp			  MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
67279377Simp			  MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
68279377Simp			  MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
69279377Simp
70279377Simp		pcie-controller {
71279377Simp			status = "okay";
72279377Simp
73279377Simp			/* Connected to first Marvell 88SE9170 SATA controller */
74279377Simp			pcie@1,0 {
75279377Simp				/* Port 0, Lane 0 */
76279377Simp				status = "okay";
77279377Simp			};
78279377Simp
79279377Simp			/* Connected to second Marvell 88SE9170 SATA controller */
80279377Simp			pcie@2,0 {
81279377Simp				/* Port 0, Lane 1 */
82279377Simp				status = "okay";
83279377Simp			};
84279377Simp
85279377Simp			/* Connected to Fresco Logic FL1009 USB 3.0 controller */
86279377Simp			pcie@5,0 {
87279377Simp				/* Port 1, Lane 0 */
88279377Simp				status = "okay";
89279377Simp			};
90279377Simp		};
91279377Simp
92279377Simp		internal-regs {
93279377Simp
94279377Simp			/* RTC is provided by Intersil ISL12057 I2C RTC chip */
95279377Simp			rtc@10300 {
96279377Simp				status = "disabled";
97279377Simp			};
98279377Simp
99279377Simp			i2c@11000 {
100279377Simp				compatible = "marvell,mv64xxx-i2c";
101279377Simp				clock-frequency = <400000>;
102279377Simp				status = "okay";
103279377Simp
104279377Simp				/* Controller for rear fan #1 of 3 (Protechnic
105279377Simp				 * MGT4012XB-O20, 8000RPM) near eSATA port */
106279377Simp				g762_fan1: g762@3e {
107279377Simp					compatible = "gmt,g762";
108279377Simp					reg = <0x3e>;
109279377Simp					clocks = <&g762_clk>; /* input clock */
110295436Sandrew					fan_gear_mode = <0>;
111279377Simp					fan_startv = <1>;
112279377Simp					pwm_polarity = <0>;
113279377Simp				};
114279377Simp
115279377Simp				/*  Controller for rear (center) fan #2 of 3 */
116279377Simp				g762_fan2: g762@48 {
117279377Simp					compatible = "gmt,g762";
118295436Sandrew					reg = <0x48>;
119279377Simp					clocks = <&g762_clk>; /* input clock */
120279377Simp					fan_gear_mode = <0>;
121279377Simp					fan_startv = <1>;
122279377Simp					pwm_polarity = <0>;
123279377Simp				};
124279377Simp
125279377Simp				/*  Controller for rear fan #3 of 3 */
126295436Sandrew				g762_fan3: g762@49 {
127279377Simp					compatible = "gmt,g762";
128279377Simp					reg = <0x49>;
129279377Simp					clocks = <&g762_clk>; /* input clock */
130279377Simp					fan_gear_mode = <0>;
131279377Simp					fan_startv = <1>;
132279377Simp					pwm_polarity = <0>;
133279377Simp				};
134295436Sandrew
135279377Simp				/* Temperature sensor */
136279377Simp				g751: g751@4c {
137279377Simp					compatible = "gmt,g751";
138279377Simp					reg = <0x4c>;
139279377Simp				};
140279377Simp
141279377Simp				isl12057: isl12057@68 {
142295436Sandrew					compatible = "isil,isl12057";
143279377Simp					reg = <0x68>;
144279377Simp					wakeup-source;
145279377Simp				};
146279377Simp			};
147279377Simp
148279377Simp			serial@12000 {
149279377Simp				status = "okay";
150295436Sandrew			};
151279377Simp
152279377Simp			/* Front USB 2.0 port */
153279377Simp			usb@50000 {
154279377Simp				status = "okay";
155279377Simp			};
156279377Simp
157279377Simp			mdio {
158279377Simp				phy0: ethernet-phy@0 { /* Marvell 88E1318 */
159279377Simp					reg = <0>;
160279377Simp				};
161279377Simp
162279377Simp				phy1: ethernet-phy@1 { /* Marvell 88E1318 */
163279377Simp					reg = <1>;
164279377Simp				};
165279377Simp			};
166279377Simp
167279377Simp			ethernet@70000 {
168279377Simp				status = "okay";
169279377Simp				phy = <&phy0>;
170279377Simp				phy-mode = "rgmii-id";
171279377Simp			};
172279377Simp
173279377Simp			ethernet@74000 {
174279377Simp				status = "okay";
175279377Simp				phy = <&phy1>;
176279377Simp				phy-mode = "rgmii-id";
177279377Simp			};
178279377Simp
179279377Simp			/* Two rear eSATA ports */
180279377Simp			sata@a0000 {
181279377Simp				nr-ports = <2>;
182279377Simp				status = "okay";
183279377Simp			};
184279377Simp
185279377Simp			nand@d0000 {
186279377Simp				status = "okay";
187279377Simp				num-cs = <1>;
188279377Simp				marvell,nand-keep-config;
189279377Simp				marvell,nand-enable-arbiter;
190279377Simp				nand-on-flash-bbt;
191279377Simp
192279377Simp				/* Use Hardware BCH ECC */
193279377Simp				nand-ecc-strength = <4>;
194279377Simp				nand-ecc-step-size = <512>;
195279377Simp
196279377Simp				partition@0 {
197279377Simp					label = "u-boot";
198279377Simp					reg = <0x0000000 0x180000>;  /* 1.5MB */
199279377Simp					read-only;
200279377Simp				};
201279377Simp
202279377Simp				partition@180000 {
203279377Simp					label = "u-boot-env";
204279377Simp					reg = <0x180000 0x20000>;    /* 128KB */
205279377Simp					read-only;
206279377Simp				};
207279377Simp
208279377Simp				partition@200000 {
209279377Simp					label = "uImage";
210279377Simp					reg = <0x0200000 0x600000>;    /* 6MB */
211279377Simp				};
212279377Simp
213279377Simp				partition@800000 {
214279377Simp					label = "minirootfs";
215279377Simp					reg = <0x0800000 0x400000>;    /* 4MB */
216279377Simp				};
217279377Simp
218279377Simp				/* Last MB is for the BBT, i.e. not writable */
219279377Simp				partition@c00000 {
220279377Simp					label = "ubifs";
221279377Simp					reg = <0x0c00000 0x7400000>; /* 116MB */
222279377Simp				};
223279377Simp			};
224279377Simp		};
225279377Simp	};
226279377Simp
227279377Simp	clocks {
228279377Simp	       g762_clk: g762-oscillator {
229279377Simp			 compatible = "fixed-clock";
230279377Simp			 #clock-cells = <0>;
231279377Simp			 clock-frequency = <32768>;
232279377Simp	       };
233279377Simp	};
234279377Simp
235279377Simp	gpio-leds {
236279377Simp		compatible = "gpio-leds";
237279377Simp		pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin
238279377Simp			     &sata3_led_pin &sata4_led_pin>;
239279377Simp		pinctrl-names = "default";
240279377Simp
241279377Simp		red-sata1-led {
242279377Simp			label = "rn2120:red:sata1";
243279377Simp			gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
244279377Simp			default-state = "off";
245279377Simp		};
246279377Simp
247279377Simp		red-sata2-led {
248279377Simp			label = "rn2120:red:sata2";
249279377Simp			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
250279377Simp			default-state = "off";
251279377Simp		};
252279377Simp
253279377Simp		red-sata3-led {
254279377Simp			label = "rn2120:red:sata3";
255279377Simp			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
256279377Simp			default-state = "off";
257279377Simp		};
258279377Simp
259279377Simp		red-sata4-led {
260279377Simp			label = "rn2120:red:sata4";
261279377Simp			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
262295436Sandrew			default-state = "off";
263295436Sandrew		};
264295436Sandrew
265295436Sandrew		red-err-led {
266295436Sandrew			label = "rn2120:red:err";
267295436Sandrew			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
268295436Sandrew			default-state = "off";
269295436Sandrew		};
270279377Simp	};
271279377Simp
272279377Simp	gpio-keys {
273279377Simp		compatible = "gpio-keys";
274279377Simp		pinctrl-0 = <&power_button_pin &reset_button_pin>;
275279377Simp		pinctrl-names = "default";
276279377Simp
277279377Simp		power-button {
278279377Simp			label = "Power Button";
279279377Simp			linux,code = <KEY_POWER>;
280279377Simp			gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
281279377Simp		};
282279377Simp
283279377Simp		reset-button {
284279377Simp			label = "Reset Button";
285279377Simp			linux,code = <KEY_RESTART>;
286279377Simp			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
287279377Simp		};
288279377Simp	};
289279377Simp
290279377Simp	gpio-poweroff {
291279377Simp		compatible = "gpio-poweroff";
292279377Simp		pinctrl-0 = <&poweroff>;
293279377Simp		pinctrl-names = "default";
294279377Simp		gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
295279377Simp	};
296279377Simp};
297279377Simp
298279377Simp&pinctrl {
299279377Simp	poweroff: poweroff {
300279377Simp		marvell,pins = "mpp42";
301279377Simp		marvell,function = "gpio";
302279377Simp	};
303279377Simp
304279377Simp	power_button_pin: power-button-pin {
305279377Simp		marvell,pins = "mpp27";
306279377Simp		marvell,function = "gpio";
307279377Simp	};
308279377Simp
309279377Simp	reset_button_pin: reset-button-pin {
310279377Simp		marvell,pins = "mpp41";
311279377Simp		marvell,function = "gpio";
312279377Simp	};
313279377Simp
314279377Simp	sata1_led_pin: sata1-led-pin {
315279377Simp		marvell,pins = "mpp31";
316279377Simp		marvell,function = "gpio";
317279377Simp	};
318279377Simp
319279377Simp	sata2_led_pin: sata2-led-pin {
320279377Simp		marvell,pins = "mpp40";
321279377Simp		marvell,function = "gpio";
322279377Simp	};
323279377Simp
324279377Simp	sata3_led_pin: sata3-led-pin {
325279377Simp		marvell,pins = "mpp44";
326279377Simp		marvell,function = "gpio";
327279377Simp	};
328279377Simp
329279377Simp	sata4_led_pin: sata4-led-pin {
330279377Simp		marvell,pins = "mpp47";
331279377Simp		marvell,function = "gpio";
332279377Simp	};
333279377Simp
334279377Simp	sata1_power_pin: sata1-power-pin {
335279377Simp		marvell,pins = "mpp24";
336279377Simp		marvell,function = "gpio";
337279377Simp	};
338279377Simp
339279377Simp	sata2_power_pin: sata2-power-pin {
340279377Simp		marvell,pins = "mpp25";
341279377Simp		marvell,function = "gpio";
342279377Simp	};
343279377Simp
344279377Simp	sata3_power_pin: sata3-power-pin {
345279377Simp		marvell,pins = "mpp26";
346279377Simp		marvell,function = "gpio";
347279377Simp	};
348279377Simp
349279377Simp	sata4_power_pin: sata4-power-pin {
350279377Simp		marvell,pins = "mpp28";
351279377Simp		marvell,function = "gpio";
352279377Simp	};
353279377Simp
354279377Simp	sata1_pres_pin: sata1-pres-pin {
355279377Simp		marvell,pins = "mpp32";
356279377Simp		marvell,function = "gpio";
357279377Simp	};
358279377Simp
359279377Simp	sata2_pres_pin: sata2-pres-pin {
360279377Simp		marvell,pins = "mpp33";
361279377Simp		marvell,function = "gpio";
362279377Simp	};
363279377Simp
364279377Simp	sata3_pres_pin: sata3-pres-pin {
365279377Simp		marvell,pins = "mpp34";
366279377Simp		marvell,function = "gpio";
367279377Simp	};
368279377Simp
369279377Simp	sata4_pres_pin: sata4-pres-pin {
370279377Simp		marvell,pins = "mpp35";
371279377Simp		marvell,function = "gpio";
372279377Simp	};
373279377Simp
374279377Simp	err_led_pin: err-led-pin {
375279377Simp		marvell,pins = "mpp45";
376279377Simp		marvell,function = "gpio";
377279377Simp	};
378279377Simp};
379279377Simp