armada-xp-lenovo-ix4-300d.dts revision 279377
1279377Simp/*
2279377Simp * Device Tree file for Lenovo Iomega ix4-300d
3279377Simp *
4279377Simp * Copyright (C) 2014, Benoit Masson <yahoo@perenite.com>
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.
10279377Simp *
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 = "Lenovo Iomega ix4-300d";
53279377Simp	compatible = "lenovo,ix4-300d", "marvell,armadaxp-mv78230",
54279377Simp		     "marvell,armadaxp", "marvell,armada-370-xp";
55279377Simp
56279377Simp	chosen {
57279377Simp		bootargs = "console=ttyS0,115200 earlyprintk";
58279377Simp		stdout-path = &uart0;
59279377Simp	};
60279377Simp
61279377Simp	memory {
62279377Simp		device_type = "memory";
63279377Simp		reg = <0 0x00000000 0 0x20000000>; /* 512MB */
64279377Simp	};
65279377Simp
66279377Simp	soc {
67279377Simp		ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
68279377Simp			MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
69279377Simp
70279377Simp		pcie-controller {
71279377Simp			status = "okay";
72279377Simp
73279377Simp			/* Quad port sata: Marvell 88SX7042 */
74279377Simp			pcie@1,0 {
75279377Simp				/* Port 0, Lane 0 */
76279377Simp				status = "okay";
77279377Simp			};
78279377Simp
79279377Simp			/* USB 3.0 xHCI controller: NEC D720200F1 */
80279377Simp			pcie@5,0 {
81279377Simp				/* Port 1, Lane 0 */
82279377Simp				status = "okay";
83279377Simp			};
84279377Simp		};
85279377Simp
86279377Simp		internal-regs {
87279377Simp			serial@12000 {
88279377Simp				status = "okay";
89279377Simp			};
90279377Simp
91279377Simp			mdio {
92279377Simp				phy0: ethernet-phy@0 { /* Marvell 88E1318 */
93279377Simp					reg = <0>;
94279377Simp				};
95279377Simp
96279377Simp				phy1: ethernet-phy@1 { /* Marvell 88E1318 */
97279377Simp					reg = <1>;
98279377Simp				};
99279377Simp			};
100279377Simp
101279377Simp			ethernet@70000 {
102279377Simp				pinctrl-0 = <&ge0_rgmii_pins>;
103279377Simp				pinctrl-names = "default";
104279377Simp				status = "okay";
105279377Simp				phy = <&phy0>;
106279377Simp				phy-mode = "rgmii-id";
107279377Simp			};
108279377Simp
109279377Simp			ethernet@74000 {
110279377Simp				pinctrl-0 = <&ge1_rgmii_pins>;
111279377Simp				pinctrl-names = "default";
112279377Simp				status = "okay";
113279377Simp				phy = <&phy1>;
114279377Simp				phy-mode = "rgmii-id";
115279377Simp			};
116279377Simp
117279377Simp			usb@50000 {
118279377Simp				status = "okay";
119279377Simp			};
120279377Simp
121279377Simp			usb@51000 {
122279377Simp				status = "okay";
123279377Simp			};
124279377Simp
125279377Simp			i2c@11000 {
126279377Simp				clock-frequency = <400000>;
127279377Simp				status = "okay";
128279377Simp
129279377Simp				adt7473@2e {
130279377Simp					compatible = "adi,adt7473";
131279377Simp					reg = <0x2e>;
132279377Simp				};
133279377Simp
134279377Simp				eeprom@50 {
135279377Simp					compatible = "atmel,24c64";
136279377Simp					reg = <0x50>;
137279377Simp				};
138279377Simp
139279377Simp				pcf8563@51 {
140279377Simp					compatible = "nxp,pcf8563";
141279377Simp					reg = <0x51>;
142279377Simp				};
143279377Simp
144279377Simp			};
145279377Simp
146279377Simp			nand@d0000 {
147279377Simp				status = "okay";
148279377Simp				num-cs = <1>;
149279377Simp				marvell,nand-keep-config;
150279377Simp				marvell,nand-enable-arbiter;
151279377Simp				nand-on-flash-bbt;
152279377Simp
153279377Simp				partition@0 {
154279377Simp					label = "u-boot";
155279377Simp					reg = <0x0000000 0xe0000>;
156279377Simp					read-only;
157279377Simp				};
158279377Simp
159279377Simp				partition@e0000 {
160279377Simp					label = "u-boot-env";
161279377Simp					reg = <0xe0000 0x20000>;
162279377Simp					read-only;
163279377Simp				};
164279377Simp
165279377Simp				partition@100000 {
166279377Simp					label = "u-boot-env2";
167279377Simp					reg = <0x100000 0x20000>;
168279377Simp					read-only;
169279377Simp				};
170279377Simp
171279377Simp				partition@120000 {
172279377Simp					label = "zImage";
173279377Simp					reg = <0x120000 0x400000>;
174279377Simp				};
175279377Simp
176279377Simp				partition@520000 {
177279377Simp					label = "initrd";
178279377Simp					reg = <0x520000 0x400000>;
179279377Simp				};
180279377Simp
181279377Simp				partition@xE00000 {
182279377Simp					label = "boot";
183279377Simp					reg = <0xE00000 0x3F200000>;
184279377Simp				};
185279377Simp
186279377Simp				partition@flash {
187279377Simp					label = "flash";
188279377Simp					reg = <0x0 0x40000000>;
189279377Simp				};
190279377Simp			};
191279377Simp		};
192279377Simp	};
193279377Simp
194279377Simp	gpio-keys {
195279377Simp		compatible = "gpio-keys";
196279377Simp		pinctrl-0 = <&power_button_pin &reset_button_pin
197279377Simp			&select_button_pin &scroll_button_pin>;
198279377Simp		pinctrl-names = "default";
199279377Simp
200279377Simp		power-button {
201279377Simp			label = "Power Button";
202279377Simp			linux,code = <KEY_POWER>;
203279377Simp			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
204279377Simp		};
205279377Simp
206279377Simp		reset-button {
207279377Simp			label = "Reset Button";
208279377Simp			linux,code = <KEY_RESTART>;
209279377Simp			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
210279377Simp		};
211279377Simp
212279377Simp		select-button {
213279377Simp			label = "Select Button";
214279377Simp			linux,code = <BTN_SELECT>;
215279377Simp			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
216279377Simp		};
217279377Simp
218279377Simp		scroll-button {
219279377Simp			label = "Scroll Button";
220279377Simp			linux,code = <KEY_SCROLLDOWN>;
221279377Simp			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
222279377Simp		};
223279377Simp	};
224279377Simp
225279377Simp	spi3 {
226279377Simp		compatible = "spi-gpio";
227279377Simp		status = "okay";
228279377Simp		gpio-sck = <&gpio0 25 GPIO_ACTIVE_LOW>;
229279377Simp		gpio-mosi = <&gpio1 15 GPIO_ACTIVE_LOW>; /*gpio 47*/
230279377Simp		cs-gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
231279377Simp		num-chipselects = <1>;
232279377Simp		#address-cells = <1>;
233279377Simp		#size-cells = <0>;
234279377Simp
235279377Simp		gpio_spi: gpio_spi@0 {
236279377Simp			compatible = "fairchild,74hc595";
237279377Simp			gpio-controller;
238279377Simp			#gpio-cells = <2>;
239279377Simp			reg = <0>;
240279377Simp			registers-number = <1>;
241279377Simp			spi-max-frequency = <100000>;
242279377Simp		};
243279377Simp	};
244279377Simp
245279377Simp	gpio-leds {
246279377Simp		compatible = "gpio-leds";
247279377Simp		pinctrl-0 = <&hdd_led_pin>;
248279377Simp		pinctrl-names = "default";
249279377Simp
250279377Simp		hdd-led {
251279377Simp			label = "ix4-300d:hdd:blue";
252279377Simp			gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
253279377Simp			default-state = "off";
254279377Simp		};
255279377Simp
256279377Simp		power-led {
257279377Simp			label = "ix4-300d:power:white";
258279377Simp			gpios = <&gpio_spi 1 GPIO_ACTIVE_LOW>;
259279377Simp			/* init blinking while booting */
260279377Simp			linux,default-trigger = "timer";
261279377Simp			default-state = "on";
262279377Simp		};
263279377Simp
264279377Simp		sysfail-led {
265279377Simp			label = "ix4-300d:sysfail:red";
266279377Simp			gpios = <&gpio_spi 2 GPIO_ACTIVE_HIGH>;
267279377Simp			default-state = "off";
268279377Simp		};
269279377Simp
270279377Simp		sys-led {
271279377Simp			label = "ix4-300d:sys:blue";
272279377Simp			gpios = <&gpio_spi 3 GPIO_ACTIVE_HIGH>;
273279377Simp			default-state = "off";
274279377Simp		};
275279377Simp
276279377Simp		hddfail-led {
277279377Simp			label = "ix4-300d:hddfail:red";
278279377Simp			gpios = <&gpio_spi 4 GPIO_ACTIVE_HIGH>;
279279377Simp			default-state = "off";
280279377Simp		};
281279377Simp
282279377Simp	};
283279377Simp
284279377Simp	/*
285279377Simp	 * Warning: you need both eth1 & 0 PHY initialized (i.e having
286279377Simp	 * them up does the tweak) for poweroff to shutdown otherwise it
287279377Simp	 * reboots
288279377Simp	 */
289279377Simp	gpio-poweroff {
290279377Simp		compatible = "gpio-poweroff";
291279377Simp		pinctrl-0 = <&poweroff_pin>;
292279377Simp		pinctrl-names = "default";
293279377Simp		gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
294279377Simp	};
295279377Simp};
296279377Simp
297279377Simp&pinctrl {
298279377Simp	poweroff_pin: poweroff-pin {
299279377Simp		marvell,pins = "mpp24";
300279377Simp		marvell,function = "gpio";
301279377Simp	};
302279377Simp
303279377Simp	power_button_pin: power-button-pin {
304279377Simp		marvell,pins = "mpp44";
305279377Simp		marvell,function = "gpio";
306279377Simp	};
307279377Simp
308279377Simp	reset_button_pin: reset-button-pin {
309279377Simp		marvell,pins = "mpp45";
310279377Simp		marvell,function = "gpio";
311279377Simp	};
312279377Simp	select_button_pin: select-button-pin {
313279377Simp		marvell,pins = "mpp41";
314279377Simp		marvell,function = "gpio";
315279377Simp	};
316279377Simp
317279377Simp	scroll_button_pin: scroll-button-pin {
318279377Simp		marvell,pins = "mpp42";
319279377Simp		marvell,function = "gpio";
320279377Simp	};
321279377Simp
322279377Simp	hdd_led_pin: hdd-led-pin {
323279377Simp		marvell,pins = "mpp26";
324279377Simp		marvell,function = "gpio";
325279377Simp	};
326279377Simp};
327