ath79: fix RS-485 on Teltonika RUT-955
[openwrt/staging/ldir.git] / target / linux / ath79 / dts / ar9344_teltonika_rut955-h7v3c0.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9344_teltonika_rut9xx.dtsi"
4 #include <dt-bindings/interrupt-controller/irq.h>
5
6 / {
7 model = "Teltonika RUT955 H7V3C0";
8 compatible = "teltonika,rut955-h7v3c0", "teltonika,rut9xx", "qca,ar9344";
9
10 aliases {
11 led-boot = &led_system_green;
12 led-failsafe = &led_system_red;
13 led-running = &led_system_green;
14 led-upgrade = &led_system_red;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 signal0 {
21 label = "green:signal0";
22 gpios = <&gpio_ext 0 GPIO_ACTIVE_HIGH>;
23 };
24
25 signal1 {
26 label = "green:signal1";
27 gpios = <&gpio_ext 1 GPIO_ACTIVE_HIGH>;
28 };
29
30 signal2 {
31 label = "green:signal2";
32 gpios = <&gpio_ext 2 GPIO_ACTIVE_HIGH>;
33 };
34
35 signal3 {
36 label = "green:signal3";
37 gpios = <&gpio_ext 3 GPIO_ACTIVE_HIGH>;
38 };
39
40 signal4 {
41 label = "green:signal4";
42 gpios = <&gpio_ext 4 GPIO_ACTIVE_HIGH>;
43 };
44
45 led_system_red: system_red {
46 label = "red:system";
47 gpios = <&gpio_ext 5 GPIO_ACTIVE_HIGH>;
48 };
49
50 led_system_green: system_green {
51 label = "green:system";
52 gpios = <&gpio_ext 6 GPIO_ACTIVE_HIGH>;
53 default-state = "on";
54 };
55 };
56 };
57
58 &gpio {
59 pinctrl-names = "default";
60 pinctrl-0 = <&jtag_disable_pins>;
61
62 gpio-line-names = "RS485_D", "led_wan", "wmac_lna", "mmc_cs",
63 "EXT_INT", "", "", "",
64 "", "", "", "",
65 "", "led_lan2", "led_lan1", "",
66 "i2c_scl", "i2c_sda", "", "",
67 "", "", "led_lan3", "",
68 "", "", "", "",
69 "", "", "", "";
70
71 ext_lna {
72 gpio-hog;
73 gpios = <2 GPIO_ACTIVE_HIGH>;
74 output-high;
75 line-name = "rut955:wmac:ext_lna";
76 };
77
78 mmc_cs {
79 gpio-hog;
80 gpios = <3 GPIO_ACTIVE_HIGH>;
81 output-high;
82 line-name = "rut955:mmc:cs";
83 };
84
85 ext_int {
86 gpio-hog;
87 gpios = <4 GPIO_ACTIVE_LOW>;
88 input;
89 line-name = "rut955:ext:int";
90 };
91
92 uart1_td {
93 gpio-hog;
94 gpios = <18 GPIO_ACTIVE_HIGH>;
95 output-high;
96 line-name = "rut955:uart1:td";
97 };
98
99 uart1_rd {
100 gpio-hog;
101 gpios = <11 GPIO_ACTIVE_LOW>;
102 input;
103 line-name = "rut955:uart1:rd";
104 };
105
106 led_wan {
107 gpio-hog;
108 gpios = <1 GPIO_ACTIVE_HIGH>;
109 output-high;
110 line-name = "rut955:led:wan";
111 };
112
113 led_lan2 {
114 gpio-hog;
115 gpios = <13 GPIO_ACTIVE_HIGH>;
116 output-high;
117 line-name = "rut955:led:lan2";
118 };
119
120 led_lan1 {
121 gpio-hog;
122 gpios = <14 GPIO_ACTIVE_HIGH>;
123 output-high;
124 line-name = "rut955:led:lan1";
125 };
126
127 led_lan3 {
128 gpio-hog;
129 gpios = <22 GPIO_ACTIVE_HIGH>;
130 output-high;
131 line-name = "rut955:led:lan3";
132 };
133 };
134
135 &i2c0 {
136 gpio_ext: gpio_ext@74 {
137 status = "okay";
138
139 compatible = "nxp,pca9539";
140 reg = <0x74>;
141
142 #address-cells = <1>;
143 #size-cells = <0>;
144
145 gpio-controller;
146 #gpio-cells = <2>;
147
148 reset-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
149
150 interrupt-parent = <&gpio>;
151 interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
152 interrupt-controller;
153 #interrupt-cells = <2>;
154
155 gpio-line-names = "signal_bar0", "signal_bar1", "signal_bar2", "signal_bar3",
156 "signal_bar4", "status_red", "status_green", "sim_sel",
157 "DOUT1", "DOUT2", "DIN2", "DIN1",
158 "MON", "MRST", "SDCD", "RS485_R";
159 };
160 };
161
162 &eth0 {
163 status = "okay";
164
165 phy-handle = <&swphy4>;
166
167 mtd-mac-address = <&config 0x0>;
168 mtd-mac-address-increment = <1>;
169 };
170
171 &eth1 {
172 status = "okay";
173
174 mtd-mac-address = <&config 0x0>;
175 };
176
177 &builtin_switch {
178 pinctrl-names = "default";
179 pinctrl-0 = <&pmx_leds_switch>;
180 };
181
182 &wmac {
183 pinctrl-names = "default";
184 pinctrl-0 = <&pmx_ext_lna>;
185 };
186
187 &pinmux {
188 pmx_ext_lna: ext_lna {
189 // EXT_LNA0 on GPIO 2
190 pinctrl-single,bits = <0x0 0x002e0000 0x00ff0000>;
191 };
192 };