ramips: add support for ALFA Network Tube-E4G
[openwrt/openwrt.git] / target / linux / ramips / dts / TUBE-E4G.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7620a.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10 compatible = "alfa-network,tube-e4g", "ralink,mt7620a-soc";
11 model = "ALFA Network Tube-E4G";
12
13 aliases {
14 led-boot = &power;
15 led-failsafe = &power;
16 led-running = &power;
17 led-upgrade = &power;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 gpio-export {
25 compatible = "gpio-export";
26 #size-cells = <0>;
27
28 modem-enable {
29 gpio-export,name = "modem-enable";
30 gpio-export,output = <1>;
31 gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
32 };
33
34 modem-rf-enable {
35 gpio-export,name = "modem-rf-enable";
36 gpio-export,output = <1>;
37 gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
38 };
39
40 sim-select {
41 gpio-export,name = "sim-select";
42 gpio-export,output = <0>;
43 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
44 };
45
46 sim1-detect {
47 gpio-export,name = "sim1-detect";
48 gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
49 };
50
51 sim2-detect {
52 gpio-export,name = "sim2-detect";
53 gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
54 };
55 };
56
57 keys {
58 compatible = "gpio-keys";
59
60 reset {
61 label = "reset";
62 linux,code = <KEY_RESTART>;
63 gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
64 debounce-interval = <60>;
65 };
66 };
67
68 leds {
69 compatible = "gpio-leds";
70
71 4g {
72 label = "tube-e4g:green:4g";
73 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
74 };
75
76 lan {
77 label = "tube-e4g:blue:lan";
78 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
79 };
80
81 power: power {
82 label = "tube-e4g:green:power";
83 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
84 default-state = "keep";
85 };
86
87 sim1 {
88 label = "tube-e4g:green:sim1";
89 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
90 default-state = "keep";
91 };
92
93 sim2 {
94 label = "tube-e4g:green:sim2";
95 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
96 default-state = "keep";
97 };
98 };
99 };
100
101 &ehci {
102 status = "okay";
103 };
104
105 &ethernet {
106 mtd-mac-address = <&factory 0x28>;
107 };
108
109 &gpio0 {
110 status = "okay";
111 };
112
113 &gpio1 {
114 status = "okay";
115 };
116
117 &gpio2 {
118 status = "okay";
119 };
120
121 &gsw {
122 mediatek,port4 = "ephy";
123 };
124
125 &ohci {
126 status = "okay";
127 };
128
129 &pcie {
130 status = "disabled";
131 };
132
133 &pinctrl {
134 state_default: pinctrl0 {
135 gpio {
136 ralink,group = "ephy", "nd_sd", "pcie", "uartf";
137 ralink,function = "gpio";
138 };
139 };
140 };
141
142 &spi0 {
143 status = "okay";
144
145 flash@0 {
146 compatible = "jedec,spi-nor";
147 reg = <0>;
148 spi-max-frequency = <50000000>;
149 m25p,fast-read;
150
151 partitions {
152 compatible = "fixed-partitions";
153 #address-cells = <1>;
154 #size-cells = <1>;
155
156 partition@0 {
157 label = "u-boot";
158 reg = <0x0 0x30000>;
159 read-only;
160 };
161
162 partition@30000 {
163 label = "u-boot-env";
164 reg = <0x30000 0x1000>;
165 };
166
167 partition@31000 {
168 label = "config";
169 reg = <0x31000 0xf000>;
170 read-only;
171 };
172
173 factory: partition@40000 {
174 label = "factory";
175 reg = <0x40000 0x10000>;
176 read-only;
177 };
178
179 partition@50000 {
180 compatible = "denx,uimage";
181 label = "firmware";
182 reg = <0x50000 0xfb0000>;
183 };
184 };
185 };
186 };
187
188 &wmac {
189 status = "disabled";
190 };