1/*
2 * Copyright (c) 2016 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#include "rk3368.dtsi"
45#include <dt-bindings/input/input.h>
46
47/ {
48	model = "Rockchip PX5 EVB";
49	compatible = "rockchip,px5-evb", "rockchip,px5", "rockchip,rk3368";
50
51	chosen {
52		stdout-path = "serial4:115200n8";
53	};
54
55	memory@0 {
56		reg = <0x0 0x0 0x0 0x40000000>;
57		device_type = "memory";
58	};
59
60	keys: gpio-keys {
61		compatible = "gpio-keys";
62		pinctrl-names = "default";
63		pinctrl-0 = <&pwr_key>;
64
65		power {
66			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
67			label = "GPIO Power";
68			linux,code = <KEY_POWER>;
69			wakeup-source;
70		};
71	};
72
73	vcc_sys: vcc-sys-regulator {
74		compatible = "regulator-fixed";
75		regulator-name = "vcc_sys";
76		regulator-min-microvolt = <5000000>;
77		regulator-max-microvolt = <5000000>;
78		regulator-always-on;
79		regulator-boot-on;
80	};
81};
82
83&emmc {
84	status = "okay";
85	bus-width = <8>;
86	cap-mmc-highspeed;
87	clock-frequency = <150000000>;
88	disable-wp;
89	keep-power-in-suspend;
90	mmc-hs200-1_8v;
91	no-sdio;
92	no-sd;
93	non-removable;
94	num-slots = <1>;
95	pinctrl-names = "default";
96	pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
97	vmmc-supply = <&vcc_io>;
98	vqmmc-supply = <&vcc18_flash>;
99};
100
101&i2c0 {
102	status = "okay";
103
104	rk808: pmic@1b {
105		compatible = "rockchip,rk808";
106		reg = <0x1b>;
107		interrupt-parent = <&gpio0>;
108		interrupts = <RK_PA5 IRQ_TYPE_LEVEL_LOW>;
109		pinctrl-names = "default";
110		pinctrl-0 = <&pmic_int>, <&pmic_sleep>;
111		rockchip,system-power-controller;
112		vcc1-supply = <&vcc_sys>;
113		vcc2-supply = <&vcc_sys>;
114		vcc3-supply = <&vcc_sys>;
115		vcc4-supply = <&vcc_sys>;
116		vcc6-supply = <&vcc_sys>;
117		vcc7-supply = <&vcc_sys>;
118		vcc8-supply = <&vcc_io>;
119		vcc9-supply = <&vcc_sys>;
120		vcc10-supply = <&vcc_sys>;
121		vcc11-supply = <&vcc_sys>;
122		vcc12-supply = <&vcc_io>;
123		clock-output-names = "xin32k", "rk808-clkout2";
124		#clock-cells = <1>;
125
126		regulators {
127			vdd_cpu: DCDC_REG1 {
128				regulator-always-on;
129				regulator-boot-on;
130				regulator-min-microvolt = <700000>;
131				regulator-max-microvolt = <1500000>;
132				regulator-name = "vdd_cpu";
133			};
134
135			vdd_log: DCDC_REG2 {
136				regulator-always-on;
137				regulator-boot-on;
138				regulator-min-microvolt = <700000>;
139				regulator-max-microvolt = <1500000>;
140				regulator-name = "vdd_log";
141			};
142
143			vcc_ddr: DCDC_REG3 {
144				regulator-always-on;
145				regulator-boot-on;
146				regulator-name = "vcc_ddr";
147			};
148
149			vcc_io: DCDC_REG4 {
150				regulator-always-on;
151				regulator-boot-on;
152				regulator-min-microvolt = <3300000>;
153				regulator-max-microvolt = <3300000>;
154				regulator-name = "vcc_io";
155			};
156
157			vcc18_flash: LDO_REG1 {
158				regulator-always-on;
159				regulator-boot-on;
160				regulator-min-microvolt = <1800000>;
161				regulator-max-microvolt = <1800000>;
162				regulator-name = "vcc18_flash";
163			};
164
165			vcca_33: LDO_REG2 {
166				regulator-always-on;
167				regulator-boot-on;
168				regulator-min-microvolt = <3300000>;
169				regulator-max-microvolt = <3300000>;
170				regulator-name = "vcca_33";
171			};
172
173			vdd_10: LDO_REG3 {
174				regulator-always-on;
175				regulator-boot-on;
176				regulator-min-microvolt = <1000000>;
177				regulator-max-microvolt = <1000000>;
178				regulator-name = "vdd_10";
179			};
180
181			avdd_33: LDO_REG4 {
182				regulator-min-microvolt = <3300000>;
183				regulator-max-microvolt = <3300000>;
184				regulator-name = "avdd_33";
185			};
186
187			vccio_sd: LDO_REG5 {
188				regulator-always-on;
189				regulator-boot-on;
190				regulator-min-microvolt = <1800000>;
191				regulator-max-microvolt = <3300000>;
192				regulator-name = "vccio_sd";
193			};
194
195			vdd10_lcd: LDO_REG6 {
196				regulator-always-on;
197				regulator-boot-on;
198				regulator-min-microvolt = <1000000>;
199				regulator-max-microvolt = <1000000>;
200				regulator-name = "vdd10_lcd";
201			};
202
203			vcc_18: LDO_REG7 {
204				regulator-always-on;
205				regulator-boot-on;
206				regulator-min-microvolt = <1800000>;
207				regulator-max-microvolt = <1800000>;
208				regulator-name = "vcc_18";
209			};
210
211			vcc18_lcd: LDO_REG8 {
212				regulator-always-on;
213				regulator-boot-on;
214				regulator-min-microvolt = <1800000>;
215				regulator-max-microvolt = <1800000>;
216				regulator-name = "vcc18_lcd";
217			};
218
219			vcc_sd: SWITCH_REG1 {
220				regulator-name = "vcc_sd";
221			};
222
223			vcc33_lcd: SWITCH_REG2 {
224				regulator-always-on;
225				regulator-boot-on;
226				regulator-name = "vcc33_lcd";
227			};
228		};
229	};
230};
231
232&i2c1 {
233	status = "okay";
234
235	accelerometer@18 {
236		compatible = "bosch,bma250";
237		reg = <0x18>;
238		interrupt-parent = <&gpio2>;
239		interrupts = <RK_PC1 IRQ_TYPE_LEVEL_LOW>;
240	};
241};
242
243&i2c2 {
244	status = "okay";
245
246	gsl1680: touchscreen@40 {
247		compatible = "silead,gsl1680";
248		reg = <0x40>;
249		interrupt-parent = <&gpio3>;
250		interrupts = <RK_PD4 IRQ_TYPE_EDGE_FALLING>;
251		power-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
252		touchscreen-size-x = <800>;
253		touchscreen-size-y = <1280>;
254		silead,max-fingers = <5>;
255	};
256};
257
258&pinctrl {
259	keys {
260		pwr_key: pwr-key {
261			rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_none>;
262		};
263	};
264
265	pmic {
266		pmic_sleep: pmic-sleep {
267			rockchip,pins = <0 0 RK_FUNC_2 &pcfg_pull_none>;
268		};
269
270		pmic_int: pmic-int {
271			rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
272		};
273	};
274};
275
276&sdmmc {
277	status = "okay";
278	bus-width = <4>;
279	cap-mmc-highspeed;
280	cap-sd-highspeed;
281	card-detect-delay = <200>;
282	no-emmc;
283	no-sdio;
284	num-slots = <1>;
285	sd-uhs-sdr12;
286	sd-uhs-sdr25;
287	pinctrl-names = "default";
288	pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_bus4>, <&sdmmc_cd>;
289	rockchip,default-sample-phase = <90>;
290	vmmc-supply = <&vcc_sd>;
291	vqmmc-supply = <&vccio_sd>;
292};
293
294&tsadc {
295	status = "okay";
296	rockchip,hw-tshut-mode = <0>; /* CRU */
297	rockchip,hw-tshut-polarity = <1>; /* high */
298};
299
300&uart4 {
301	status = "okay";
302};
303
304&usb_host0_ehci {
305	status = "okay";
306};
307
308&usb_otg {
309	status = "okay";
310};
311
312&wdt {
313	status = "okay";
314};
315