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