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