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