ath79: convert mtd-mac-address to nvmem implementation
[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 = &wmac;
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 };
115
116 &eth1 {
117 status = "okay";
118
119 nvmem-cells = <&macaddr_config_0>;
120 nvmem-cell-names = "mac-address";
121 mac-address-increment = <1>;
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
149 art: partition@30000 {
150 label = "art";
151 reg = <0x30000 0x10000>;
152 read-only;
153 };
154
155 partition@40000 {
156 compatible = "tplink,firmware";
157 label = "firmware";
158 reg = <0x40000 0xf30000>;
159 };
160
161 partition@f70000 {
162 label = "event-log";
163 reg = <0xf70000 0x90000>;
164 read-only;
165 };
166 };
167 };
168 };
169
170 &usb {
171 dr_mode = "host";
172 vbus-supply = <&reg_usb_vbus>;
173 status = "okay";
174 };
175
176 &gpio {
177 modem-power {
178 gpio-hog;
179 output-low;
180 gpios = <18 GPIO_ACTIVE_HIGH>;
181 line-name = "modem-power";
182 };
183 };
184
185 &usb_phy {
186 status = "okay";
187 };
188
189 &wmac {
190 status = "okay";
191
192 mtd-cal-data = <&art 0x1000>;
193 nvmem-cells = <&macaddr_config_0>;
194 nvmem-cell-names = "mac-address";
195 mac-address-increment = <2>;
196 };
197
198 &config {
199 compatible = "nvmem-cells";
200 #address-cells = <1>;
201 #size-cells = <1>;
202
203 macaddr_config_0: macaddr@0 {
204 reg = <0x0 0x6>;
205 };
206 };