ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_archer-ax23-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "tplink,archer-ax23-v1", "mediatek,mt7621-soc";
11 model = "TP-Link Archer AX23 v1";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33
34 wps {
35 label = "rfkill";
36 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RFKILL>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led_power: power {
45 function = LED_FUNCTION_POWER;
46 color = <LED_COLOR_ID_GREEN>;
47 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
48 };
49
50 wifi2g {
51 label = "green:wifi2g";
52 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
53 linux,default-trigger = "phy0tpt";
54 };
55
56 wifi5g {
57 label = "green:wifi5g";
58 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
59 linux,default-trigger = "phy1tpt";
60 };
61
62 wan-green {
63 function = LED_FUNCTION_WAN;
64 color = <LED_COLOR_ID_GREEN>;
65 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
66 };
67
68 wan-orange {
69 function = LED_FUNCTION_WAN;
70 color = <LED_COLOR_ID_ORANGE>;
71 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
72 };
73
74 lan {
75 function = LED_FUNCTION_LAN;
76 color = <LED_COLOR_ID_GREEN>;
77 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
78 };
79
80 wps {
81 function = LED_FUNCTION_WPS;
82 color = <LED_COLOR_ID_GREEN>;
83 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
84 };
85 };
86 };
87
88 &spi0 {
89 status = "okay";
90
91 flash@0 {
92 compatible = "jedec,spi-nor";
93 reg = <0>;
94 spi-max-frequency = <25000000>;
95
96 partitions {
97 compatible = "fixed-partitions";
98 #address-cells = <1>;
99 #size-cells = <1>;
100
101 partition@0 {
102 label = "u-boot";
103 reg = <0x000000 0x040000>;
104 read-only;
105 };
106
107 partition@40000 {
108 compatible = "denx,uimage";
109 label = "firmware";
110 reg = <0x040000 0xf60000>;
111 };
112
113 config: partition@fa0000 {
114 label = "config";
115 reg = <0xfa0000 0x010000>;
116 read-only;
117
118 nvmem-layout {
119 compatible = "fixed-layout";
120 #address-cells = <1>;
121 #size-cells = <1>;
122
123 macaddr_config_8: macaddr@8 {
124 compatible = "mac-base";
125 reg = <0x8 0x6>;
126 #nvmem-cell-cells = <1>;
127 };
128 };
129 };
130
131 partition@fb0000 {
132 label = "tplink";
133 reg = <0xfb0000 0x040000>;
134 read-only;
135 };
136
137 radio: partition@ff0000 {
138 label = "radio";
139 reg = <0xff0000 0x010000>;
140 read-only;
141
142 nvmem-layout {
143 compatible = "fixed-layout";
144 #address-cells = <1>;
145 #size-cells = <1>;
146
147 eeprom_radio_0: eeprom@0 {
148 reg = <0x0 0xe00>;
149 };
150 };
151 };
152 };
153 };
154 };
155
156 &pcie {
157 status = "okay";
158 };
159
160 &pcie1 {
161 wifi@0,0 {
162 compatible = "mediatek,mt76";
163 reg = <0x0000 0 0 0 0>;
164 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8 0>;
165 nvmem-cell-names = "eeprom", "mac-address";
166 mediatek,disable-radar-background;
167 };
168 };
169
170 &gmac0 {
171 nvmem-cells = <&macaddr_config_8 0>;
172 nvmem-cell-names = "mac-address";
173 };
174
175 &gmac1 {
176 status = "okay";
177 label = "wan";
178 phy-handle = <&ethphy4>;
179
180 nvmem-cells = <&macaddr_config_8 1>;
181 nvmem-cell-names = "mac-address";
182 };
183
184 &mdio {
185 ethphy4: ethernet-phy@4 {
186 reg = <4>;
187 };
188 };
189
190 &switch0 {
191 ports {
192 port@0 {
193 status = "okay";
194 label = "lan1";
195 };
196
197 port@1 {
198 status = "okay";
199 label = "lan2";
200 };
201
202 port@2 {
203 status = "okay";
204 label = "lan3";
205 };
206
207 port@3 {
208 status = "okay";
209 label = "lan4";
210 };
211 };
212 };
213
214 &state_default {
215 gpio {
216 groups = "i2c", "uart3", "jtag", "wdt";
217 function = "gpio";
218 };
219 };