ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_tplink_re365-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.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 model = "TP-Link RE365 v1";
11 compatible = "tplink,re365-v1", "mediatek,mt7628an-soc";
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 = &ethernet;
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 button-led {
25 label = "led";
26 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_LIGHTS_TOGGLE>;
28 };
29
30 button-power {
31 label = "power";
32 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_POWER>;
34 };
35
36 button-reset {
37 label = "reset";
38 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
39 linux,code = <KEY_RESTART>;
40 };
41
42 button-wps {
43 label = "wps";
44 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
45 linux,code = <KEY_WPS_BUTTON>;
46 };
47 };
48
49 leds {
50 compatible = "gpio-leds";
51
52 led-lan {
53 color = <LED_COLOR_ID_BLUE>;
54 function = LED_FUNCTION_LAN;
55 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
56 };
57
58 led_power: led-power {
59 color = <LED_COLOR_ID_BLUE>;
60 function = LED_FUNCTION_POWER;
61 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
62 panic-indicator;
63 };
64
65 led-rssi-bad {
66 color = <LED_COLOR_ID_RED>;
67 function = LED_FUNCTION_INDICATOR;
68 gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
69 };
70
71 led-rssi-good {
72 color = <LED_COLOR_ID_BLUE>;
73 function = LED_FUNCTION_INDICATOR;
74 gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
75 };
76
77 led-wlan2g {
78 color = <LED_COLOR_ID_BLUE>;
79 function = LED_FUNCTION_WLAN;
80 function-enumerator = <2>;
81 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
82 linux,default-trigger = "phy0tpt";
83 };
84
85 led-wlan5g {
86 color = <LED_COLOR_ID_BLUE>;
87 function = LED_FUNCTION_WLAN;
88 function-enumerator = <5>;
89 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
90 linux,default-trigger = "phy1tpt";
91 };
92 };
93
94 virtual_flash {
95 compatible = "mtd-concat";
96 devices = <&fwconcat0>, <&fwconcat1>;
97
98 partitions {
99 compatible = "fixed-partitions";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 partition@0 {
104 compatible = "tplink,firmware";
105 label = "firmware";
106 reg = <0x0 0x0>;
107 };
108 };
109 };
110 };
111
112 &ethernet {
113 nvmem-cells = <&macaddr_config_10008 0>;
114 nvmem-cell-names = "mac-address";
115 };
116
117 &pcie {
118 status = "okay";
119 };
120
121 &pcie0 {
122 mt76@0,0 {
123 compatible = "mediatek,mt76";
124 reg = <0x0000 0 0 0 0>;
125 ieee80211-freq-limit = <5000000 6000000>;
126 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>;
127 nvmem-cell-names = "eeprom", "mac-address";
128 };
129 };
130
131 &spi0 {
132 status = "okay";
133
134 flash@0 {
135 compatible = "jedec,spi-nor";
136 reg = <0>;
137 spi-max-frequency = <10000000>;
138
139 partitions {
140 compatible = "fixed-partitions";
141 #address-cells = <1>;
142 #size-cells = <1>;
143
144 partition@0 {
145 label = "u-boot";
146 reg = <0x0 0x20000>;
147 read-only;
148 };
149
150 fwconcat0: partition@20000 {
151 label = "fwconcat0";
152 reg = <0x20000 0x5e0000>;
153 };
154
155 partition@600000 {
156 label = "config";
157 reg = <0x600000 0x50000>;
158 read-only;
159
160 nvmem-layout {
161 compatible = "fixed-layout";
162 #address-cells = <1>;
163 #size-cells = <1>;
164
165 macaddr_config_10008: macaddr@10008 {
166 compatible = "mac-base";
167 reg = <0x10008 0x6>;
168 #nvmem-cell-cells = <1>;
169 };
170 };
171 };
172
173 fwconcat1: partition@650000 {
174 label = "fwconcat1";
175 reg = <0x650000 0x1a0000>;
176 };
177
178 partition@7f0000 {
179 label = "radio";
180 reg = <0x7f0000 0x10000>;
181 read-only;
182
183 nvmem-layout {
184 compatible = "fixed-layout";
185 #address-cells = <1>;
186 #size-cells = <1>;
187
188 eeprom_radio_0: eeprom@0 {
189 reg = <0x0 0x400>;
190 };
191
192 eeprom_radio_8000: eeprom@8000 {
193 reg = <0x8000 0x200>;
194 };
195 };
196 };
197 };
198 };
199 };
200
201 &state_default {
202 gpio {
203 groups = "refclk", "wdt", "p0led_an", "p1led_an", "p2led_an", "p3led_an",
204 "p4led_an";
205 function = "gpio";
206 };
207 };
208
209 &wmac {
210 status = "okay";
211
212 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>;
213 nvmem-cell-names = "eeprom", "mac-address";
214 };