ipq40xx: Use constant to set gpio active low/high
[openwrt/openwrt.git] / target / linux / ipq40xx / files-4.14 / arch / arm / boot / dts / qcom-ipq4018-a42.dts
1 /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2 * Copyright (c) 2017, Sven Eckelmann <sven.eckelmann@openmesh.com>
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 *
16 */
17
18 #include "qcom-ipq4019.dtsi"
19 #include "qcom-ipq4019-bus.dtsi"
20 #include <dt-bindings/gpio/gpio.h>
21 #include <dt-bindings/input/input.h>
22 #include <dt-bindings/soc/qcom,tcsr.h>
23
24 / {
25 model = "OpenMesh A42";
26 compatible = "openmesh,a42", "qcom,ipq4019";
27
28 reserved-memory {
29 #address-cells = <0x1>;
30 #size-cells = <0x1>;
31 ranges;
32
33 rsvd1@87000000 {
34 reg = <0x87000000 0x500000>;
35 no-map;
36 };
37
38 wifi_dump@87500000 {
39 reg = <0x87500000 0x600000>;
40 no-map;
41 };
42
43 rsvd2@87B00000 {
44 reg = <0x87b00000 0x500000>;
45 no-map;
46 };
47 };
48
49 soc {
50 mdio@90000 {
51 status = "okay";
52 };
53
54 ess-psgmii@98000 {
55 status = "okay";
56 };
57
58 tcsr@194b000 {
59 /* select hostmode */
60 compatible = "qcom,tcsr";
61 reg = <0x194b000 0x100>;
62 qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
63 status = "okay";
64 };
65
66 tcsr@1949000 {
67 compatible = "qcom,tcsr";
68 reg = <0x1949000 0x100>;
69 qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
70 };
71
72 ess_tcsr@1953000 {
73 compatible = "qcom,tcsr";
74 reg = <0x1953000 0x1000>;
75 qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
76 };
77
78 tcsr@1957000 {
79 compatible = "qcom,tcsr";
80 reg = <0x1957000 0x100>;
81 qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
82 };
83
84 usb2: usb2@60f8800 {
85 status = "okay";
86 };
87
88 serial@78af000 {
89 pinctrl-0 = <&serial_pins>;
90 pinctrl-names = "default";
91 status = "okay";
92 };
93
94 crypto@8e3a000 {
95 status = "okay";
96 };
97
98 watchdog@b017000 {
99 status = "okay";
100 };
101
102 ess-switch@c000000 {
103 status = "okay";
104 };
105
106 edma@c080000 {
107 status = "okay";
108 };
109 };
110
111 gpio-keys {
112 compatible = "gpio-keys";
113
114 reset {
115 label = "reset";
116 gpios = <&tlmm 59 GPIO_ACTIVE_LOW>;
117 linux,code = <KEY_RESTART>;
118 };
119 };
120
121 aliases {
122 led-boot = &power;
123 led-failsafe = &power;
124 led-running = &power;
125 led-upgrade = &power;
126 };
127
128 gpio-leds {
129 compatible = "gpio-leds";
130
131 red {
132 label = "a42:red:status";
133 gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
134 linux,default-trigger = "default-off";
135 };
136
137 power: green {
138 label = "a42:green:status";
139 gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
140 };
141
142 blue {
143 label = "a42:blue:status";
144 gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
145 linux,default-trigger = "default-off";
146 };
147 };
148
149 watchdog {
150 compatible = "linux,wdt-gpio";
151 gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
152 hw_algo = "toggle";
153 /* hw_margin_ms is actually 300s but driver limits it to 60s */
154 hw_margin_ms = <60000>;
155 always-running;
156 };
157 };
158
159 &tlmm {
160 serial_pins: serial_pinmux {
161 mux {
162 pins = "gpio60", "gpio61";
163 function = "blsp_uart0";
164 bias-disable;
165 };
166 };
167
168 spi_0_pins: spi_0_pinmux {
169 pin {
170 function = "blsp_spi0";
171 pins = "gpio55", "gpio56", "gpio57";
172 drive-strength = <12>;
173 bias-disable;
174 };
175 pin_cs {
176 function = "gpio";
177 pins = "gpio54";
178 drive-strength = <2>;
179 bias-disable;
180 output-high;
181 };
182 };
183 };
184
185 &blsp_dma {
186 status = "okay";
187 };
188
189 &spi_0 {
190 pinctrl-0 = <&spi_0_pins>;
191 pinctrl-names = "default";
192 status = "okay";
193 cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>;
194
195 m25p80@0 {
196 #address-cells = <1>;
197 #size-cells = <1>;
198 compatible = "jedec,spi-nor";
199 reg = <0>;
200 spi-max-frequency = <24000000>;
201 /* partitions are passed via bootloader */
202 };
203 };
204
205 &cryptobam {
206 status = "okay";
207 };
208
209 &gmac0 {
210 qcom,phy_mdio_addr = <4>;
211 qcom,poll_required = <1>;
212 qcom,forced_speed = <1000>;
213 qcom,forced_duplex = <1>;
214 vlan_tag = <2 0x20>;
215 };
216
217 &gmac1 {
218 qcom,phy_mdio_addr = <3>;
219 qcom,poll_required = <1>;
220 qcom,forced_speed = <1000>;
221 qcom,forced_duplex = <1>;
222 vlan_tag = <1 0x10>;
223 };
224
225 &usb2_hs_phy {
226 status = "okay";
227 };
228
229 &wifi0 {
230 status = "okay";
231 qcom,ath10k-calibration-variant = "OM-A42";
232 };
233
234 &wifi1 {
235 status = "okay";
236 qcom,ath10k-calibration-variant = "OM-A42";
237 };