ramips: add support for ALFA Network Quad-E4G
[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 = &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 &pinctrl {
169 state_default: pinctrl0 {
170 gpio {
171 ralink,group = "jtag", "rgmii2", "wdt";
172 ralink,function = "gpio";
173 };
174 };
175 };
176
177 &sdhci {
178 status = "okay";
179 };
180
181 &spi0 {
182 status = "okay";
183
184 flash@0 {
185 compatible = "jedec,spi-nor";
186 reg = <0>;
187 spi-max-frequency = <50000000>;
188 m25p,fast-read;
189
190 partitions {
191 compatible = "fixed-partitions";
192 #address-cells = <1>;
193 #size-cells = <1>;
194
195 partition@0 {
196 label = "u-boot";
197 reg = <0x0 0x30000>;
198 };
199
200 partition@30000 {
201 label = "u-boot-env";
202 reg = <0x30000 0x1000>;
203 };
204
205 partition@31000 {
206 label = "config";
207 reg = <0x31000 0xf000>;
208 read-only;
209 };
210
211 factory: partition@40000 {
212 label = "factory";
213 reg = <0x40000 0x10000>;
214 read-only;
215 };
216
217 partition@50000 {
218 compatible = "denx,uimage";
219 label = "firmware";
220 reg = <0x50000 0xfb0000>;
221 };
222 };
223 };
224 };
225
226 &uartlite2 {
227 status = "okay";
228 };
229
230 &uartlite3 {
231 status = "okay";
232 };