ramips: move dts-v1 statement to top-level DTSI files
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_alfa-network_r36m-e4g.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "alfa-network,r36m-e4g", "ralink,mt7620a-soc";
10 model = "ALFA Network R36M-E4G";
11
12 aliases {
13 label-mac-device = &wmac;
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=ttyS1,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 = <&gpio1 1 GPIO_ACTIVE_HIGH>;
38 };
39
40 rtc-enable {
41 gpio-export,name = "rtc-enable";
42 gpio-export,output = <1>;
43 gpio-export,direction_may_change = <1>;
44 gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
45 };
46
47 sim-select {
48 gpio-export,name = "sim-select";
49 gpio-export,output = <0>;
50 gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
51 };
52
53 sim1-detect {
54 gpio-export,name = "sim1-detect";
55 gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
56 };
57
58 sim2-detect {
59 gpio-export,name = "sim2-detect";
60 gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
61 };
62 };
63
64 keys {
65 compatible = "gpio-keys";
66
67 reset {
68 label = "reset";
69 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
70 linux,code = <KEY_RESTART>;
71 };
72
73 rfkill {
74 label = "rfkill";
75 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
76 linux,code = <KEY_RFKILL>;
77 };
78 };
79
80 leds {
81 compatible = "gpio-leds";
82
83 4g {
84 label = "r36m-e4g:orange:4g";
85 gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
86 };
87
88 lan {
89 label = "r36m-e4g:green:lan";
90 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
91 };
92
93 led_system: system {
94 label = "r36m-e4g:green:system";
95 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
96 default-state = "keep";
97 };
98
99 sim1 {
100 label = "r36m-e4g:green:sim1";
101 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
102 default-state = "keep";
103 };
104
105 sim2 {
106 label = "r36m-e4g:green:sim2";
107 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
108 default-state = "keep";
109 };
110
111 wan {
112 label = "r36m-e4g:green:wan";
113 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
114 };
115
116 wlan {
117 label = "r36m-e4g:orange:wlan";
118 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
119 linux,default-trigger = "phy0radio";
120 };
121 };
122 };
123
124 &ehci {
125 status = "okay";
126 };
127
128 &ethernet {
129 mtd-mac-address = <&factory 0x28>;
130 };
131
132 &gpio1 {
133 status = "okay";
134 };
135
136 &gpio2 {
137 status = "okay";
138 };
139
140 &gpio3 {
141 status = "okay";
142 };
143
144 &gsw {
145 mediatek,port4 = "ephy";
146 };
147
148 &i2c {
149 status = "okay";
150 };
151
152 &ohci {
153 status = "okay";
154 };
155
156 &state_default {
157 gpio {
158 groups = "ephy", "pcie", "rgmii1", "wled";
159 function = "gpio";
160 };
161 };
162
163 &spi0 {
164 status = "okay";
165
166 flash@0 {
167 compatible = "jedec,spi-nor";
168 reg = <0>;
169 spi-max-frequency = <50000000>;
170 m25p,fast-read;
171
172 partitions {
173 compatible = "fixed-partitions";
174 #address-cells = <1>;
175 #size-cells = <1>;
176
177 partition@0 {
178 label = "u-boot";
179 reg = <0x0 0x30000>;
180 read-only;
181 };
182
183 partition@30000 {
184 label = "u-boot-env";
185 reg = <0x30000 0x1000>;
186 };
187
188 partition@31000 {
189 label = "config";
190 reg = <0x31000 0xf000>;
191 read-only;
192 };
193
194 factory: partition@40000 {
195 label = "factory";
196 reg = <0x40000 0x10000>;
197 read-only;
198 };
199
200 partition@50000 {
201 compatible = "denx,uimage";
202 label = "firmware";
203 reg = <0x50000 0xfb0000>;
204 };
205 };
206 };
207 };
208
209 &uart {
210 status = "okay";
211 };
212
213 &wmac {
214 ralink,mtd-eeprom = <&factory 0x0>;
215 };