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