ramips: use DT trigger for 2G WiFi on ASUS RT-AC51U
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_alfa-network_quad-e4g.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7621.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10 compatible = "alfa-network,quad-e4g", "mediatek,mt7621-soc";
11 model = "ALFA Network Quad-E4G";
12
13 aliases {
14 label-mac-device = &gmac0;
15 led-boot = &led_system;
16 led-failsafe = &led_system;
17 led-running = &led_system;
18 led-upgrade = &led_system;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 gpio-export {
26 compatible = "gpio-export";
27 #size-cells = <0>;
28
29 m2-enable {
30 gpio-export,name = "m2-enable";
31 gpio-export,output = <1>;
32 gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
33 };
34
35 minipcie0-enable {
36 gpio-export,name = "minipcie0-enable";
37 gpio-export,output = <1>;
38 gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
39 };
40
41 minipcie0-reset {
42 gpio-export,name = "minipcie0-reset";
43 gpio-export,output = <0>;
44 gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
45 };
46
47 minipcie1-enable {
48 gpio-export,name = "minipcie1-enable";
49 gpio-export,output = <1>;
50 gpios = <&gpio 30 GPIO_ACTIVE_HIGH>;
51 };
52
53 minipcie1-reset {
54 gpio-export,name = "minipcie1-reset";
55 gpio-export,output = <0>;
56 gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
57 };
58
59 minipcie2-enable {
60 gpio-export,name = "minipcie2-enable";
61 gpio-export,output = <1>;
62 gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
63 };
64
65 minipcie2-reset {
66 gpio-export,name = "minipcie2-reset";
67 gpio-export,output = <0>;
68 gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
69 };
70
71 pcie-perst-disable {
72 gpio-export,name = "pcie-perst-enable";
73 gpio-export,output = <0>;
74 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
75 };
76
77 sim-select {
78 gpio-export,name = "sim-select";
79 gpio-export,output = <1>;
80 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
81 };
82
83 watchdog-enable {
84 gpio-export,name = "watchdog-enable";
85 gpio-export,output = <1>;
86 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
87 };
88 };
89
90 keys {
91 compatible = "gpio-keys";
92
93 reset {
94 label = "reset";
95 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
96 linux,code = <KEY_RESTART>;
97 };
98
99 user1 {
100 label = "user1";
101 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
102 linux,code = <BTN_0>;
103 };
104
105 user2 {
106 label = "user2";
107 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
108 linux,code = <BTN_1>;
109 };
110 };
111
112 leds {
113 compatible = "gpio-leds";
114
115 led_system: system {
116 label = "quad-e4g:red:system";
117 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
118 default-state = "keep";
119 };
120
121 m2 {
122 label = "quad-e4g:orange:m2";
123 gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
124 };
125
126 minipcie0 {
127 label = "quad-e4g:orange:minipcie0";
128 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
129 };
130
131 minipcie1 {
132 label = "quad-e4g:orange:minipcie1";
133 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
134 };
135
136 minipcie2 {
137 label = "quad-e4g:orange:minipcie2";
138 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
139 };
140 };
141
142 watchdog {
143 compatible = "linux,wdt-gpio";
144 gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
145 hw_algo = "toggle";
146 hw_margin_ms = <25000>;
147 always-running;
148 };
149 };
150
151 &gmac0 {
152 mtd-mac-address = <&factory 0xe000>;
153 };
154
155 &switch0 {
156 ports {
157 port@0 {
158 status = "okay";
159 label = "lan4";
160 };
161
162 port@1 {
163 status = "okay";
164 label = "lan3";
165 };
166
167 port@2 {
168 status = "okay";
169 label = "lan2";
170 };
171
172 port@3 {
173 status = "okay";
174 label = "lan1";
175 };
176
177 port@4 {
178 status = "okay";
179 label = "wan";
180 mtd-mac-address = <&factory 0xe006>;
181 };
182 };
183 };
184
185 &i2c {
186 status = "okay";
187
188 rtc@68 {
189 compatible = "ti,bq32000";
190 reg = <0x68>;
191 };
192 };
193
194 &pcie {
195 status = "okay";
196 };
197
198 &state_default {
199 gpio {
200 groups = "jtag", "rgmii2", "wdt";
201 function = "gpio";
202 };
203 };
204
205 &sdhci {
206 status = "okay";
207 };
208
209 &spi0 {
210 status = "okay";
211
212 flash@0 {
213 compatible = "jedec,spi-nor";
214 reg = <0>;
215 spi-max-frequency = <50000000>;
216 m25p,fast-read;
217
218 partitions {
219 compatible = "fixed-partitions";
220 #address-cells = <1>;
221 #size-cells = <1>;
222
223 partition@0 {
224 label = "u-boot";
225 reg = <0x0 0x30000>;
226 };
227
228 partition@30000 {
229 label = "u-boot-env";
230 reg = <0x30000 0x1000>;
231 };
232
233 partition@31000 {
234 label = "config";
235 reg = <0x31000 0xf000>;
236 read-only;
237 };
238
239 factory: partition@40000 {
240 label = "factory";
241 reg = <0x40000 0x10000>;
242 read-only;
243 };
244
245 partition@50000 {
246 compatible = "denx,uimage";
247 label = "firmware";
248 reg = <0x50000 0xfb0000>;
249 };
250 };
251 };
252 };
253
254 &uartlite2 {
255 status = "okay";
256 };
257
258 &uartlite3 {
259 status = "okay";
260 };