ipq40xx: improve ASUS RT-AC58U support
[oweals/openwrt.git] / target / linux / ipq40xx / files-4.19 / arch / arm / boot / dts / qcom-ipq4018-rt-ac58u.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qcom-ipq4019.dtsi"
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/soc/qcom,tcsr.h>
7
8 / {
9         model = "ASUS RT-AC58U";
10         compatible = "asus,rt-ac58u";
11
12         memory {
13                 device_type = "memory";
14                 reg = <0x80000000 0x8000000>;
15         };
16
17         aliases {
18                 led-boot = &led_power;
19                 led-failsafe = &led_power;
20                 led-running = &led_power;
21                 led-upgrade = &led_power;
22         };
23
24         chosen {
25                 bootargs-append = " ubi.mtd=UBI_DEV";
26         };
27
28         soc {
29                 rng@22000 {
30                         status = "okay";
31                 };
32
33                 mdio@90000 {
34                         status = "okay";
35                 };
36
37                 ess-psgmii@98000 {
38                         status = "okay";
39                 };
40
41                 tcsr@1949000 {
42                         compatible = "qcom,tcsr";
43                         reg = <0x1949000 0x100>;
44                         qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
45                 };
46
47                 tcsr@194b000 {
48                         compatible = "qcom,tcsr";
49                         reg = <0x194b000 0x100>;
50                         qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
51                 };
52
53                 ess_tcsr@1953000 {
54                         compatible = "qcom,tcsr";
55                         reg = <0x1953000 0x1000>;
56                         qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
57                 };
58
59                 tcsr@1957000 {
60                         compatible = "qcom,tcsr";
61                         reg = <0x1957000 0x100>;
62                         qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
63                 };
64
65                 usb2@60f8800 {
66                         status = "okay";
67
68                         dwc3@6000000 {
69                                 #address-cells = <1>;
70                                 #size-cells = <0>;
71
72                                 usb2_port1: port@1 {
73                                         reg = <1>;
74                                         #trigger-source-cells = <0>;
75                                 };
76                         };
77                 };
78
79                 usb3@8af8800 {
80                         status = "okay";
81
82                         dwc3@8a00000 {
83                                 #address-cells = <1>;
84                                 #size-cells = <0>;
85
86                                 usb3_port1: port@1 {
87                                         reg = <1>;
88                                         #trigger-source-cells = <0>;
89                                 };
90
91                                 usb3_port2: port@2 {
92                                         reg = <2>;
93                                         #trigger-source-cells = <0>;
94                                 };
95                         };
96                 };
97
98                 crypto@8e3a000 {
99                         status = "okay";
100                 };
101
102                 watchdog@b017000 {
103                         status = "okay";
104                 };
105
106                 ess-switch@c000000 {
107                         status = "okay";
108                 };
109
110                 edma@c080000 {
111                         status = "okay";
112                 };
113         };
114
115         keys {
116                 compatible = "gpio-keys";
117
118                 reset {
119                         label = "reset";
120                         gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
121                         linux,code = <KEY_RESTART>;
122                 };
123
124                 wps {
125                         label = "wps";
126                         gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
127                         linux,code = <KEY_WPS_BUTTON>;
128                 };
129         };
130
131         leds {
132                 compatible = "gpio-leds";
133
134                 led_power: status {
135                         label = "rt-ac58u:blue:status";
136                         gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
137                 };
138
139                 wan {
140                         label = "rt-ac58u:blue:wan";
141                         gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
142                 };
143
144                 wlan2G {
145                         label = "rt-ac58u:blue:wlan2G";
146                         gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>;
147                         linux,default-trigger = "phy0tpt";
148                 };
149
150                 wlan5G {
151                         label = "rt-ac58u:blue:wlan5G";
152                         gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
153                         linux,default-trigger = "phy1tpt";
154                 };
155
156                 usb {
157                         label = "rt-ac58u:blue:usb";
158                         gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
159                         trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>;
160                         linux,default-trigger = "usbport";
161                 };
162
163                 lan {
164                         label = "rt-ac58u:blue:lan";
165                         gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
166                 };
167         };
168 };
169
170 &cryptobam {
171         status = "okay";
172 };
173
174 &blsp_dma {
175         status = "okay";
176 };
177
178 &tlmm {
179         serial_pins: serial_pinmux {
180                 mux {
181                         pins = "gpio60", "gpio61";
182                         function = "blsp_uart0";
183                         bias-disable;
184                 };
185         };
186
187         spi_0_pins: spi_0_pinmux {
188                 mux {
189                         function = "blsp_spi0";
190                         pins = "gpio55", "gpio56", "gpio57";
191                         drive-strength = <12>;
192                         bias-disable;
193                 };
194
195                 mux_cs {
196                         function = "gpio";
197                         pins = "gpio54", "gpio59";
198                         drive-strength = <2>;
199                         bias-disable;
200                         output-high;
201                 };
202         };
203 };
204
205 &blsp1_spi1 { /* BLSP1 QUP1 */
206         pinctrl-0 = <&spi_0_pins>;
207         pinctrl-names = "default";
208         status = "okay";
209         cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>,
210                    <&tlmm 59 GPIO_ACTIVE_HIGH>;
211
212         flash@0 {
213                 /*
214                  * U-boot looks for "n25q128a11" node,
215                  * if we don't have it, it will spit out the following warning:
216                  * "ipq: fdt fixup unable to find compatible node".
217                  */
218                 compatible = "jedec,spi-nor";
219                 reg = <0>;
220                 linux,modalias = "m25p80", "mx25l1606e", "n25q128a11";
221                 spi-max-frequency = <30000000>;
222
223                 partitions {
224                         compatible = "fixed-partitions";
225                         #address-cells = <1>;
226                         #size-cells = <1>;
227
228                         partition@0 {
229                                 label = "SBL1";
230                                 reg = <0x00000000 0x00040000>;
231                                 read-only;
232                         };
233                         partition@40000 {
234                                 label = "MIBIB";
235                                 reg = <0x00040000 0x00020000>;
236                                 read-only;
237                         };
238                         partition@60000 {
239                                 label = "QSEE";
240                                 reg = <0x00060000 0x00060000>;
241                                 read-only;
242                         };
243                         partition@c0000 {
244                                 label = "CDT";
245                                 reg = <0x000c0000 0x00010000>;
246                                 read-only;
247                         };
248                         partition@d0000 {
249                                 label = "DDRPARAMS";
250                                 reg = <0x000d0000 0x00010000>;
251                                 read-only;
252                         };
253                         partition@e0000 {
254                                 label = "APPSBLENV"; /* uboot env*/
255                                 reg = <0x000e0000 0x00010000>;
256                                 read-only;
257                         };
258                         partition@f0000 {
259                                 label = "APPSBL"; /* uboot */
260                                 reg = <0x000f0000 0x00080000>;
261                                 read-only;
262                         };
263                         partition@170000 {
264                                 label = "ART";
265                                 reg = <0x00170000 0x00010000>;
266                                 read-only;
267                         };
268                         /* 0x00180000 - 0x00200000 unused */
269                 };
270         };
271
272         spi-nand@1 {
273                 compatible = "spi-nand";
274                 reg = <1>;
275                 spi-max-frequency = <30000000>;
276
277                 /*
278                  * U-boot looks for "spinand,mt29f" node,
279                  * if we don't have it, it will spit out the following warning:
280                  * "ipq: fdt fixup unable to find compatible node".
281                  */
282
283                 partitions {
284                         compatible = "fixed-partitions";
285                         #address-cells = <1>;
286                         #size-cells = <1>;
287
288                         partition@0 {
289                                 /*
290                                  * TODO: change to label = "ubi" once we drop 4.14.
291                                  *       also drop the bootargs-append and all the
292                                  *       userspace CI_UBIPART="UBI_DEV" remains.
293                                  */
294                                 label = "UBI_DEV";
295                                 reg = <0x00000000 0x08000000>;
296                         };
297                 };
298         };
299 };
300
301 &blsp1_uart1 {
302         pinctrl-0 = <&serial_pins>;
303         pinctrl-names = "default";
304         status = "okay";
305 };
306
307 &usb3_ss_phy {
308         status = "okay";
309 };
310
311 &usb3_hs_phy {
312         status = "okay";
313 };
314
315 &usb2_hs_phy {
316         status = "okay";
317 };
318
319 &wifi0 {
320         status = "okay";
321         qcom,ath10k-calibration-variant = "RT-AC58U";
322 };
323
324 &wifi1 {
325         status = "okay";
326         qcom,ath10k-calibration-variant = "RT-AC58U";
327 };