mvebu: fix LEDs on Fortinet FortiGate devices
[openwrt/staging/stintel.git] / target / linux / mvebu / files-6.6 / arch / arm / boot / dts / marvell / armada-385-fortinet-fg-x0e.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 /dts-v1/;
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8 #include "armada-385.dtsi"
9
10 / {
11 aliases {
12 led-boot = &led_status_green;
13 led-failsafe = &led_status_red;
14 led-running = &led_status_green;
15 led-upgrade = &led_status_green;
16 label-mac-device = &eth0;
17 };
18
19 chosen {
20 stdout-path = "serial0:9600n8";
21 };
22
23 soc {
24 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
25 MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
26 MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
27 MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
28 MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
29 };
30
31 gpio-keys {
32 compatible = "gpio-keys";
33 pinctrl-names = "default";
34 pinctrl-0 = <&pmx_gpio_keys_pins>;
35
36 reset {
37 label = "reset";
38 linux,code = <KEY_RESTART>;
39 gpios = <&gpio1 22 GPIO_ACTIVE_LOW>;
40 };
41 };
42
43 gpio_leds: gpio-leds {
44 compatible = "gpio-leds";
45 pinctrl-names = "default";
46 pinctrl-0 = <&pmx_gpio_leds_pins>;
47
48 led-0 {
49 gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
50 color = <LED_COLOR_ID_RED>;
51 function = LED_FUNCTION_ALARM;
52 };
53
54 led-1 {
55 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
56 color = <LED_COLOR_ID_RED>;
57 function = "ha";
58 };
59
60 led_status_green: led-2 {
61 gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
62 color = <LED_COLOR_ID_GREEN>;
63 function = LED_FUNCTION_STATUS;
64 };
65
66 led-3 {
67 gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
68 color = <LED_COLOR_ID_GREEN>;
69 function = "ha";
70 };
71
72 led-4 {
73 gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
74 color = <LED_COLOR_ID_AMBER>;
75 function = LED_FUNCTION_ALARM;
76 };
77
78 led_status_red: led-5 {
79 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
80 color = <LED_COLOR_ID_RED>;
81 function = LED_FUNCTION_STATUS;
82 };
83
84 led-6 {
85 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
86 color = <LED_COLOR_ID_GREEN>;
87 function = LED_FUNCTION_SPEED_LAN;
88 function-enumerator = <4>;
89 linux,default-trigger = "mv88e6xxx-1:01:1Gbps";
90 };
91
92 led-7 {
93 gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
94 color = <LED_COLOR_ID_AMBER>;
95 function = LED_FUNCTION_SPEED_LAN;
96 function-enumerator = <4>;
97 linux,default-trigger = "mv88e6xxx-1:01:100Mbps";
98 };
99
100 led-8 {
101 gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
102 color = <LED_COLOR_ID_AMBER>;
103 function = LED_FUNCTION_SPEED_LAN;
104 function-enumerator = <3>;
105 linux,default-trigger = "mv88e6xxx-1:02:100Mbps";
106 };
107
108 led-9 {
109 gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
110 color = <LED_COLOR_ID_GREEN>;
111 function = LED_FUNCTION_SPEED_LAN;
112 function-enumerator = <3>;
113 linux,default-trigger = "mv88e6xxx-1:02:1Gbps";
114 };
115
116 led-10 {
117 gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
118 color = <LED_COLOR_ID_GREEN>;
119 function = LED_FUNCTION_SPEED_LAN;
120 function-enumerator = <1>;
121 linux,default-trigger = "mv88e6xxx-1:04:1Gbps";
122 };
123
124 led-11 {
125 gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
126 color = <LED_COLOR_ID_AMBER>;
127 function = LED_FUNCTION_SPEED_LAN;
128 function-enumerator = <1>;
129 linux,default-trigger = "mv88e6xxx-1:04:100Mbps";
130 };
131
132 led-12 {
133 gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
134 color = <LED_COLOR_ID_GREEN>;
135 function = LED_FUNCTION_SPEED_LAN;
136 function-enumerator = <2>;
137 linux,default-trigger = "mv88e6xxx-1:03:1Gbps";
138 };
139
140 led-13 {
141 gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
142 color = <LED_COLOR_ID_AMBER>;
143 function = LED_FUNCTION_SPEED_LAN;
144 function-enumerator = <2>;
145 linux,default-trigger = "mv88e6xxx-1:03:100Mbps";
146 };
147 };
148
149 reg_usb_vbus: regulator-usb-vbus {
150 compatible = "fixed-regulator";
151 regulator-name = "usb-vbus";
152 regulator-min-microvolt = <5000000>;
153 regulator-max-microvolt = <5000000>;
154 gpio = <&gpio1 21 GPIO_ACTIVE_LOW>;
155 regulator-always-on;
156 };
157 };
158
159 &i2c0 {
160 pinctrl-names = "default";
161 pinctrl-0 = <&i2c0_pins>;
162 status = "okay";
163
164 gpio2: gpio@24 {
165 compatible = "nxp,pca9555";
166 reg = <0x24>;
167 gpio-controller;
168 #gpio-cells = <0x2>;
169 };
170
171 hwmon@28 {
172 compatible = "nuvoton,nct7802";
173 reg = <0x28>;
174 };
175 };
176
177 &uart0 {
178 pinctrl-names = "default";
179 pinctrl-0 = <&uart0_pins>;
180 status = "okay";
181 };
182
183 &pinctrl {
184 pmx_gpio_leds_pins: gpio-leds-pins {
185 marvell,pins = "mpp30", "mpp32", "mpp33", "mpp35",
186 "mpp45", "mpp47";
187 marvell,function = "gpio";
188 };
189
190 pmx_usb_pins: usb-pins {
191 marvell,pins = "mpp53";
192 marvell,function = "gpio";
193 };
194
195 pmx_gpio_keys_pins: gpio-keys-pins {
196 marvell,pins = "mpp54";
197 marvell,function = "gpio";
198 };
199 };
200
201 &bm {
202 status = "okay";
203 };
204
205 &bm_bppi {
206 status = "okay";
207 };
208
209 &eth0 {
210 pinctrl-names = "default";
211 pinctrl-0 = <&ge0_rgmii_pins>;
212 status = "okay";
213
214 phy-connection-type = "rgmii-id";
215 buffer-manager = <&bm>;
216 bm,pool-long = <0>;
217 bm,pool-short = <1>;
218 nvmem-cells = <&macaddr_bdinfo_d880 0>;
219 nvmem-cell-names = "mac-address";
220
221 fixed-link {
222 speed = <1000>;
223 full-duplex;
224 };
225 };
226
227 &usb3_0 {
228 pinctrl-names = "default";
229 pinctrl-0 = <&pmx_usb_pins>;
230 status = "okay";
231
232 vbus-supply = <&reg_usb_vbus>;
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 = <50000000>;
244
245 partitions {
246 compatible = "fixed-partitions";
247 #address-cells = <1>;
248 #size-cells = <1>;
249
250 partition@0 {
251 reg = <0x0 0x1c0000>;
252 label = "u-boot";
253 read-only;
254 };
255
256 partition@1c0000 {
257 reg = <0x1c0000 0x10000>;
258 label = "firmware-info";
259
260 /*
261 * 0x10 - 0x2f : image name (image1)
262 * 0x30 - 0x4f : image name (image2)
263 * 0x170 (1byte): active image (0x0/0x1)
264 * 0x184 - 0x185: kernel block count (image1)
265 * 0x18c - 0x18d: rootfs block count (image1)
266 * 0x194 - 0x195: kernel block count (image2)
267 * 0x19c - 0x19d: rootfs block count (image2)
268 * 0x1be (1byte): bit7 -> active flag (image1)?
269 * 0x1ce (1byte): bit7 -> active flag (image2)?
270 *
271 * Note: block size --> 0x200 (512 bytes)
272 */
273 };
274
275 partition@1d0000 {
276 reg = <0x1d0000 0x10000>;
277 label = "dtb";
278 read-only;
279 };
280
281 partition@1e0000 {
282 reg = <0x1e0000 0x10000>;
283 label = "u-boot-env";
284 read-only;
285 };
286
287 partition@1f0000 {
288 reg = <0x1f0000 0x10000>;
289 label = "board-info";
290 read-only;
291
292 nvmem-layout {
293 compatible = "fixed-layout";
294 #address-cells = <1>;
295 #size-cells = <1>;
296
297 macaddr_bdinfo_d880: macaddr@d880 {
298 compatible = "mac-base";
299 reg = <0xd880 0x6>;
300 #nvmem-cell-cells = <1>;
301 };
302 };
303 };
304
305 partition@200000 {
306 reg = <0x200000 0x600000>;
307 label = "kernel";
308 };
309
310 partition@800000 {
311 reg = <0x800000 0x1800000>;
312 label = "rootfs";
313 };
314
315 partition@2000000 {
316 reg = <0x2000000 0x600000>;
317 label = "kn2";
318 read-only;
319 };
320
321 partition@2600000 {
322 reg = <0x2600000 0x1800000>;
323 label = "rfs2";
324 read-only;
325 };
326
327 partition@3e00000 {
328 reg = <0x3e00000 0x1200000>;
329 label = "part1";
330 read-only;
331 };
332
333 partition@5000000 {
334 reg = <0x5000000 0x1200000>;
335 label = "part2";
336 read-only;
337 };
338
339 partition@6200000 {
340 reg = <0x6200000 0x1e00000>;
341 label = "config";
342 read-only;
343 };
344 };
345 };
346 };