ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_wavlink_wl-wn578a2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/leds/common.h>
7 #include <dt-bindings/gpio/gpio.h>
8
9 / {
10 compatible = "wavlink,wl-wn578a2", "mediatek,mt7628an-soc";
11 model = "Wavlink WL-WN578A2";
12
13 aliases {
14 led-boot = &led_wps;
15 led-failsafe = &led_wps;
16 led-running = &led_wps;
17 led-upgrade = &led_wps;
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 reset {
24 label = "reset";
25 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_RESTART>;
27 };
28
29 wps {
30 label = "wps";
31 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_WPS_BUTTON>;
33 };
34
35 ap {
36 label = "ap";
37 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
38 linux,code = <BTN_0>;
39 linux,input-type = <EV_SW>;
40 };
41
42 repeater {
43 label = "repeater";
44 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
45 linux,code = <BTN_1>;
46 linux,input-type = <EV_SW>;
47 };
48 };
49
50 leds {
51 compatible = "gpio-leds";
52
53 wifi-high {
54 label = "green:wifi-high";
55 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
56 };
57
58 wifi-med {
59 label = "green:wifi-med";
60 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
61 };
62
63 wifi-low {
64 label = "green:wifi-low";
65 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
66 };
67
68 lan {
69 function = LED_FUNCTION_LAN;
70 color = <LED_COLOR_ID_GREEN>;
71 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
72 };
73
74 wan {
75 function = LED_FUNCTION_WAN;
76 color = <LED_COLOR_ID_GREEN>;
77 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
78 };
79
80 led_wps: wps {
81 function = LED_FUNCTION_WPS;
82 color = <LED_COLOR_ID_GREEN>;
83 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
84 };
85 };
86 };
87
88 &state_default {
89 gpio {
90 groups = "i2c", "wdt", "wled_an", "p0led_an", "p1led_an",
91 "p2led_an", "p3led_an", "p4led_an", "refclk", "gpio";
92 function = "gpio";
93 };
94 };
95
96 &pcie {
97 status = "okay";
98 };
99
100 &pcie0 {
101 wifi@0,0 {
102 reg = <0x0000 0 0 0 0>;
103 nvmem-cells = <&eeprom_factory_8000>;
104 nvmem-cell-names = "eeprom";
105 ieee80211-freq-limit = <5000000 6000000>;
106 };
107 };
108
109 &spi0 {
110 status = "okay";
111
112 flash@0 {
113 compatible = "jedec,spi-nor";
114 reg = <0>;
115 spi-max-frequency = <40000000>;
116
117 partitions {
118 compatible = "fixed-partitions";
119 #address-cells = <1>;
120 #size-cells = <1>;
121
122 partition@0 {
123 label = "u-boot";
124 reg = <0x0 0x30000>;
125 read-only;
126 };
127
128 partition@30000 {
129 label = "u-boot-env";
130 reg = <0x30000 0x10000>;
131 read-only;
132 };
133
134 factory: partition@40000 {
135 label = "factory";
136 reg = <0x40000 0x10000>;
137 read-only;
138
139 nvmem-layout {
140 compatible = "fixed-layout";
141 #address-cells = <1>;
142 #size-cells = <1>;
143
144 eeprom_factory_0: eeprom@0 {
145 reg = <0x0 0x400>;
146 };
147
148 eeprom_factory_8000: eeprom@8000 {
149 reg = <0x8000 0x200>;
150 };
151
152 macaddr_factory_28: macaddr@28 {
153 reg = <0x28 0x6>;
154 };
155 };
156 };
157
158 partition@50000 {
159 compatible = "denx,uimage";
160 label = "firmware";
161 reg = <0x50000 0x7b0000>;
162 };
163 };
164 };
165 };
166
167 &wmac {
168 status = "okay";
169
170 nvmem-cells = <&eeprom_factory_0>;
171 nvmem-cell-names = "eeprom";
172 };
173
174 &ethernet {
175 nvmem-cells = <&macaddr_factory_28>;
176 nvmem-cell-names = "mac-address";
177 };
178
179 &esw {
180 mediatek,portmap = <0x2f>;
181 };
182
183 &usbphy {
184 status = "disabled";
185 };
186
187 &ehci {
188 status = "disabled";
189 };
190
191 &ohci {
192 status = "disabled";
193 };