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 {
57295436Sandrew		stdout-path = "serial0:115200n8";
58279377Simp	};
59279377Simp
60279377Simp	memory {
61279377Simp		device_type = "memory";
62279377Simp		reg = <0 0x00000000 0 0x20000000>; /* 512MB */
63279377Simp	};
64279377Simp
65279377Simp	soc {
66279377Simp		ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
67295436Sandrew			MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
68295436Sandrew			MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
69295436Sandrew			MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
70279377Simp
71279377Simp		pcie-controller {
72279377Simp			status = "okay";
73279377Simp
74279377Simp			/* Quad port sata: Marvell 88SX7042 */
75279377Simp			pcie@1,0 {
76279377Simp				/* Port 0, Lane 0 */
77279377Simp				status = "okay";
78279377Simp			};
79279377Simp
80279377Simp			/* USB 3.0 xHCI controller: NEC D720200F1 */
81279377Simp			pcie@5,0 {
82279377Simp				/* Port 1, Lane 0 */
83279377Simp				status = "okay";
84279377Simp			};
85279377Simp		};
86279377Simp
87279377Simp		internal-regs {
88279377Simp			serial@12000 {
89279377Simp				status = "okay";
90279377Simp			};
91279377Simp
92279377Simp			mdio {
93279377Simp				phy0: ethernet-phy@0 { /* Marvell 88E1318 */
94279377Simp					reg = <0>;
95279377Simp				};
96279377Simp
97279377Simp				phy1: ethernet-phy@1 { /* Marvell 88E1318 */
98279377Simp					reg = <1>;
99279377Simp				};
100279377Simp			};
101279377Simp
102279377Simp			ethernet@70000 {
103279377Simp				pinctrl-0 = <&ge0_rgmii_pins>;
104279377Simp				pinctrl-names = "default";
105279377Simp				status = "okay";
106279377Simp				phy = <&phy0>;
107279377Simp				phy-mode = "rgmii-id";
108279377Simp			};
109279377Simp
110279377Simp			ethernet@74000 {
111279377Simp				pinctrl-0 = <&ge1_rgmii_pins>;
112279377Simp				pinctrl-names = "default";
113279377Simp				status = "okay";
114279377Simp				phy = <&phy1>;
115279377Simp				phy-mode = "rgmii-id";
116279377Simp			};
117279377Simp
118279377Simp			usb@50000 {
119279377Simp				status = "okay";
120279377Simp			};
121279377Simp
122279377Simp			usb@51000 {
123279377Simp				status = "okay";
124279377Simp			};
125279377Simp
126279377Simp			i2c@11000 {
127279377Simp				clock-frequency = <400000>;
128279377Simp				status = "okay";
129279377Simp
130279377Simp				adt7473@2e {
131279377Simp					compatible = "adi,adt7473";
132279377Simp					reg = <0x2e>;
133279377Simp				};
134279377Simp
135279377Simp				eeprom@50 {
136279377Simp					compatible = "atmel,24c64";
137279377Simp					reg = <0x50>;
138279377Simp				};
139279377Simp
140279377Simp				pcf8563@51 {
141279377Simp					compatible = "nxp,pcf8563";
142279377Simp					reg = <0x51>;
143279377Simp				};
144279377Simp
145279377Simp			};
146279377Simp
147279377Simp			nand@d0000 {
148279377Simp				status = "okay";
149279377Simp				num-cs = <1>;
150279377Simp				marvell,nand-keep-config;
151279377Simp				marvell,nand-enable-arbiter;
152279377Simp				nand-on-flash-bbt;
153279377Simp
154295436Sandrew				partitions {
155295436Sandrew					#address-cells = <1>;
156295436Sandrew					#size-cells = <1>;
157279377Simp
158295436Sandrew					partition@0 {
159295436Sandrew						label = "u-boot";
160295436Sandrew						reg = <0x00000000 0x000e0000>;
161295436Sandrew						read-only;
162295436Sandrew					};
163279377Simp
164295436Sandrew					partition@e0000 {
165295436Sandrew						label = "u-boot-env";
166295436Sandrew						reg = <0x000e0000 0x00020000>;
167295436Sandrew						read-only;
168295436Sandrew					};
169279377Simp
170295436Sandrew					partition@100000 {
171295436Sandrew						label = "u-boot-env2";
172295436Sandrew						reg = <0x00100000 0x00020000>;
173295436Sandrew						read-only;
174295436Sandrew					};
175279377Simp
176295436Sandrew					partition@120000 {
177295436Sandrew						label = "zImage";
178295436Sandrew						reg = <0x00120000 0x00400000>;
179295436Sandrew					};
180279377Simp
181295436Sandrew					partition@520000 {
182295436Sandrew						label = "initrd";
183295436Sandrew						reg = <0x00520000 0x00400000>;
184295436Sandrew					};
185279377Simp
186295436Sandrew					partition@e00000 {
187295436Sandrew						label = "boot";
188295436Sandrew						reg = <0x00e00000 0x3f200000>;
189295436Sandrew					};
190279377Simp				};
191279377Simp			};
192279377Simp		};
193279377Simp	};
194279377Simp
195279377Simp	gpio-keys {
196279377Simp		compatible = "gpio-keys";
197279377Simp		pinctrl-0 = <&power_button_pin &reset_button_pin
198279377Simp			&select_button_pin &scroll_button_pin>;
199279377Simp		pinctrl-names = "default";
200279377Simp
201279377Simp		power-button {
202279377Simp			label = "Power Button";
203279377Simp			linux,code = <KEY_POWER>;
204279377Simp			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
205279377Simp		};
206279377Simp
207279377Simp		reset-button {
208279377Simp			label = "Reset Button";
209279377Simp			linux,code = <KEY_RESTART>;
210279377Simp			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
211279377Simp		};
212279377Simp
213279377Simp		select-button {
214279377Simp			label = "Select Button";
215279377Simp			linux,code = <BTN_SELECT>;
216279377Simp			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
217279377Simp		};
218279377Simp
219279377Simp		scroll-button {
220279377Simp			label = "Scroll Button";
221279377Simp			linux,code = <KEY_SCROLLDOWN>;
222279377Simp			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
223279377Simp		};
224279377Simp	};
225279377Simp
226279377Simp	spi3 {
227279377Simp		compatible = "spi-gpio";
228279377Simp		status = "okay";
229279377Simp		gpio-sck = <&gpio0 25 GPIO_ACTIVE_LOW>;
230279377Simp		gpio-mosi = <&gpio1 15 GPIO_ACTIVE_LOW>; /*gpio 47*/
231279377Simp		cs-gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
232279377Simp		num-chipselects = <1>;
233279377Simp		#address-cells = <1>;
234279377Simp		#size-cells = <0>;
235279377Simp
236279377Simp		gpio_spi: gpio_spi@0 {
237279377Simp			compatible = "fairchild,74hc595";
238279377Simp			gpio-controller;
239279377Simp			#gpio-cells = <2>;
240279377Simp			reg = <0>;
241279377Simp			registers-number = <1>;
242279377Simp			spi-max-frequency = <100000>;
243279377Simp		};
244279377Simp	};
245279377Simp
246279377Simp	gpio-leds {
247279377Simp		compatible = "gpio-leds";
248279377Simp		pinctrl-0 = <&hdd_led_pin>;
249279377Simp		pinctrl-names = "default";
250279377Simp
251279377Simp		hdd-led {
252279377Simp			label = "ix4-300d:hdd:blue";
253279377Simp			gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
254279377Simp			default-state = "off";
255279377Simp		};
256279377Simp
257279377Simp		power-led {
258279377Simp			label = "ix4-300d:power:white";
259279377Simp			gpios = <&gpio_spi 1 GPIO_ACTIVE_LOW>;
260279377Simp			/* init blinking while booting */
261279377Simp			linux,default-trigger = "timer";
262279377Simp			default-state = "on";
263279377Simp		};
264279377Simp
265279377Simp		sysfail-led {
266279377Simp			label = "ix4-300d:sysfail:red";
267279377Simp			gpios = <&gpio_spi 2 GPIO_ACTIVE_HIGH>;
268279377Simp			default-state = "off";
269279377Simp		};
270279377Simp
271279377Simp		sys-led {
272279377Simp			label = "ix4-300d:sys:blue";
273279377Simp			gpios = <&gpio_spi 3 GPIO_ACTIVE_HIGH>;
274279377Simp			default-state = "off";
275279377Simp		};
276279377Simp
277279377Simp		hddfail-led {
278279377Simp			label = "ix4-300d:hddfail:red";
279279377Simp			gpios = <&gpio_spi 4 GPIO_ACTIVE_HIGH>;
280279377Simp			default-state = "off";
281279377Simp		};
282279377Simp
283279377Simp	};
284279377Simp
285279377Simp	/*
286279377Simp	 * Warning: you need both eth1 & 0 PHY initialized (i.e having
287279377Simp	 * them up does the tweak) for poweroff to shutdown otherwise it
288279377Simp	 * reboots
289279377Simp	 */
290279377Simp	gpio-poweroff {
291279377Simp		compatible = "gpio-poweroff";
292279377Simp		pinctrl-0 = <&poweroff_pin>;
293279377Simp		pinctrl-names = "default";
294279377Simp		gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
295279377Simp	};
296279377Simp};
297279377Simp
298279377Simp&pinctrl {
299279377Simp	poweroff_pin: poweroff-pin {
300279377Simp		marvell,pins = "mpp24";
301279377Simp		marvell,function = "gpio";
302279377Simp	};
303279377Simp
304279377Simp	power_button_pin: power-button-pin {
305279377Simp		marvell,pins = "mpp44";
306279377Simp		marvell,function = "gpio";
307279377Simp	};
308279377Simp
309279377Simp	reset_button_pin: reset-button-pin {
310279377Simp		marvell,pins = "mpp45";
311279377Simp		marvell,function = "gpio";
312279377Simp	};
313279377Simp	select_button_pin: select-button-pin {
314279377Simp		marvell,pins = "mpp41";
315279377Simp		marvell,function = "gpio";
316279377Simp	};
317279377Simp
318279377Simp	scroll_button_pin: scroll-button-pin {
319279377Simp		marvell,pins = "mpp42";
320279377Simp		marvell,function = "gpio";
321279377Simp	};
322279377Simp
323279377Simp	hdd_led_pin: hdd-led-pin {
324279377Simp		marvell,pins = "mpp26";
325279377Simp		marvell,function = "gpio";
326279377Simp	};
327279377Simp};
328