ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_re650-v2.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,re650-v2", "mediatek,mt7621-soc";
11 model = "TP-Link RE650 v2";
12
13 aliases {
14 label-mac-device = &gmac0;
15 led-boot = &led_power;
16 led-failsafe = &led_power;
17 led-running = &led_power;
18 led-upgrade = &led_power;
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 wps {
25 label = "wps";
26 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
27 debounce-interval = <60>;
28 linux,code = <KEY_WPS_BUTTON>;
29 };
30
31 power {
32 label = "power";
33 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
34 debounce-interval = <60>;
35 linux,code = <KEY_POWER>;
36 };
37
38 led {
39 label = "led";
40 gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
41 debounce-interval = <60>;
42 linux,code = <KEY_LIGHTS_TOGGLE>;
43 };
44
45 reset {
46 label = "reset";
47 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
48 debounce-interval = <60>;
49 linux,code = <KEY_RESTART>;
50 };
51 };
52
53 leds {
54 compatible = "gpio-leds";
55
56 led_power: power {
57 function = LED_FUNCTION_POWER;
58 color = <LED_COLOR_ID_BLUE>;
59 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
60 };
61
62 wifi2g {
63 label = "blue:wifi2g";
64 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
65 linux,default-trigger = "phy0tpt";
66 };
67
68 wifi5g {
69 label = "blue:wifi5g";
70 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
71 linux,default-trigger = "phy1tpt";
72 };
73
74 wps_red {
75 function = LED_FUNCTION_WPS;
76 color = <LED_COLOR_ID_RED>;
77 gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
78 };
79
80 wps_blue {
81 function = LED_FUNCTION_WPS;
82 color = <LED_COLOR_ID_BLUE>;
83 gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
84 };
85
86 eth_act {
87 label = "green:eth_act";
88 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
89 };
90
91 eth_link {
92 label = "green:eth_link";
93 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
94 };
95 };
96 };
97
98 &spi0 {
99 status = "okay";
100
101 flash@0 {
102 compatible = "jedec,spi-nor";
103 reg = <0>;
104 spi-max-frequency = <40000000>;
105
106 partitions {
107 compatible = "fixed-partitions";
108 #address-cells = <1>;
109 #size-cells = <1>;
110
111 partition@0 {
112 label = "u-boot";
113 reg = <0x0 0x20000>;
114 read-only;
115 };
116
117 partition@20000 {
118 compatible = "tplink,firmware";
119 label = "firmware";
120 reg = <0x20000 0x7a0000>;
121 };
122
123 config: partition@7c0000 {
124 label = "config";
125 reg = <0x7c0000 0x2d440>;
126 read-only;
127
128 nvmem-layout {
129 compatible = "fixed-layout";
130 #address-cells = <1>;
131 #size-cells = <1>;
132
133 macaddr_config_10008: macaddr@10008 {
134 compatible = "mac-base";
135 reg = <0x10008 0x6>;
136 #nvmem-cell-cells = <1>;
137 };
138 };
139 };
140
141 radio: partition@7f0000 {
142 label = "radio";
143 reg = <0x7f0000 0x10000>;
144 read-only;
145
146 nvmem-layout {
147 compatible = "fixed-layout";
148 #address-cells = <1>;
149 #size-cells = <1>;
150
151 eeprom_radio_0: eeprom@0 {
152 reg = <0x0 0x4da8>;
153 };
154
155 eeprom_radio_8000: eeprom@8000 {
156 reg = <0x8000 0x4da8>;
157 };
158 };
159 };
160 };
161 };
162 };
163
164 &state_default {
165 gpio {
166 groups = "rgmii2", "wdt";
167 function = "gpio";
168 };
169 };
170
171 &pcie {
172 status = "okay";
173 };
174
175 &pcie1 {
176 wifi@0,0 {
177 compatible = "mediatek,mt76";
178 reg = <0x0000 0 0 0 0>;
179 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>;
180 nvmem-cell-names = "eeprom", "mac-address";
181 ieee80211-freq-limit = <2400000 2500000>;
182 };
183 };
184
185 &pcie0 {
186 wifi@0,0 {
187 compatible = "mediatek,mt76";
188 reg = <0x0000 0 0 0 0>;
189 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>;
190 nvmem-cell-names = "eeprom", "mac-address";
191 ieee80211-freq-limit = <5000000 6000000>;
192 };
193 };
194
195 &ethernet {
196 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
197 };
198
199 &gmac0 {
200 nvmem-cells = <&macaddr_config_10008 0>;
201 nvmem-cell-names = "mac-address";
202 };
203
204 &switch0 {
205 ports {
206 port@0 {
207 status = "okay";
208 label = "lan";
209 };
210 };
211 };