mediatek: convert to new LED color/function format where possible
[openwrt/staging/mans0n.git] / target / linux / mediatek / dts / mt7981b-cmcc-rax3000m.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /*
3 * Copyright (C) 2023 Tianling Shen <cnsztl@immortalwrt.org>
4 */
5
6 /dts-v1/;
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/input/input.h>
9 #include <dt-bindings/leds/common.h>
10
11 #include "mt7981.dtsi"
12
13 / {
14 model = "CMCC RAX3000M";
15 compatible = "cmcc,rax3000m", "mediatek,mt7981";
16
17 aliases {
18 led-boot = &red_led;
19 led-failsafe = &red_led;
20 led-running = &green_led;
21 led-upgrade = &green_led;
22 serial0 = &uart0;
23 };
24
25 chosen {
26 stdout-path = "serial0:115200n8";
27 };
28
29 memory {
30 reg = <0 0x40000000 0 0x20000000>;
31 };
32
33 gpio-keys {
34 compatible = "gpio-keys";
35
36 button-reset {
37 label = "reset";
38 linux,code = <KEY_RESTART>;
39 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
40 };
41
42 button-mesh {
43 label = "mesh";
44 linux,code = <BTN_9>;
45 linux,input-type = <EV_SW>;
46 gpios = <&pio 0 GPIO_ACTIVE_LOW>;
47 };
48 };
49
50 gpio-leds {
51 compatible = "gpio-leds";
52
53 green_led: led-0 {
54 function = LED_FUNCTION_STATUS;
55 color = <LED_COLOR_ID_GREEN>;
56 gpios = <&pio 9 GPIO_ACTIVE_LOW>;
57 };
58
59 led-1 {
60 function = LED_FUNCTION_STATUS;
61 color = <LED_COLOR_ID_BLUE>;
62 gpios = <&pio 12 GPIO_ACTIVE_LOW>;
63 };
64
65 red_led: led-2 {
66 function = LED_FUNCTION_STATUS;
67 color = <LED_COLOR_ID_RED>;
68 gpios = <&pio 35 GPIO_ACTIVE_LOW>;
69 };
70 };
71 };
72
73 &eth {
74 status = "okay";
75
76 gmac0: mac@0 {
77 compatible = "mediatek,eth-mac";
78 reg = <0>;
79 phy-mode = "2500base-x";
80
81 fixed-link {
82 speed = <2500>;
83 full-duplex;
84 pause;
85 };
86 };
87
88 gmac1: mac@1 {
89 compatible = "mediatek,eth-mac";
90 reg = <1>;
91 phy-mode = "gmii";
92 phy-handle = <&int_gbe_phy>;
93 };
94 };
95
96 &mdio_bus {
97 switch: switch@1f {
98 compatible = "mediatek,mt7531";
99 reg = <31>;
100 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
101 interrupt-controller;
102 #interrupt-cells = <1>;
103 interrupt-parent = <&pio>;
104 interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
105 };
106 };
107
108 &switch {
109 ports {
110 #address-cells = <1>;
111 #size-cells = <0>;
112
113 port@0 {
114 reg = <0>;
115 label = "lan3";
116 };
117
118 port@1 {
119 reg = <1>;
120 label = "lan2";
121 };
122
123 port@2 {
124 reg = <2>;
125 label = "lan1";
126 };
127
128 port@6 {
129 reg = <6>;
130 ethernet = <&gmac0>;
131 phy-mode = "2500base-x";
132
133 fixed-link {
134 speed = <2500>;
135 full-duplex;
136 pause;
137 };
138 };
139 };
140 };
141
142 &uart0 {
143 status = "okay";
144 };
145
146 &usb_phy {
147 status = "okay";
148 };
149
150 &watchdog {
151 status = "okay";
152 };
153
154 &wifi {
155 status = "okay";
156 };
157
158 &xhci {
159 status = "okay";
160 };