ba1daa4fb880a1288a902966647db6bcaf28a736
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9331_teltonika_rut230-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9331.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 model = "Teltonika RUT230 v1";
10 compatible = "teltonika,rut230-v1", "qca,ar9331";
11
12 aliases {
13 label-mac-device = &eth1;
14 led-boot = &led_ss0;
15 led-failsafe = &led_ss0;
16 led-upgrade = &led_ss0;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 reset {
23 label = "reset";
24 linux,code = <KEY_RESTART>;
25 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
26 debounce-interval = <60>;
27 };
28
29 input {
30 label = "input";
31 linux,code = <BTN_0>;
32 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
33 debounce-interval = <60>;
34 };
35
36 sim-tray {
37 label = "sim-tray";
38 linux,code = <BTN_1>;
39 gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
40 debounce-interval = <60>;
41 };
42 };
43
44 leds {
45 compatible = "gpio-leds";
46 pinctrl-names = "default";
47 pinctrl-0 = <&switch_led_disable_pins>;
48
49 led_ss0: signal-strength-0 {
50 label = "green:signal-strength-0";
51 gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
52 };
53
54 signal-strength-1 {
55 label = "green:signal-strength-1";
56 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
57 };
58
59 signal-strength-2 {
60 label = "green:signal-strength-2";
61 gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
62 };
63
64 signal-strength-3 {
65 label = "green:signal-strength-3";
66 gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
67 };
68
69 signal-strength-4 {
70 label = "green:signal-strength4";
71 gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
72 };
73
74 2g {
75 label = "green:2g";
76 gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
77 };
78
79 3g {
80 label = "green:3g";
81 gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
82 };
83
84 lan {
85 label = "green:lan";
86 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
87 /* GPIO 13 - ACTIVE HIGH for hwrev 0 */
88 };
89
90 wan {
91 label = "green:wan";
92 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
93 /* GPIO 14 - ACTIVE HIGH for hwrev 0 */
94 };
95
96 /* 4G LED - GPIO21 ACTIVE_HIGH for RUT240 */
97 };
98
99 reg_usb_vbus: reg_usb_vbus {
100 compatible = "regulator-fixed";
101 regulator-name = "usb_vbus";
102 regulator-min-microvolt = <5000000>;
103 regulator-max-microvolt = <5000000>;
104 gpio = <&gpio 19 GPIO_ACTIVE_HIGH>;
105 enable-active-high;
106 };
107 };
108
109 &eth0 {
110 status = "okay";
111
112 nvmem-cells = <&macaddr_config_0>;
113 nvmem-cell-names = "mac-address";
114 mac-address-increment = <1>;
115 };
116
117 &eth1 {
118 status = "okay";
119
120 nvmem-cells = <&macaddr_config_0>;
121 nvmem-cell-names = "mac-address";
122 };
123
124 &spi {
125 status = "okay";
126
127 flash@0 {
128 compatible = "jedec,spi-nor";
129 reg = <0>;
130 spi-max-frequency = <30000000>;
131
132 partitions {
133 compatible = "fixed-partitions";
134 #address-cells = <1>;
135 #size-cells = <1>;
136
137 partition@0 {
138 label = "u-boot";
139 reg = <0x0 0x20000>;
140 read-only;
141 };
142
143 config: partition@20000 {
144 label = "config";
145 reg = <0x20000 0x10000>;
146 read-only;
147
148 nvmem-layout {
149 compatible = "fixed-layout";
150 #address-cells = <1>;
151 #size-cells = <1>;
152
153 macaddr_config_0: macaddr@0 {
154 reg = <0x0 0x6>;
155 };
156 };
157 };
158
159 art: partition@30000 {
160 label = "art";
161 reg = <0x30000 0x10000>;
162 read-only;
163 };
164
165 partition@40000 {
166 compatible = "tplink,firmware";
167 label = "firmware";
168 reg = <0x40000 0xf30000>;
169 };
170
171 partition@f70000 {
172 label = "event-log";
173 reg = <0xf70000 0x90000>;
174 read-only;
175 };
176 };
177 };
178 };
179
180 &usb {
181 dr_mode = "host";
182 vbus-supply = <&reg_usb_vbus>;
183 status = "okay";
184 };
185
186 &gpio {
187 modem-power {
188 gpio-hog;
189 output-low;
190 gpios = <18 GPIO_ACTIVE_HIGH>;
191 line-name = "modem-power";
192 };
193 };
194
195 &usb_phy {
196 status = "okay";
197 };
198
199 &wmac {
200 status = "okay";
201
202 mtd-cal-data = <&art 0x1000>;
203 nvmem-cells = <&macaddr_config_0>;
204 nvmem-cell-names = "mac-address";
205 mac-address-increment = <2>;
206 };