ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_keenetic_kn-3010.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 #include "mt7621.dtsi"
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/leds/common.h>
7
8 / {
9 compatible = "keenetic,kn-3010", "mediatek,mt7621-soc";
10 model = "Keenetic KN-3010";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_power: power {
28 function = LED_FUNCTION_POWER;
29 color = <LED_COLOR_ID_GREEN>;
30 gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
31 };
32
33 internet {
34 label = "green:internet";
35 gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
36 };
37
38 wifi2 {
39 label = "green:wifi2";
40 gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
41 linux,default-trigger = "phy0tpt";
42 };
43
44 wifi5 {
45 label = "green:wifi5";
46 gpios = <&gpio 48 GPIO_ACTIVE_LOW>;
47 linux,default-trigger = "phy1tpt";
48 };
49 };
50
51 keys {
52 compatible = "gpio-keys";
53
54 fn {
55 label = "fn";
56 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
57 linux,code = <BTN_0>;
58 };
59
60 reset {
61 label = "reset";
62 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
63 linux,code = <KEY_RESTART>;
64 };
65
66 wps {
67 label = "wps";
68 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
69 linux,code = <KEY_WPS_BUTTON>;
70 };
71 };
72
73 virtual_flash {
74 compatible = "mtd-concat";
75 devices = <&firmware1 &firmware2>;
76
77 partitions {
78 compatible = "fixed-partitions";
79 #address-cells = <1>;
80 #size-cells = <1>;
81
82 partition@0 {
83 compatible = "denx,uimage";
84 label = "firmware";
85 reg = <0x0 0x1ec0000>;
86 };
87 };
88 };
89 };
90
91 &state_default {
92 gpio {
93 groups = "uart3", "sdhci";
94 function = "gpio";
95 };
96 };
97
98 &xhci {
99 status = "disabled";
100 };
101
102 &spi0 {
103 status = "okay";
104
105 flash@0 {
106 compatible = "jedec,spi-nor";
107 reg = <0>;
108 spi-max-frequency = <31000000>;
109
110 partitions: partitions {
111 compatible = "fixed-partitions";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 partition@0 {
116 label = "u-boot";
117 reg = <0x0 0x30000>;
118 read-only;
119 };
120
121 partition@30000 {
122 label = "u-config";
123 reg = <0x30000 0x10000>;
124 read-only;
125 };
126
127 factory: partition@40000 {
128 label = "rf-eeprom";
129 reg = <0x40000 0x10000>;
130 read-only;
131
132 nvmem-layout {
133 compatible = "fixed-layout";
134 #address-cells = <1>;
135 #size-cells = <1>;
136
137 eeprom_factory_0: eeprom@0 {
138 reg = <0x0 0x400>;
139 };
140
141 eeprom_factory_400: eeprom@400 {
142 reg = <0x400 0x4da8>;
143 };
144
145 macaddr_factory_4: macaddr@4 {
146 reg = <0x4 0x6>;
147 };
148
149 macaddr_factory_28: macaddr@28 {
150 reg = <0x28 0x6>;
151 };
152 };
153 };
154
155 firmware1: partition@50000 {
156 label = "firmware_1";
157 reg = <0x50000 0xf60000>;
158 };
159
160 partition@fb0000 {
161 label = "config_1";
162 reg = <0xfb0000 0x40000>;
163 read-only;
164 };
165
166 partition@ff0000 {
167 label = "dump";
168 reg = <0xff0000 0x10000>;
169 read-only;
170 };
171
172 partition@1000000 {
173 label = "u-state";
174 reg = <0x1000000 0x30000>;
175 read-only;
176 };
177
178 partition@1030000 {
179 label = "u-config_res";
180 reg = <0x1030000 0x10000>;
181 read-only;
182 };
183
184 partition@1040000 {
185 label = "rf-eeprom_res";
186 reg = <0x1040000 0x10000>;
187 read-only;
188 };
189
190 firmware2: partition@1050000 {
191 label = "firmware_2";
192 reg = <0x1050000 0xf60000>;
193 };
194
195 partition@1fb0000 {
196 label = "config_2";
197 reg = <0x1fb0000 0x40000>;
198 read-only;
199 };
200 };
201 };
202 };
203
204 &mdio {
205 ethphy0: ethernet-phy@0 {
206 reg = <0>;
207 };
208 };
209
210 &gmac0 {
211 nvmem-cells = <&macaddr_factory_4>;
212 nvmem-cell-names = "mac-address";
213 };
214
215 &gmac1 {
216 status = "okay";
217 label = "wan";
218 phy-handle = <&ethphy0>;
219
220 nvmem-cells = <&macaddr_factory_28>;
221 nvmem-cell-names = "mac-address";
222 };
223
224 &switch0 {
225 ports {
226 port@1 {
227 status = "okay";
228 label = "lan1";
229 };
230
231 port@2 {
232 status = "okay";
233 label = "lan2";
234 };
235
236 port@3 {
237 status = "okay";
238 label = "lan3";
239 };
240
241 port@4 {
242 status = "okay";
243 label = "lan4";
244 };
245 };
246 };
247
248 &pcie {
249 status = "okay";
250 };
251
252 &pcie0 {
253 wifi@0,0 {
254 compatible = "mediatek,mt76";
255 reg = <0x0000 0 0 0 0>;
256 nvmem-cells = <&eeprom_factory_0>;
257 nvmem-cell-names = "eeprom";
258 ieee80211-freq-limit = <2400000 2500000>;
259 };
260 };
261
262 &pcie1 {
263 wifi@0,0 {
264 compatible = "mediatek,mt76";
265 reg = <0x0000 0 0 0 0>;
266 nvmem-cells = <&eeprom_factory_400>;
267 nvmem-cell-names = "eeprom";
268 ieee80211-freq-limit = <5000000 6000000>;
269 };
270 };