xref: /OK3568_Linux_fs/u-boot/arch/arm/dts/rk3288-tinker.dtsi (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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#include "rk3288.dtsi"
42#include "rk3288-u-boot.dtsi"
43
44/ {
45	memory {
46		device_type = "memory";
47		reg = <0x0 0x80000000>;
48	};
49
50	ext_gmac: external-gmac-clock {
51		compatible = "fixed-clock";
52		clock-frequency = <125000000>;
53		clock-output-names = "ext_gmac";
54		#clock-cells = <0>;
55	};
56
57	gpio-keys {
58		compatible = "gpio-keys";
59		#address-cells = <1>;
60		#size-cells = <0>;
61		autorepeat;
62
63		pinctrl-names = "default";
64		pinctrl-0 = <&pwrbtn>;
65
66		button@0 {
67			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
68			label = "GPIO Key Power";
69			linux,input-type = <1>;
70			gpio-key,wakeup = <1>;
71			debounce-interval = <100>;
72		};
73	};
74
75	gpio-leds {
76		compatible = "gpio-leds";
77
78		pwr-led {
79			gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
80			linux,default-trigger = "default-on";
81		};
82
83		act-led {
84			gpios=<&gpio2 3 GPIO_ACTIVE_LOW>;
85			linux,default-trigger="mmc0";
86		};
87	};
88
89	vcc_sys: vsys-regulator {
90		compatible = "regulator-fixed";
91		regulator-name = "vcc_sys";
92		regulator-min-microvolt = <5000000>;
93		regulator-max-microvolt = <5000000>;
94		regulator-always-on;
95		regulator-boot-on;
96	};
97
98	/*
99	 * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
100	 * vcc_io directly.  Those boards won't be able to power cycle SD cards
101	 * but it shouldn't hurt to toggle this pin there anyway.
102	 */
103	vcc_sd: sdmmc-regulator {
104		compatible = "regulator-fixed";
105		gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
106		pinctrl-names = "default";
107		pinctrl-0 = <&sdmmc_pwr>;
108		regulator-name = "vcc_sd";
109		regulator-min-microvolt = <3300000>;
110		regulator-max-microvolt = <3300000>;
111		startup-delay-us = <100000>;
112		vin-supply = <&vcc_io>;
113	};
114
115	vcc5v0_host: usb-host-regulator {
116		compatible = "regulator-fixed";
117		enable-active-high;
118		gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
119		pinctrl-names = "default";
120		pinctrl-0 = <&host_vbus_drv>;
121		regulator-name = "vcc5v0_host";
122		regulator-min-microvolt = <5000000>;
123		regulator-max-microvolt = <5000000>;
124		regulator-always-on;
125	};
126};
127
128&cpu0 {
129	cpu0-supply = <&vdd_cpu>;
130};
131
132&sdmmc {
133	bus-width = <4>;
134	cap-mmc-highspeed;
135	cap-sd-highspeed;
136	card-detect-delay = <200>;
137	disable-wp;			/* wp not hooked up */
138	num-slots = <1>;
139	pinctrl-names = "default";
140	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
141	status = "okay";
142	supports-sd;
143	vmmc-supply = <&vcc_sd>;
144	vqmmc-supply = <&vccio_sd>;
145};
146
147&gpu {
148	mali-supply = <&vdd_gpu>;
149	status = "okay";
150};
151
152&gmac {
153	phy-supply = <&vcc33_lan>;
154	phy-mode = "rgmii";
155	clock_in_out = "input";
156	snps,reset-gpio = <&gpio4 7 0>;
157	snps,reset-active-low;
158	snps,reset-delays-us = <0 10000 1000000>;
159	assigned-clocks = <&cru SCLK_MAC>;
160	assigned-clock-parents = <&ext_gmac>;
161	pinctrl-names = "default";
162	pinctrl-0 = <&rgmii_pins>;
163	tx_delay = <0x30>;
164	rx_delay = <0x10>;
165	status = "okay";
166};
167
168&hdmi {
169	ddc-i2c-bus = <&i2c5>;
170	status = "okay";
171};
172
173&i2c0 {
174	status = "okay";
175	clock-frequency = <400000>;
176
177	rk808: pmic@1b {
178		compatible = "rockchip,rk808";
179		reg = <0x1b>;
180		interrupt-parent = <&gpio0>;
181		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
182		pinctrl-names = "default";
183		pinctrl-0 = <&pmic_int &global_pwroff>;
184		rockchip,system-power-controller;
185		wakeup-source;
186		#clock-cells = <1>;
187		clock-output-names = "xin32k", "rk808-clkout2";
188
189		vcc1-supply = <&vcc_sys>;
190		vcc2-supply = <&vcc_sys>;
191		vcc3-supply = <&vcc_sys>;
192		vcc4-supply = <&vcc_sys>;
193		vcc6-supply = <&vcc_sys>;
194		vcc7-supply = <&vcc_sys>;
195		vcc8-supply = <&vcc_18>;
196		vcc9-supply = <&vcc_io>;
197		vcc10-supply = <&vcc_io>;
198		vcc11-supply = <&vcc_sys>;
199		vcc12-supply = <&vcc_io>;
200		vddio-supply = <&vcc18_ldo1>;
201
202		regulators {
203			vdd_cpu: DCDC_REG1 {
204				regulator-always-on;
205				regulator-boot-on;
206				regulator-min-microvolt = <750000>;
207				regulator-max-microvolt = <1350000>;
208				regulator-name = "vdd_arm";
209				regulator-state-mem {
210					regulator-off-in-suspend;
211				};
212			};
213
214			vdd_gpu: DCDC_REG2 {
215				regulator-always-on;
216				regulator-boot-on;
217				regulator-min-microvolt = <850000>;
218				regulator-max-microvolt = <1250000>;
219				regulator-name = "vdd_gpu";
220				regulator-state-mem {
221					regulator-on-in-suspend;
222					regulator-suspend-microvolt = <1000000>;
223				};
224			};
225
226			vcc_ddr: DCDC_REG3 {
227				regulator-always-on;
228				regulator-boot-on;
229				regulator-name = "vcc_ddr";
230				regulator-state-mem {
231					regulator-on-in-suspend;
232				};
233			};
234
235			vcc_io: DCDC_REG4 {
236				regulator-always-on;
237				regulator-boot-on;
238				regulator-min-microvolt = <3300000>;
239				regulator-max-microvolt = <3300000>;
240				regulator-name = "vcc_io";
241				regulator-state-mem {
242					regulator-on-in-suspend;
243					regulator-suspend-microvolt = <3300000>;
244				};
245			};
246
247			vcc18_ldo1: LDO_REG1 {
248				regulator-always-on;
249				regulator-boot-on;
250				regulator-min-microvolt = <1800000>;
251				regulator-max-microvolt = <1800000>;
252				regulator-name = "vcc18_ldo1";
253				regulator-state-mem {
254					regulator-on-in-suspend;
255					regulator-suspend-microvolt = <1800000>;
256				};
257			};
258
259			vcc33_mipi: LDO_REG2 {
260				regulator-always-on;
261				regulator-boot-on;
262				regulator-min-microvolt = <3300000>;
263				regulator-max-microvolt = <3300000>;
264				regulator-name = "vcc33_mipi";
265				regulator-state-mem {
266					regulator-off-in-suspend;
267				};
268			};
269
270			vdd_10: LDO_REG3 {
271				regulator-always-on;
272				regulator-boot-on;
273				regulator-min-microvolt = <1000000>;
274				regulator-max-microvolt = <1000000>;
275				regulator-name = "vdd_10";
276				regulator-state-mem {
277					regulator-on-in-suspend;
278					regulator-suspend-microvolt = <1000000>;
279				};
280			};
281
282			vcc18_codec: LDO_REG4 {
283				regulator-always-on;
284				regulator-boot-on;
285				regulator-min-microvolt = <1800000>;
286				regulator-max-microvolt = <1800000>;
287				regulator-name = "vcc18_codec";
288				regulator-state-mem {
289					regulator-on-in-suspend;
290					regulator-suspend-microvolt = <1800000>;
291				};
292			};
293
294			vccio_sd: LDO_REG5 {
295				regulator-always-on;
296				regulator-boot-on;
297				regulator-min-microvolt = <1800000>;
298				regulator-max-microvolt = <3300000>;
299				regulator-name = "vccio_sd";
300				regulator-state-mem {
301					regulator-on-in-suspend;
302					regulator-suspend-microvolt = <3300000>;
303				};
304			};
305
306			vdd10_lcd: LDO_REG6 {
307				regulator-always-on;
308				regulator-boot-on;
309				regulator-min-microvolt = <1000000>;
310				regulator-max-microvolt = <1000000>;
311				regulator-name = "vdd10_lcd";
312				regulator-state-mem {
313					regulator-on-in-suspend;
314					regulator-suspend-microvolt = <1000000>;
315				};
316			};
317
318			vcc_18: LDO_REG7 {
319				regulator-always-on;
320				regulator-boot-on;
321				regulator-min-microvolt = <1800000>;
322				regulator-max-microvolt = <1800000>;
323				regulator-name = "vcc_18";
324				regulator-state-mem {
325					regulator-on-in-suspend;
326					regulator-suspend-microvolt = <1800000>;
327				};
328			};
329
330			vcc18_lcd: LDO_REG8 {
331				regulator-always-on;
332				regulator-boot-on;
333				regulator-min-microvolt = <1800000>;
334				regulator-max-microvolt = <1800000>;
335				regulator-name = "vcc18_lcd";
336				regulator-state-mem {
337					regulator-on-in-suspend;
338					regulator-suspend-microvolt = <1800000>;
339				};
340			};
341
342			vcc33_sd: SWITCH_REG1 {
343				regulator-always-on;
344				regulator-boot-on;
345				regulator-name = "vcc33_sd";
346				regulator-state-mem {
347					regulator-on-in-suspend;
348				};
349			};
350
351			vcc33_lan: SWITCH_REG2 {
352				regulator-always-on;
353				regulator-boot-on;
354				regulator-name = "vcc33_lan";
355				regulator-state-mem {
356					regulator-on-in-suspend;
357				};
358			};
359		};
360	};
361};
362
363&i2c2 {
364	status = "okay";
365	headset: nau8825@1a {
366		compatible = "nuvoton,nau8825";
367		#sound-dai-cells = <0>;
368		reg = <0x1a>;
369		interrupt-parent = <&gpio6>;
370		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
371		nuvoton,jkdet-enable = <1>;
372		nuvoton,jkdet-pull-enable = <1>;
373		nuvoton,jkdet-pull-up = <0>;
374		nuvoton,jkdet-polarity = <1>;
375		nuvoton,vref-impedance = <2>;
376		nuvoton,micbias-voltage = <6>;
377		nuvoton,sar-threshold-num = <4>;
378		nuvoton,sar-threshold = <0xa 0x14 0x26 0x73>;
379		nuvoton,sar-hysteresis = <0>;
380		nuvoton,sar-voltage = <6>;
381		nuvoton,sar-compare-time = <0>;
382		nuvoton,sar-sampling-time = <0>;
383		nuvoton,short-key-debounce = <3>;
384		nuvoton,jack-insert-debounce = <7>;
385		nuvoton,jack-eject-debounce = <7>;
386		clock-names = "mclk";
387		clocks = <&cru SCLK_I2S0_OUT>;
388	};
389};
390
391&i2c5 {
392	status = "okay";
393};
394
395&wdt {
396	status = "okay";
397};
398
399&pwm0 {
400	status = "okay";
401};
402
403&saradc {
404	vref-supply = <&vcc18_ldo1>;
405	status ="okay";
406};
407
408&uart0 {
409	status = "okay";
410};
411
412&uart1 {
413	status = "okay";
414};
415
416&uart2 {
417	status = "okay";
418};
419
420&uart3 {
421	status = "okay";
422};
423
424&uart4 {
425	status = "okay";
426};
427
428&tsadc {
429	rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
430	rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
431	status = "okay";
432};
433
434&usbphy {
435	status = "okay";
436};
437
438&usb_host0_ehci {
439	status = "okay";
440};
441
442&usb_host1 {
443	status = "okay";
444};
445
446&usb_otg {
447	status= "okay";
448};
449
450&vopb {
451	status = "okay";
452};
453
454&vopb_mmu {
455	status = "okay";
456};
457
458&vopl {
459	status = "okay";
460};
461
462&vopl_mmu {
463	status = "okay";
464};
465
466&pinctrl {
467	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
468		drive-strength = <8>;
469	};
470
471	pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
472		bias-pull-up;
473		drive-strength = <8>;
474	};
475
476	backlight {
477		bl_en: bl-en {
478			rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
479		};
480	};
481
482	buttons {
483		pwrbtn: pwrbtn {
484			rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
485		};
486	};
487
488	eth_phy {
489		eth_phy_pwr: eth-phy-pwr {
490			rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
491		};
492	};
493
494	pmic {
495		pmic_int: pmic-int {
496			rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
497		};
498	};
499
500	sdmmc {
501		/*
502		 * Default drive strength isn't enough to achieve even
503		 * high-speed mode on EVB board so bump up to 8ma.
504		 */
505		sdmmc_bus4: sdmmc-bus4 {
506			rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
507					<6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
508					<6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
509					<6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
510		};
511
512		sdmmc_clk: sdmmc-clk {
513			rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
514		};
515
516		sdmmc_cmd: sdmmc-cmd {
517			rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
518		};
519
520		sdmmc_pwr: sdmmc-pwr {
521			rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
522		};
523	};
524
525	usb {
526		host_vbus_drv: host-vbus-drv {
527			rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
528		};
529
530		pwr_3g: pwr-3g {
531			rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
532		};
533	};
534};
535