ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_tozed_zlt-s12-pro.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 = "tozed,zlt-s12-pro", "mediatek,mt7621-soc";
11 model = "TOZED ZLT S12 PRO";
12
13 aliases {
14 led-boot = &led_power_blue;
15 led-failsafe = &led_power_yellow;
16 led-running = &led_power_blue;
17 led-upgrade = &led_power_blue;
18 label-mac-device = &wifi1;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 led-modem-blue {
29 label = "blue:modem";
30 gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
31 };
32
33 led-modem-red {
34 label = "red:modem";
35 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
36 };
37
38 led_power_blue: led-power-blue {
39 function = LED_FUNCTION_POWER;
40 color = <LED_COLOR_ID_BLUE>;
41 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
42 };
43
44 led_power_yellow: led-power-yellow {
45 function = LED_FUNCTION_POWER;
46 color = <LED_COLOR_ID_YELLOW>;
47 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
48 };
49
50 led-wifi {
51 label = "blue:wifi";
52 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
53 linux,default-trigger = "phy0tpt";
54 };
55
56 led-signal1 {
57 label = "blue:signal1";
58 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
59 };
60
61 led-signal2 {
62 label = "blue:signal2";
63 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
64 };
65
66 led-signal3 {
67 label = "blue:signal3";
68 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
69 };
70
71 led-signal4 {
72 label = "blue:signal4";
73 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
74 };
75
76 led-signal5 {
77 label = "blue:signal5";
78 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
79 };
80
81 led-phone {
82 label = "blue:phone";
83 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
84 };
85 };
86
87 keys {
88 compatible = "gpio-keys";
89
90 button-reset {
91 label = "reset";
92 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
93 linux,code = <KEY_RESTART>;
94 };
95
96 button-rfkill {
97 label = "rfkill";
98 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
99 linux,code = <KEY_RFKILL>;
100 };
101
102 button-wps {
103 label = "wps";
104 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
105 linux,code = <KEY_WPS_BUTTON>;
106 };
107 };
108
109 gpio_export {
110 compatible = "gpio-export";
111
112 lt72_ant0 {
113 gpio-export,name = "lt72_ant0";
114 gpio-export,input = <0>;
115 gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
116 };
117
118 lt72_ant1 {
119 gpio-export,name = "lt72_ant1";
120 gpio-export,input = <0>;
121 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
122 };
123
124 lt72_power {
125 gpio-export,name = "lt72_power";
126 gpio-export,output = <1>;
127 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
128 };
129 };
130 };
131
132 &spi0 {
133 status = "okay";
134
135 flash@0 {
136 compatible = "jedec,spi-nor";
137 reg = <0>;
138 spi-max-frequency = <10000000>;
139
140 partitions {
141 compatible = "fixed-partitions";
142 #address-cells = <1>;
143 #size-cells = <1>;
144
145 partition@0 {
146 label = "u-boot";
147 reg = <0x0 0x30000>;
148 read-only;
149 };
150
151 partition@30000 {
152 label = "u-boot-env";
153 reg = <0x30000 0x8000>;
154 read-only;
155 };
156
157 // Stock config partition
158 partition@38000 {
159 label = "tozed-conf";
160 reg = <0x38000 0x8000>;
161 read-only;
162 };
163
164 factory: partition@40000 {
165 label = "factory";
166 reg = <0x40000 0x10000>;
167 read-only;
168
169 nvmem-layout {
170 compatible = "fixed-layout";
171 #address-cells = <1>;
172 #size-cells = <1>;
173
174 eeprom_factory_0: eeprom@0 {
175 reg = <0x0 0x400>;
176 };
177
178 eeprom_factory_8000: eeprom@8000 {
179 reg = <0x8000 0x200>;
180 };
181
182 macaddr_factory_e000: macaddr@e000 {
183 reg = <0xe000 0x6>;
184 };
185 };
186 };
187
188 partition@50000 {
189 compatible = "denx,uimage";
190 label = "firmware";
191 reg = <0x50000 0xfb0000>;
192 };
193 };
194 };
195 };
196
197 &pcie {
198 status = "okay";
199 };
200
201 &pcie0 {
202 wifi0: mt76@0,0 {
203 compatible = "mediatek,mt76";
204 reg = <0x0000 0 0 0 0>;
205 nvmem-cells = <&eeprom_factory_8000>;
206 nvmem-cell-names = "eeprom";
207 ieee80211-freq-limit = <5000000 6000000>;
208 };
209 };
210
211 &pcie1 {
212 wifi1: mt76@0,0 {
213 compatible = "mediatek,mt76";
214 reg = <0x0000 0 0 0 0>;
215 nvmem-cells = <&eeprom_factory_0>;
216 nvmem-cell-names = "eeprom";
217 ieee80211-freq-limit = <2400000 2500000>;
218 };
219 };
220
221 &ethernet {
222 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
223 };
224
225 &gmac0 {
226 nvmem-cells = <&macaddr_factory_e000>;
227 nvmem-cell-names = "mac-address";
228 };
229
230 &switch0 {
231 ports {
232 port@0 {
233 status = "okay";
234 label = "wan";
235 };
236
237 port@1 {
238 status = "okay";
239 label = "lan3";
240 };
241
242 port@2 {
243 status = "okay";
244 label = "lan2";
245 };
246
247 port@4 {
248 status = "okay";
249 label = "lan1";
250 };
251 };
252 };
253
254 &state_default {
255 gpio {
256 groups = "wdt", "rgmii2", "jtag", "uart3";
257 function = "gpio";
258 };
259 };