ARM64: DTS: Fix Firefly board audio driver
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3229-echo-v10.dts
1 /*
2  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  *  Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 /dts-v1/;
44
45 #include "rk322x.dtsi"
46 #include "rk3229-cpu-opp.dtsi"
47 #include "rk322x-android.dtsi"
48
49 / {
50         model = "RK3229 Echo Board V1.0";
51         compatible = "rockchip,rk3229-echo", "rockchip,rk3229";
52
53         memory@60000000 {
54                 device_type = "memory";
55                 reg = <0x60000000 0x40000000>;
56         };
57
58         sdio_pwrseq: sdio-pwrseq {
59                 compatible = "mmc-pwrseq-simple";
60                 clocks = <&rk805 1>;
61                 clock-names = "ext_clock";
62                 pinctrl-names = "default";
63                 pinctrl-0 = <&wifi_enable_h>;
64
65                 /*
66                  * On the module itself this is one of these (depending
67                  * on the actual card populated):
68                  * - SDIO_RESET_L_WL_REG_ON
69                  * - PDN (power down when low)
70                  */
71                 reset-gpios = <&gpio2 26 GPIO_ACTIVE_LOW>; /* GPIO2_D2 */
72         };
73
74         vcc_host: vcc-host-regulator {
75                 compatible = "regulator-fixed";
76                 enable-active-high;
77                 gpio = <&gpio3 20 GPIO_ACTIVE_HIGH>;
78                 pinctrl-names = "default";
79                 pinctrl-0 = <&host_vbus_drv>;
80                 regulator-name = "vcc_host";
81                 regulator-always-on;
82                 regulator-boot-on;
83         };
84
85         wireless-bluetooth {
86                 compatible = "bluetooth-platdata";
87                 clocks = <&rk805 1>;
88                 clock-names = "ext_clock";
89                 uart_rts_gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
90                 pinctrl-names = "default", "rts_gpio";
91                 pinctrl-0 = <&uart11_rts>;
92                 pinctrl-1 = <&uart11_rts_gpio>;
93                 BT,reset_gpio    = <&gpio2 29 GPIO_ACTIVE_HIGH>;
94                 BT,wake_gpio     = <&gpio3 27 GPIO_ACTIVE_HIGH>;
95                 BT,wake_host_irq = <&gpio3 26 GPIO_ACTIVE_HIGH>;
96                 status = "okay";
97         };
98
99         wireless-wlan {
100                 compatible = "wlan-platdata";
101                 rockchip,grf = <&grf>;
102                 wifi_chip_type = "ap6335";
103                 sdio_vref = <3300>;
104                 WIFI,host_wake_irq = <&gpio0 28 GPIO_ACTIVE_HIGH>;
105                 status = "okay";
106         };
107
108         gpio_keys {
109                 compatible = "gpio-keys";
110                 #address-cells = <1>;
111                 #size-cells = <0>;
112                 autorepeat;
113
114                 pinctrl-names = "default";
115                 pinctrl-0 = <&pwr_key>;
116
117                 power_key: power-key {
118                         label = "GPIO Key Power";
119                         gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
120                         linux,code = <116>;
121                         debounce-interval = <100>;
122                         wakeup-source;
123                 };
124         };
125 };
126
127 &gpu {
128         status = "okay";
129         mali-supply = <&vdd_logic>;
130 };
131
132 &i2c0 {
133         status = "okay";
134
135         rk805: rk805@18 {
136                 compatible = "rockchip,rk805";
137                 status = "okay";
138                 reg = <0x18>;
139                 interrupt-parent = <&gpio1>;
140                 interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
141                 spinctrl-names = "default";
142                 pinctrl-0 = <&pmic_int_l>;
143                 rockchip,system-power-controller;
144                 wakeup-source;
145                 gpio-controller;
146                 #gpio-cells = <2>;
147                 #clock-cells = <1>;
148                 clock-output-names = "xin32k", "rk805-clkout2";
149
150                 rtc {
151                         status = "okay";
152                 };
153
154                 pwrkey {
155                         status = "okay";
156                 };
157
158                 gpio {
159                         status = "okay";
160                 };
161
162                 regulators {
163                         compatible = "rk805-regulator";
164                         status = "okay";
165                         #address-cells = <1>;
166                         #size-cells = <0>;
167
168                         vdd_arm: RK805_DCDC1@0 {
169                                 regulator-compatible = "RK805_DCDC1";
170                                 regulator-name = "vdd_arm";
171                                 regulator-min-microvolt = <712500>;
172                                 regulator-max-microvolt = <1450000>;
173                                 regulator-initial-mode = <0x1>;
174                                 regulator-ramp-delay = <12500>;
175                                 regulator-boot-on;
176                                 regulator-always-on;
177                                 regulator-state-mem {
178                                         regulator-mode = <0x2>;
179                                         regulator-on-in-suspend;
180                                         regulator-suspend-microvolt = <950000>;
181                                 };
182                         };
183
184                         vdd_logic: RK805_DCDC2@1 {
185                                 regulator-compatible = "RK805_DCDC2";
186                                 regulator-name = "vdd_logic";
187                                 regulator-min-microvolt = <712500>;
188                                 regulator-max-microvolt = <1450000>;
189                                 regulator-initial-mode = <0x1>;
190                                 regulator-ramp-delay = <12500>;
191                                 regulator-boot-on;
192                                 regulator-always-on;
193                                 regulator-state-mem {
194                                         regulator-mode = <0x2>;
195                                         regulator-on-in-suspend;
196                                         regulator-suspend-microvolt = <1000000>;
197                                 };
198                         };
199
200                         vcc_ddr: RK805_DCDC3@2 {
201                                 regulator-compatible = "RK805_DCDC3";
202                                 regulator-name = "vcc_ddr";
203                                 regulator-initial-mode = <0x1>;
204                                 regulator-boot-on;
205                                 regulator-always-on;
206                                 regulator-state-mem {
207                                         regulator-mode = <0x2>;
208                                         regulator-on-in-suspend;
209                                 };
210                         };
211
212                         vcc_io: RK805_DCDC4@3 {
213                                 regulator-compatible = "RK805_DCDC4";
214                                 regulator-name = "vcc_io";
215                                 regulator-min-microvolt = <3300000>;
216                                 regulator-max-microvolt = <3300000>;
217                                 regulator-initial-mode = <0x1>;
218                                 regulator-boot-on;
219                                 regulator-always-on;
220                                 regulator-state-mem {
221                                         regulator-mode = <0x2>;
222                                         regulator-on-in-suspend;
223                                         regulator-suspend-microvolt = <3300000>;
224                                 };
225                         };
226
227                         vcc_18: RK805_LDO1@4 {
228                                 regulator-compatible = "RK805_LDO1";
229                                 regulator-name = "vcc_18";
230                                 regulator-min-microvolt = <1800000>;
231                                 regulator-max-microvolt = <1800000>;
232                                 regulator-boot-on;
233                                 regulator-always-on;
234                                 regulator-state-mem {
235                                         regulator-on-in-suspend;
236                                         regulator-suspend-microvolt = <1800000>;
237                                 };
238                         };
239
240                         vcc_18emmc: RK805_LDO2@5 {
241                                 regulator-compatible = "RK805_LDO2";
242                                 regulator-name = "vcc_18emmc";
243                                 regulator-min-microvolt = <1800000>;
244                                 regulator-max-microvolt = <1800000>;
245                                 regulator-boot-on;
246                                 regulator-always-on;
247                                 regulator-state-mem {
248                                         regulator-on-in-suspend;
249                                         regulator-suspend-microvolt = <1800000>;
250                                 };
251                         };
252
253                         vdd_10: RK805_LDO3@6 {
254                                 regulator-compatible = "RK805_LDO3";
255                                 regulator-name = "vdd_10";
256                                 regulator-min-microvolt = <1000000>;
257                                 regulator-max-microvolt = <1000000>;
258                                 regulator-boot-on;
259                                 regulator-always-on;
260                                 regulator-state-mem {
261                                         regulator-on-in-suspend;
262                                         regulator-suspend-microvolt = <1000000>;
263                                 };
264                         };
265                 };
266         };
267 };
268
269 &cpu0 {
270         cpu-supply = <&vdd_arm>;
271 };
272
273 &io_domains {
274         status = "okay";
275
276         vccio1-supply = <&vcc_io>;
277         vccio2-supply = <&vcc_io>;
278         vccio4-supply = <&vcc_io>;
279 };
280
281 &pinctrl {
282         pmic {
283                 pmic_int_l: pmic-int-l {
284                         rockchip,pins = <1 12 RK_FUNC_GPIO &pcfg_pull_up>; /* gpio1_b4 */
285                 };
286         };
287
288         sdio-pwrseq {
289                 wifi_enable_h: wifi-enable-h {
290                         rockchip,pins = <2 26 RK_FUNC_GPIO &pcfg_pull_none>;
291                 };
292         };
293
294         usb {
295                 host_vbus_drv: host-vbus-drv {
296                         rockchip,pins = <3 20 RK_FUNC_GPIO &pcfg_pull_none>;
297                 };
298         };
299
300         keys {
301                 pwr_key: pwr-key {
302                         rockchip,pins = <3 23 RK_FUNC_GPIO &pcfg_pull_up>;
303                 };
304         };
305 };
306
307 &sdio {
308         status = "okay";
309         mmc-pwrseq = <&sdio_pwrseq>;
310         assigned-clocks = <&cru SCLK_SDIO_SRC>;
311         assigned-clock-parents = <&xin24m>;
312 };
313
314 &u2phy0_host {
315         phy-supply = <&vcc_host>;
316 };