Merge tag 'renesas-fixes2-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / rk3288-rock2-square.dts
1 /*
2  * This file is dual-licensed: you can use it either under the terms
3  * of the GPL or the X11 license, at your option. Note that this dual
4  * licensing only applies to this file, and not this project as a
5  * whole.
6  *
7  *  a) This file is free software; you can redistribute it and/or
8  *     modify it under the terms of the GNU General Public License as
9  *     published by the Free Software Foundation; either version 2 of the
10  *     License, or (at your option) any later version.
11  *
12  *     This file is distributed in the hope that it will be useful,
13  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *     GNU General Public License for more details.
16  *
17  * Or, alternatively,
18  *
19  *  b) Permission is hereby granted, free of charge, to any person
20  *     obtaining a copy of this software and associated documentation
21  *     files (the "Software"), to deal in the Software without
22  *     restriction, including without limitation the rights to use,
23  *     copy, modify, merge, publish, distribute, sublicense, and/or
24  *     sell copies of the Software, and to permit persons to whom the
25  *     Software is furnished to do so, subject to the following
26  *     conditions:
27  *
28  *     The above copyright notice and this permission notice shall be
29  *     included in all copies or substantial portions of the Software.
30  *
31  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
33  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
35  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
36  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
38  *     OTHER DEALINGS IN THE SOFTWARE.
39  */
40
41 /dts-v1/;
42 #include "rk3288-rock2-som.dtsi"
43
44 / {
45         model = "Radxa Rock 2 Square";
46         compatible = "radxa,rock2-square", "rockchip,rk3288";
47
48         chosen {
49                 stdout-path = "serial2:115200n8";
50         };
51
52         gpio-leds {
53                 compatible = "gpio-leds";
54
55                 heartbeat {
56                         gpios = <&gpio7 RK_PB7 GPIO_ACTIVE_LOW>;
57                         label = "rock2:green:state1";
58                         linux,default-trigger = "heartbeat";
59                 };
60
61                 mmc {
62                         gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_LOW>;
63                         label = "rock2:blue:state2";
64                         linux,default-trigger = "mmc0";
65                 };
66         };
67
68         ir: ir-receiver {
69                 compatible = "gpio-ir-receiver";
70                 gpios = <&gpio8 RK_PA1 GPIO_ACTIVE_LOW>;
71                 pinctrl-names = "default";
72                 pinctrl-0 = <&ir_int>;
73         };
74
75         sound {
76                 compatible = "simple-audio-card";
77                 simple-audio-card,name = "SPDIF";
78                 simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
79                         cpu { sound-dai = <&spdif>; };
80                         codec { sound-dai = <&spdif_out>; };
81                 };
82         };
83
84         sata_pwr: sata-prw-regulator {
85                 compatible = "regulator-fixed";
86                 enable-active-high;
87                 gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>;
88                 pinctrl-names = "default";
89                 pinctrl-0 = <&sata_pwr_en>;
90                 /* Always turn on the 5V sata power connector */
91                 regulator-always-on;
92                 regulator-name = "sata_pwr";
93         };
94
95         spdif_out: spdif-out {
96                 compatible = "linux,spdif-dit";
97                 #sound-dai-cells = <0>;
98         };
99
100         sound-i2s {
101                 compatible = "rockchip,rk3288-hdmi-analog";
102                 pinctrl-names = "default";
103                 pinctrl-0 = <&phone_ctl>, <&hp_det>;
104                 rockchip,audio-codec = <&es8388>;
105                 rockchip,hp-det-gpios = <&gpio7 7 GPIO_ACTIVE_HIGH>;
106                 rockchip,hp-en-gpios = <&gpio8 0 GPIO_ACTIVE_HIGH>;
107                 rockchip,i2s-controller = <&i2s>;
108                 rockchip,model = "I2S";
109                 rockchip,routing = "Analog", "LOUT2",
110                                    "Analog", "ROUT2";
111         };
112
113         sdio_pwrseq: sdio-pwrseq {
114                 compatible = "mmc-pwrseq-simple";
115                 clocks = <&hym8563>;
116                 clock-names = "ext_clock";
117                 pinctrl-names = "default";
118                 pinctrl-0 = <&wifi_enable>;
119                 reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
120         };
121
122         vcc_usb_host: vcc-host-regulator {
123                 compatible = "regulator-fixed";
124                 enable-active-high;
125                 gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
126                 pinctrl-names = "default";
127                 pinctrl-0 = <&host_vbus_drv>;
128                 regulator-name = "vcc_host";
129         };
130
131         vcc_sd: sdmmc-regulator {
132                 compatible = "regulator-fixed";
133                 gpio = <&gpio7 RK_PB3 GPIO_ACTIVE_LOW>;
134                 pinctrl-names = "default";
135                 pinctrl-0 = <&sdmmc_pwr>;
136                 regulator-name = "vcc_sd";
137                 regulator-min-microvolt = <3300000>;
138                 regulator-max-microvolt = <3300000>;
139                 vin-supply = <&vcc_io>;
140         };
141 };
142
143 &sdio0 {
144         bus-width = <4>;
145         cap-sd-highspeed;
146         cap-sdio-irq;
147         disable-wp;
148         mmc-pwrseq = <&sdio_pwrseq>;
149         non-removable;
150         num-slots = <1>;
151         pinctrl-names = "default";
152         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
153         vmmc-supply = <&vcc_io>;
154         vqmmc-supply = <&vcc_18>;
155         status = "okay";
156 };
157
158 &sdmmc {
159         bus-width = <4>;
160         cap-mmc-highspeed;
161         cap-sd-highspeed;
162         card-detect-delay = <200>;
163         disable-wp;     /* wp not hooked up */
164         num-slots = <1>;
165         pinctrl-names = "default";
166         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
167         vmmc-supply = <&vcc_sd>;
168         vqmmc-supply = <&vccio_sd>;
169         status = "okay";
170 };
171
172 &gmac {
173         status = "ok";
174 };
175
176 &hdmi {
177         ddc-i2c-bus = <&i2c5>;
178         status = "okay";
179 };
180
181 &i2c0 {
182         hym8563: hym8563@51 {
183                 compatible = "haoyu,hym8563";
184                 reg = <0x51>;
185                 #clock-cells = <0>;
186                 clock-frequency = <32768>;
187                 clock-output-names = "xin32k";
188                 interrupt-parent = <&gpio0>;
189                 interrupts = <RK_PA4 IRQ_TYPE_EDGE_FALLING>;
190                 pinctrl-names = "default";
191                 pinctrl-0 = <&pmic_int>;
192
193         };
194 };
195
196 &i2c2 {
197         status = "okay";
198
199         es8388: es8388@10 {
200                 compatible = "everest,es8388", "everest,es8328";
201                 reg = <0x10>;
202                 AVDD-supply = <&vccio_codec>;
203                 DVDD-supply = <&vccio_codec>;
204                 HPVDD-supply = <&vccio_codec>;
205                 PVDD-supply = <&vccio_codec>;
206                 clocks = <&cru SCLK_I2S0_OUT>;
207         };
208 };
209
210 &i2c5 {
211         status = "okay";
212 };
213
214 &i2s {
215         status = "okay";
216 };
217
218 &pinctrl {
219         ir {
220                 ir_int: ir-int {
221                         rockchip,pins = <8 1 RK_FUNC_GPIO &pcfg_pull_up>;
222                 };
223         };
224
225         pmic {
226                 pmic_int: pmic-int {
227                         rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_up>;
228                 };
229         };
230
231         headphone {
232                 hp_det: hp-det {
233                         rockchip,pins = <7 7 RK_FUNC_GPIO &pcfg_pull_none>;
234                 };
235
236                 phone_ctl: phone-ctl {
237                         rockchip,pins = <8 0 RK_FUNC_GPIO &pcfg_pull_up>;
238                 };
239         };
240
241         usb {
242                 host_vbus_drv: host-vbus-drv {
243                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
244                 };
245         };
246
247         sata {
248                 sata_pwr_en: sata-pwr-en {
249                         rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>;
250                 };
251         };
252
253         sdmmc {
254                 sdmmc_pwr: sdmmc-pwr {
255                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
256                 };
257         };
258
259         sdio {
260                 wifi_enable: wifi-enable {
261                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
262                 };
263         };
264 };
265
266 &spdif {
267         status = "okay";
268 };
269
270 &uart2 {
271         status = "okay";
272 };
273
274 &usbphy {
275         status = "okay";
276 };
277
278 &usbphy1 {
279         vbus-supply = <&vcc_usb_host>;
280 };
281
282 &usb_host0_ehci {
283         status = "okay";
284 };
285
286 &usb_host1 {
287         status = "okay";
288 };