ramips: add support for TP-Link RE200 v1
[oweals/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 = &ethernet;
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 = <&gpio1 0 GPIO_ACTIVE_HIGH>;
33                 };
34
35                 minipcie0-enable {
36                         gpio-export,name = "minipcie0-enable";
37                         gpio-export,output = <1>;
38                         gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
39                 };
40
41                 minipcie0-reset {
42                         gpio-export,name = "minipcie0-reset";
43                         gpio-export,output = <0>;
44                         gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
45                 };
46
47                 minipcie1-enable {
48                         gpio-export,name = "minipcie1-enable";
49                         gpio-export,output = <1>;
50                         gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
51                 };
52
53                 minipcie1-reset {
54                         gpio-export,name = "minipcie1-reset";
55                         gpio-export,output = <0>;
56                         gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
57                 };
58
59                 minipcie2-enable {
60                         gpio-export,name = "minipcie2-enable";
61                         gpio-export,output = <1>;
62                         gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
63                 };
64
65                 minipcie2-reset {
66                         gpio-export,name = "minipcie2-reset";
67                         gpio-export,output = <0>;
68                         gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
69                 };
70
71                 pcie-perst-disable {
72                         gpio-export,name = "pcie-perst-enable";
73                         gpio-export,output = <0>;
74                         gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
75                 };
76
77                 sim-select {
78                         gpio-export,name = "sim-select";
79                         gpio-export,output = <1>;
80                         gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
81                 };
82
83                 watchdog-enable {
84                         gpio-export,name = "watchdog-enable";
85                         gpio-export,output = <1>;
86                         gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
87                 };
88         };
89
90         keys {
91                 compatible = "gpio-keys";
92
93                 reset {
94                         label = "reset";
95                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
96                         linux,code = <KEY_RESTART>;
97                 };
98
99                 user1 {
100                         label = "user1";
101                         gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
102                         linux,code = <BTN_0>;
103                 };
104
105                 user2 {
106                         label = "user2";
107                         gpios = <&gpio0 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 = <&gpio0 13 GPIO_ACTIVE_LOW>;
118                         default-state = "keep";
119                 };
120
121                 m2 {
122                         label = "quad-e4g:orange:m2";
123                         gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
124                 };
125
126                 minipcie0 {
127                         label = "quad-e4g:orange:minipcie0";
128                         gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
129                 };
130
131                 minipcie1 {
132                         label = "quad-e4g:orange:minipcie1";
133                         gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
134                 };
135
136                 minipcie2 {
137                         label = "quad-e4g:orange:minipcie2";
138                         gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
139                 };
140         };
141
142         watchdog {
143                 compatible = "linux,wdt-gpio";
144                 gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
145                 hw_algo = "toggle";
146                 hw_margin_ms = <25000>;
147                 always-running;
148         };
149 };
150
151 &ethernet {
152         mtd-mac-address = <&factory 0xe000>;
153 };
154
155 &i2c {
156         status = "okay";
157
158         rtc@68 {
159                 compatible = "ti,bq32000";
160                 reg = <0x68>;
161         };
162 };
163
164 &pcie {
165         status = "okay";
166 };
167
168 &state_default {
169         gpio {
170                 ralink,group = "jtag", "rgmii2", "wdt";
171                 ralink,function = "gpio";
172         };
173 };
174
175 &sdhci {
176         status = "okay";
177 };
178
179 &spi0 {
180         status = "okay";
181
182         flash@0 {
183                 compatible = "jedec,spi-nor";
184                 reg = <0>;
185                 spi-max-frequency = <50000000>;
186                 m25p,fast-read;
187
188                 partitions {
189                         compatible = "fixed-partitions";
190                         #address-cells = <1>;
191                         #size-cells = <1>;
192
193                         partition@0 {
194                                 label = "u-boot";
195                                 reg = <0x0 0x30000>;
196                         };
197
198                         partition@30000 {
199                                 label = "u-boot-env";
200                                 reg = <0x30000 0x1000>;
201                         };
202
203                         partition@31000 {
204                                 label = "config";
205                                 reg = <0x31000 0xf000>;
206                                 read-only;
207                         };
208
209                         factory: partition@40000 {
210                                 label = "factory";
211                                 reg = <0x40000 0x10000>;
212                                 read-only;
213                         };
214
215                         partition@50000 {
216                                 compatible = "denx,uimage";
217                                 label = "firmware";
218                                 reg = <0x50000 0xfb0000>;
219                         };
220                 };
221         };
222 };
223
224 &uartlite2 {
225         status = "okay";
226 };
227
228 &uartlite3 {
229         status = "okay";
230 };