Merge tag 'fbdev-v5.1' of git://github.com/bzolnier/linux
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / armada-xp-lenovo-ix4-300d.dts
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Device Tree file for Lenovo Iomega ix4-300d
4  *
5  * Copyright (C) 2014, Benoit Masson <yahoo@perenite.com>
6  */
7
8 /dts-v1/;
9
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/gpio/gpio.h>
12 #include "armada-xp-mv78230.dtsi"
13
14 / {
15         model = "Lenovo Iomega ix4-300d";
16         compatible = "lenovo,ix4-300d", "marvell,armadaxp-mv78230",
17                      "marvell,armadaxp", "marvell,armada-370-xp";
18
19         chosen {
20                 stdout-path = "serial0:115200n8";
21         };
22
23         memory@0 {
24                 device_type = "memory";
25                 reg = <0 0x00000000 0 0x20000000>; /* 512MB */
26         };
27
28         soc {
29                 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
30                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
31                         MBUS_ID(0x09, 0x09) 0 0 0xf1100000 0x10000
32                         MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000>;
33
34                 internal-regs {
35                         serial@12000 {
36                                 status = "okay";
37                         };
38
39                         ethernet@70000 {
40                                 pinctrl-0 = <&ge0_rgmii_pins>;
41                                 pinctrl-names = "default";
42                                 status = "okay";
43                                 phy = <&phy0>;
44                                 phy-mode = "rgmii-id";
45                         };
46
47                         ethernet@74000 {
48                                 pinctrl-0 = <&ge1_rgmii_pins>;
49                                 pinctrl-names = "default";
50                                 status = "okay";
51                                 phy = <&phy1>;
52                                 phy-mode = "rgmii-id";
53                         };
54
55                         usb@50000 {
56                                 status = "okay";
57                         };
58
59                         usb@51000 {
60                                 status = "okay";
61                         };
62
63                         i2c@11000 {
64                                 clock-frequency = <400000>;
65                                 status = "okay";
66
67                                 adt7473@2e {
68                                         compatible = "adi,adt7473";
69                                         reg = <0x2e>;
70                                 };
71
72                                 eeprom@50 {
73                                         compatible = "atmel,24c64";
74                                         reg = <0x50>;
75                                 };
76
77                                 pcf8563@51 {
78                                         compatible = "nxp,pcf8563";
79                                         reg = <0x51>;
80                                 };
81
82                         };
83
84                         nand-controller@d0000 {
85                                 status = "okay";
86
87                                 nand@0 {
88                                         reg = <0>;
89                                         label = "pxa3xx_nand-0";
90                                         nand-rb = <0>;
91                                         nand-on-flash-bbt;
92
93                                         partitions {
94                                                 compatible = "fixed-partitions";
95                                                 #address-cells = <1>;
96                                                 #size-cells = <1>;
97
98                                                 partition@0 {
99                                                         label = "u-boot";
100                                                         reg = <0x00000000 0x000e0000>;
101                                                         read-only;
102                                                 };
103
104                                                 partition@e0000 {
105                                                         label = "u-boot-env";
106                                                         reg = <0x000e0000 0x00020000>;
107                                                         read-only;
108                                                 };
109
110                                                 partition@100000 {
111                                                         label = "u-boot-env2";
112                                                         reg = <0x00100000 0x00020000>;
113                                                         read-only;
114                                                 };
115
116                                                 partition@120000 {
117                                                         label = "zImage";
118                                                         reg = <0x00120000 0x00400000>;
119                                                 };
120
121                                                 partition@520000 {
122                                                         label = "initrd";
123                                                         reg = <0x00520000 0x00400000>;
124                                                 };
125
126                                                 partition@e00000 {
127                                                         label = "boot";
128                                                         reg = <0x00e00000 0x3f200000>;
129                                                 };
130                                         };
131                                 };
132                         };
133                 };
134         };
135
136         gpio-keys {
137                 compatible = "gpio-keys";
138                 pinctrl-0 = <&power_button_pin &reset_button_pin
139                         &select_button_pin &scroll_button_pin>;
140                 pinctrl-names = "default";
141
142                 power-button {
143                         label = "Power Button";
144                         linux,code = <KEY_POWER>;
145                         gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
146                 };
147
148                 reset-button {
149                         label = "Reset Button";
150                         linux,code = <KEY_RESTART>;
151                         gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
152                 };
153
154                 select-button {
155                         label = "Select Button";
156                         linux,code = <BTN_SELECT>;
157                         gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
158                 };
159
160                 scroll-button {
161                         label = "Scroll Button";
162                         linux,code = <KEY_SCROLLDOWN>;
163                         gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
164                 };
165         };
166
167         spi3 {
168                 compatible = "spi-gpio";
169                 status = "okay";
170                 gpio-sck = <&gpio0 25 GPIO_ACTIVE_LOW>;
171                 gpio-mosi = <&gpio1 15 GPIO_ACTIVE_LOW>; /*gpio 47*/
172                 cs-gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
173                 num-chipselects = <1>;
174                 #address-cells = <1>;
175                 #size-cells = <0>;
176
177                 gpio_spi: gpio_spi@0 {
178                         compatible = "fairchild,74hc595";
179                         gpio-controller;
180                         #gpio-cells = <2>;
181                         reg = <0>;
182                         registers-number = <1>;
183                         spi-max-frequency = <100000>;
184                 };
185         };
186
187         gpio-leds {
188                 compatible = "gpio-leds";
189                 pinctrl-0 = <&hdd_led_pin>;
190                 pinctrl-names = "default";
191
192                 hdd-led {
193                         label = "ix4-300d:hdd:blue";
194                         gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
195                         default-state = "off";
196                 };
197
198                 power-led {
199                         label = "ix4-300d:power:white";
200                         gpios = <&gpio_spi 1 GPIO_ACTIVE_LOW>;
201                         /* init blinking while booting */
202                         linux,default-trigger = "timer";
203                         default-state = "on";
204                 };
205
206                 sysfail-led {
207                         label = "ix4-300d:sysfail:red";
208                         gpios = <&gpio_spi 2 GPIO_ACTIVE_HIGH>;
209                         default-state = "off";
210                 };
211
212                 sys-led {
213                         label = "ix4-300d:sys:blue";
214                         gpios = <&gpio_spi 3 GPIO_ACTIVE_HIGH>;
215                         default-state = "off";
216                 };
217
218                 hddfail-led {
219                         label = "ix4-300d:hddfail:red";
220                         gpios = <&gpio_spi 4 GPIO_ACTIVE_HIGH>;
221                         default-state = "off";
222                 };
223
224         };
225
226         /*
227          * Warning: you need both eth1 & 0 PHY initialized (i.e having
228          * them up does the tweak) for poweroff to shutdown otherwise it
229          * reboots
230          */
231         gpio-poweroff {
232                 compatible = "gpio-poweroff";
233                 pinctrl-0 = <&poweroff_pin>;
234                 pinctrl-names = "default";
235                 gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
236         };
237 };
238 &pciec {
239         status = "okay";
240
241         /* Quad port sata: Marvell 88SX7042 */
242         pcie@1,0 {
243                 /* Port 0, Lane 0 */
244                 status = "okay";
245         };
246
247         /* USB 3.0 xHCI controller: NEC D720200F1 */
248         pcie@5,0 {
249                 /* Port 1, Lane 0 */
250                 status = "okay";
251         };
252 };
253
254 &mdio {
255         phy0: ethernet-phy@0 { /* Marvell 88E1318 */
256                 reg = <0>;
257         };
258
259         phy1: ethernet-phy@1 { /* Marvell 88E1318 */
260                 reg = <1>;
261         };
262 };
263
264 &pinctrl {
265         poweroff_pin: poweroff-pin {
266                 marvell,pins = "mpp24";
267                 marvell,function = "gpio";
268         };
269
270         power_button_pin: power-button-pin {
271                 marvell,pins = "mpp44";
272                 marvell,function = "gpio";
273         };
274
275         reset_button_pin: reset-button-pin {
276                 marvell,pins = "mpp45";
277                 marvell,function = "gpio";
278         };
279         select_button_pin: select-button-pin {
280                 marvell,pins = "mpp41";
281                 marvell,function = "gpio";
282         };
283
284         scroll_button_pin: scroll-button-pin {
285                 marvell,pins = "mpp42";
286                 marvell,function = "gpio";
287         };
288
289         hdd_led_pin: hdd-led-pin {
290                 marvell,pins = "mpp26";
291                 marvell,function = "gpio";
292         };
293 };