d14ea8b94e391abb7088b70dab772eca46017e2d
[openwrt/staging/hauke.git] / target / linux / mvebu / files / arch / arm / boot / dts / armada-385-nas1dual.dts
1 // SPDX-License-Identifier: (GPL-2.0-only OR MIT)
2 /*
3 * Device Tree file for ipTIME NAS1dual
4 *
5 * Copyright (C) 2020 Sungbo Eo <mans0n@gorani.run>
6 *
7 * Based on armada-385-linksys.dtsi
8 * Copyright (C) 2015 Imre Kaloz <kaloz@openwrt.org>
9 */
10
11 /dts-v1/;
12
13 #include <dt-bindings/gpio/gpio.h>
14 #include <dt-bindings/input/input.h>
15 #include "armada-385.dtsi"
16
17 / {
18 model = "ipTIME NAS1dual";
19 compatible = "iptime,nas1dual", "marvell,armada385", "marvell,armada380";
20
21 aliases {
22 led-boot = &led_ready;
23 led-failsafe = &led_ready;
24 led-running = &led_ready;
25 led-upgrade = &led_ready;
26 label-mac-device = &eth0;
27 };
28
29 chosen {
30 bootargs = "console=ttyS0,115200n8";
31 stdout-path = "serial0:115200n8";
32 };
33
34 memory@0 {
35 device_type = "memory";
36 reg = <0x00000000 0x80000000>; /* 2GB */
37 };
38
39 soc {
40 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
41 MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
42 MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
43 MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
44 MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
45 };
46
47 gpio-keys {
48 compatible = "gpio-keys";
49 pinctrl-names = "default";
50 pinctrl-0 = <&gpio_keys_pins>;
51
52 power {
53 label = "Power Button";
54 linux,input-type = <EV_SW>;
55 linux,code = <KEY_POWER>;
56 gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
57 };
58
59 reset {
60 label = "Reset Button";
61 linux,code = <KEY_RESTART>;
62 gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
63 };
64
65 copy {
66 label = "USB Copy Button";
67 linux,code = <KEY_COPY>;
68 gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
69 };
70 };
71
72 gpio-leds {
73 compatible = "gpio-leds";
74 pinctrl-names = "default";
75 pinctrl-0 = <&gpio_leds_pins>;
76
77 led_ready: ready {
78 label = "blue:ready";
79 gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
80 };
81
82 hdd {
83 label = "blue:hdd";
84 gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
85 linux,default-trigger = "disk-activity";
86 };
87
88 usb {
89 label = "blue:usb";
90 gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
91 trigger-sources = <&usb3_0_port1 &usb3_0_port2>;
92 linux,default-trigger = "usbport";
93 };
94 };
95
96 gpio-fan {
97 compatible = "gpio-fan";
98 pinctrl-names = "default";
99 pinctrl-0 = <&gpio_fan_pins>;
100 gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>,
101 <&gpio1 18 GPIO_ACTIVE_HIGH>;
102 /* We don't know the exact rpm, just use dummy values here. */
103 gpio-fan,speed-map = <0 0>, <1 1>, <2 2>;
104 #cooling-cells = <2>;
105 };
106
107 gpio-poweroff {
108 compatible = "gpio-poweroff";
109 gpios = <&pca9536 1 GPIO_ACTIVE_LOW>;
110 };
111
112 regulators {
113 compatible = "simple-bus";
114 #address-cells = <1>;
115 #size-cells = <0>;
116 pinctrl-names = "default";
117 pinctrl-0 = <&sata_power_pins>;
118
119 reg_sata_power: regulator@1 {
120 compatible = "regulator-fixed";
121 reg = <1>;
122 regulator-name = "sata-power";
123 regulator-min-microvolt = <12000000>;
124 regulator-max-microvolt = <12000000>;
125 gpio = <&gpio1 20 GPIO_ACTIVE_LOW>;
126 regulator-always-on;
127 };
128 };
129 };
130
131 &ahci0 {
132 status = "okay";
133 #address-cells = <1>;
134 #size-cells = <0>;
135
136 sata-port@0 {
137 reg = <0>;
138 target-supply = <&reg_sata_power>;
139 #thermal-sensor-cells = <0>;
140 };
141 };
142
143 &bm {
144 status = "okay";
145 };
146
147 &bm_bppi {
148 status = "okay";
149 };
150
151 &eth0 {
152 pinctrl-names = "default";
153 pinctrl-0 = <&ge0_rgmii_pins>;
154 status = "okay";
155 phy-handle = <&ethphy1>;
156 phy-connection-type = "rgmii-id";
157 buffer-manager = <&bm>;
158 bm,pool-long = <0>;
159 bm,pool-short = <1>;
160 nvmem-cells = <&macaddr_uboot_fffa8>;
161 nvmem-cell-names = "mac-address";
162 };
163
164 &eth1 {
165 pinctrl-names = "default";
166 pinctrl-0 = <&ge1_rgmii_pins>;
167 status = "okay";
168 phy-handle = <&ethphy0>;
169 phy-connection-type = "rgmii-id";
170 buffer-manager = <&bm>;
171 bm,pool-long = <2>;
172 bm,pool-short = <3>;
173 nvmem-cells = <&macaddr_uboot_fffa8>;
174 nvmem-cell-names = "mac-address";
175 };
176
177 &i2c0 {
178 pinctrl-names = "default";
179 pinctrl-0 = <&i2c0_pins>;
180 status = "okay";
181
182 pca9536: gpio@41 {
183 compatible = "nxp,pca9536";
184 reg = <0x41>;
185 gpio-controller;
186 #gpio-cells = <2>;
187 gpio-line-names = "power-led", "power-board";
188 };
189 };
190
191 &mdio {
192 pinctrl-names = "default";
193 pinctrl-0 = <&mdio_pins>;
194
195 /* LED1: On - Link, Blink - Activity, Off - No Link */
196
197 ethphy0: ethernet-phy@0 {
198 reg = <0>;
199 marvell,reg-init = <3 16 0 0x1017>;
200 };
201
202 ethphy1: ethernet-phy@1 {
203 reg = <1>;
204 marvell,reg-init = <3 16 0 0x1017>;
205 };
206 };
207
208 &pinctrl {
209 gpio_keys_pins: gpio-keys-pins {
210 marvell,pins = "mpp24", "mpp26", "mpp48";
211 marvell,function = "gpio";
212 };
213
214 gpio_leds_pins: gpio-leds-pins {
215 marvell,pins = "mpp18", "mpp20", "mpp51";
216 marvell,function = "gpio";
217 };
218
219 gpio_fan_pins: gpio-fan-pins {
220 marvell,pins = "mpp25", "mpp50";
221 marvell,function = "gpio";
222 };
223
224 sata_power_pins: sata-power-pins {
225 marvell,pins = "mpp52";
226 marvell,function = "gpio";
227 };
228
229 uart1_pins_alt: uart-pins-1-alt {
230 marvell,pins = "mpp45", "mpp46";
231 marvell,function = "ua1";
232 };
233 };
234
235 &spi1 {
236 pinctrl-names = "default";
237 pinctrl-0 = <&spi1_pins>;
238 status = "okay";
239
240 flash@0 {
241 compatible = "jedec,spi-nor";
242 reg = <0>;
243 spi-max-frequency = <40000000>;
244
245 partitions {
246 compatible = "fixed-partitions";
247 #address-cells = <1>;
248 #size-cells = <1>;
249
250 partition@0 {
251 reg = <0x00000000 0x00100000>;
252 label = "u-boot";
253 read-only;
254
255 compatible = "nvmem-cells";
256 #address-cells = <1>;
257 #size-cells = <1>;
258
259 macaddr_uboot_fffa8: macaddr@fffa8 {
260 reg = <0xfffa8 0x6>;
261 };
262 };
263
264 partition@100000 {
265 reg = <0x00100000 0x03ec0000>;
266 label = "firmware";
267
268 compatible = "fixed-partitions";
269 #address-cells = <1>;
270 #size-cells = <1>;
271
272 partition@0 {
273 reg = <0x00000000 0x00600000>;
274 label = "kernel";
275 };
276
277 partition@600000 {
278 reg = <0x00600000 0x038c0000>;
279 label = "rootfs";
280 };
281 };
282
283 partition@3fc0000 {
284 reg = <0x03fc0000 0x00040000>;
285 label = "config";
286 read-only;
287 };
288 };
289 };
290 };
291
292 &uart0 {
293 pinctrl-names = "default";
294 pinctrl-0 = <&uart0_pins>;
295 status = "okay";
296 };
297
298 &uart1 {
299 pinctrl-names = "default";
300 pinctrl-0 = <&uart1_pins_alt>;
301 status = "okay";
302 };
303
304 &usb3_0 {
305 status = "okay";
306 #address-cells = <1>;
307 #size-cells = <0>;
308
309 usb3_0_port1: port@1 {
310 reg = <1>;
311 #trigger-source-cells = <0>;
312 };
313
314 usb3_0_port2: port@2 {
315 reg = <2>;
316 #trigger-source-cells = <0>;
317 };
318 };