rockchip: Add basic support for phyCORE-RK3288 SoM based carrier board
[platform/kernel/u-boot.git] / arch / arm / dts / rk3288-phycore-rdk.dts
1 /*
2  * Device tree file for Phytec PCM-947 carrier board
3  * Copyright (C) 2017 PHYTEC Messtechnik GmbH
4  * Author: Wadim Egorov <w.egorov@phytec.de>
5  *
6  * This file is dual-licensed: you can use it either under the terms
7  * of the GPL or the X11 license, at your option. Note that this dual
8  * licensing only applies to this file, and not this project as a
9  * whole.
10  *
11  *  a) This file is free software; you can redistribute it and/or
12  *     modify it under the terms of the GNU General Public License as
13  *     published by the Free Software Foundation; either version 2 of the
14  *     License, or (at your option) any later version.
15  *
16  *     This file is distributed in the hope that it will be useful,
17  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *     GNU General Public License for more details.
20  *
21  * Or, alternatively,
22  *
23  *  b) Permission is hereby granted, free of charge, to any person
24  *     obtaining a copy of this software and associated documentation
25  *     files (the "Software"), to deal in the Software without
26  *     restriction, including without limitation the rights to use,
27  *     copy, modify, merge, publish, distribute, sublicense, and/or
28  *     sell copies of the Software, and to permit persons to whom the
29  *     Software is furnished to do so, subject to the following
30  *     conditions:
31  *
32  *     The above copyright notice and this permission notice shall be
33  *     included in all copies or substantial portions of the Software.
34  *
35  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42  *     OTHER DEALINGS IN THE SOFTWARE.
43  */
44
45 /dts-v1/;
46
47 #include <dt-bindings/input/input.h>
48 #include "rk3288-phycore-som.dtsi"
49
50 / {
51         model = "Phytec RK3288 PCM-947";
52         compatible = "phytec,rk3288-pcm-947", "phytec,rk3288-phycore-som", "rockchip,rk3288";
53
54         chosen {
55                 stdout-path = &uart2;
56         };
57
58         config {
59                 u-boot,dm-pre-reloc;
60                 u-boot,boot0 = &emmc;
61         };
62
63         user_buttons: user-buttons {
64                 compatible = "gpio-keys";
65                 pinctrl-names = "default";
66                 pinctrl-0 = <&user_button_pins>;
67
68                 button@0 {
69                         label = "home";
70                         linux,code = <KEY_HOME>;
71                         gpios = <&gpio8 0 GPIO_ACTIVE_HIGH>;
72                         wakeup-source;
73                 };
74
75                 button@1 {
76                         label = "menu";
77                         linux,code = <KEY_MENU>;
78                         gpios = <&gpio8 3 GPIO_ACTIVE_HIGH>;
79                         wakeup-source;
80                 };
81         };
82
83         vcc_host0_5v: usb-host0-regulator {
84                 compatible = "regulator-fixed";
85                 gpio = <&gpio2 13 GPIO_ACTIVE_HIGH>;
86                 pinctrl-names = "default";
87                 pinctrl-0 = <&host0_vbus_drv>;
88                 regulator-name = "vcc_host0_5v";
89                 regulator-min-microvolt = <5000000>;
90                 regulator-max-microvolt = <5000000>;
91                 regulator-always-on;
92                 vin-supply = <&vdd_in_otg_out>;
93         };
94
95         vcc_host1_5v: usb-host1-regulator {
96                 compatible = "regulator-fixed";
97                 gpio = <&gpio2 0 GPIO_ACTIVE_HIGH>;
98                 pinctrl-names = "default";
99                 pinctrl-0 = <&host1_vbus_drv>;
100                 regulator-name = "vcc_host1_5v";
101                 regulator-min-microvolt = <5000000>;
102                 regulator-max-microvolt = <5000000>;
103                 regulator-always-on;
104                 vin-supply = <&vdd_in_otg_out>;
105         };
106
107         vcc_otg_5v: usb-otg-regulator {
108                 compatible = "regulator-fixed";
109                 gpio = <&gpio2 12 GPIO_ACTIVE_HIGH>;
110                 pinctrl-names = "default";
111                 pinctrl-0 = <&otg_vbus_drv>;
112                 regulator-name = "vcc_otg_5v";
113                 regulator-min-microvolt = <5000000>;
114                 regulator-max-microvolt = <5000000>;
115                 regulator-always-on;
116                 vin-supply = <&vdd_in_otg_out>;
117         };
118 };
119
120 &dmc {
121         rockchip,num-channels = <2>;
122         rockchip,pctl-timing = <0x29a 0xc8 0x1f8 0x42 0x4e 0x4 0xea 0xa
123                 0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7
124                 0x5 0xa 0x5 0x200 0x5 0x10 0x40 0x0
125                 0x1 0x7 0x7 0x4 0xc 0x43 0x100 0x0
126                 0x5 0x0>;
127         rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
128                 0xa60 0x40 0x10 0x0>;
129         rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xe 0xe>;
130         rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 5 1>;
131 };
132
133 &gmac {
134         status = "okay";
135 };
136
137 &hdmi {
138         status = "okay";
139 };
140
141 &i2c1 {
142         status = "okay";
143
144         touchscreen@44 {
145                 compatible = "st,stmpe811";
146                 reg = <0x44>;
147         };
148
149         adc@64 {
150                 compatible = "maxim,max1037";
151                 reg = <0x64>;
152         };
153
154         i2c_rtc: rtc@68 {
155                 compatible = "rv4162";
156                 reg = <0x68>;
157                 pinctrl-names = "default";
158                 pinctrl-0 = <&i2c_rtc_int>;
159                 interrupt-parent = <&gpio5>;
160                 interrupts = <10 0>;
161         };
162 };
163
164 &i2c3 {
165         status = "okay";
166
167         i2c_eeprom_cb: eeprom@51 {
168                 compatible = "atmel,24c32";
169                 reg = <0x51>;
170                 pagesize = <32>;
171         };
172 };
173
174 &i2c4 {
175         status = "okay";
176 };
177
178 &i2c5 {
179         status = "okay";
180 };
181
182 &pinctrl {
183         u-boot,dm-pre-reloc;
184
185         pcfg_pull_up_drv_12ma: pcfg-pull-up-drv-12ma {
186                 bias-pull-up;
187                 drive-strength = <12>;
188         };
189
190         buttons {
191                 user_button_pins: user-button-pins {
192                         /* button 1 */
193                         rockchip,pins = <8 3 RK_FUNC_GPIO &pcfg_pull_up>,
194                         /* button 2 */
195                                         <8 0 RK_FUNC_GPIO &pcfg_pull_up>;
196                 };
197         };
198
199         rv4162 {
200                 i2c_rtc_int: i2c-rtc-int {
201                         rockchip,pins = <5 10 RK_FUNC_GPIO &pcfg_pull_up>;
202                 };
203         };
204
205         sdmmc {
206                 /*
207                  * Default drive strength isn't enough to achieve even
208                  * high-speed mode on pcm-947 board so bump up to 12 mA.
209                  */
210                 sdmmc_bus4: sdmmc-bus4 {
211                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_12ma>,
212                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_12ma>,
213                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_12ma>,
214                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_12ma>;
215                 };
216
217                 sdmmc_clk: sdmmc-clk {
218                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_12ma>;
219                 };
220
221                 sdmmc_cmd: sdmmc-cmd {
222                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_12ma>;
223                 };
224
225                 sdmmc_pwr: sdmmc-pwr {
226                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
227                 };
228         };
229
230         touchscreen {
231                 ts_irq_pin: ts-irq-pin {
232                         rockchip,pins = <5 15 RK_FUNC_GPIO &pcfg_pull_none>;
233                 };
234         };
235
236         usb_host {
237                 host0_vbus_drv: host0-vbus-drv {
238                         rockchip,pins = <2 13 RK_FUNC_GPIO &pcfg_pull_none>;
239                 };
240
241                 host1_vbus_drv: host1-vbus-drv {
242                         rockchip,pins = <2 0 RK_FUNC_GPIO &pcfg_pull_none>;
243                 };
244         };
245
246         usb_otg {
247                 otg_vbus_drv: otg-vbus-drv {
248                         rockchip,pins = <2 12 RK_FUNC_GPIO &pcfg_pull_none>;
249                 };
250         };
251 };
252
253 &sdmmc {
254         u-boot,dm-pre-reloc;
255
256         bus-width = <4>;
257         cap-mmc-highspeed;
258         cap-sd-highspeed;
259         card-detect-delay = <200>;
260         disable-wp;
261         num-slots = <1>;
262         pinctrl-names = "default";
263         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
264         vmmc-supply = <&vdd_io_sd>;
265         vqmmc-supply = <&vdd_io_sd>;
266         status = "okay";
267 };
268
269 &uart0 {
270         pinctrl-names = "default";
271         pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
272         status = "okay";
273 };
274
275 &uart2 {
276         u-boot,dm-pre-reloc;
277         status = "okay";
278 };
279
280 &usbphy {
281         status = "okay";
282 };
283
284 &usb_host0_ehci {
285         status = "okay";
286 };
287
288 &usb_host1 {
289         status = "okay";
290 };
291
292 &usb_otg {
293         status = "okay";
294 };