d9c66d2745fe5d52b526acb5d7c6c025a42e460b
[openwrt/staging/wigyori.git] / target / linux / ath79 / dts / ar9344_teltonika_rut9xx.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9344.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "teltonika,rut9xx", "qca,ar9344";
10
11 aliases {
12 serial1 = &hs_uart;
13 label-mac-device = &eth1;
14 };
15
16 i2c0: i2c {
17 compatible = "i2c-gpio";
18 scl-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
19 sda-gpios = <&gpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
20 #address-cells = <1>;
21 #size-cells = <0>;
22
23 hwmon@4d {
24 compatible = "microchip,mcp3221";
25 reg = <0x4d>;
26 };
27 };
28
29 keys {
30 compatible = "gpio-keys";
31
32 reset {
33 label = "reset";
34 linux,code = <KEY_RESTART>;
35 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
36 debounce-interval = <60>;
37 };
38 };
39 };
40
41 &ref {
42 clock-frequency = <40000000>;
43 };
44
45 &hs_uart {
46 status = "okay";
47
48 pinctrl-names = "default";
49 pinctrl-0 = <&pmx_uart2>;
50
51 rts-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
52 rs485-rts-active-low;
53 linux,rs485-enabled-at-boot-time;
54 };
55
56 &spi {
57 status = "okay";
58
59 pinctrl-names = "default";
60 pinctrl-0 = <&pmx_spi>;
61
62 flash@0 {
63 compatible = "jedec,spi-nor";
64 reg = <0>;
65 spi-max-frequency = <25000000>;
66
67 partitions {
68 compatible = "fixed-partitions";
69 #address-cells = <1>;
70 #size-cells = <1>;
71
72 partition@0 {
73 label = "u-boot";
74 reg = <0x0 0x20000>;
75 read-only;
76 };
77
78 config: partition@20000 {
79 label = "config";
80 reg = <0x20000 0x10000>;
81 read-only;
82 };
83
84 art: partition@30000 {
85 label = "art";
86 reg = <0x30000 0x10000>;
87 read-only;
88 };
89
90 partition@40000 {
91 label = "firmware";
92 reg = <0x40000 0xf30000>;
93 compatible = "tplink,firmware";
94 };
95
96 partition@f70000 {
97 label = "event-log";
98 reg = <0xf70000 0x90000>;
99 read-only;
100 };
101 };
102 };
103
104 microsd@1 {
105 status = "disabled";
106
107 compatible = "mmc-spi-slot";
108 spi-max-frequency = <25000000>;
109 reg = <1>;
110 voltage-ranges = <3200 3400>;
111 broken-cd;
112 };
113 };
114
115 &usb {
116 #address-cells = <1>;
117 #size-cells = <0>;
118 status = "okay";
119
120 port@1 {
121 #address-cells = <1>;
122 #size-cells = <0>;
123 reg = <1>;
124
125 port@1 {
126 compatible = "usb-a-connector";
127 reg = <1>;
128 };
129
130 port@3 {
131 label = "RS-232 serial adapter";
132 reg = <3>;
133 };
134
135 port@4 {
136 label = "internal wwan modem";
137 reg = <4>;
138 };
139 };
140 };
141
142 &usb_phy {
143 status = "okay";
144 };
145
146 &wmac {
147 status = "okay";
148
149 mtd-cal-data = <&art 0x1000>;
150 mtd-mac-address = <&config 0x0>;
151 mtd-mac-address-increment = <2>;
152 };
153
154 &pinmux {
155 pmx_spi: spi {
156 // SPI_CS1 on GPIO 3
157 pinctrl-single,bits = <0x0 0x07000000 0xff000000>;
158 };
159
160 pmx_leds_switch: leds_switch {
161 // switch port LEDs on GPIO 1, GPIO 13, GPIO 14 and GPIO 22
162 pinctrl-single,bits = <0x00 0x00002d00 0x0000ff00>,
163 <0x0c 0x002c2b00 0x00ffff00>,
164 <0x14 0x002a0000 0x00ff0000>;
165 };
166
167 pmx_uart2: uart2 {
168 // UART1_DTR on GPIO 0, UART1_RD on GPIO 11, UART1_TD on GPIO 18
169 pinctrl-single,bits = <0x00 0x00000000 0x000000ff>,
170 <0x10 0x004f0000 0x00ff0000>,
171 <0x3c 0x000b0000 0x00ff0000>;
172 };
173 };