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