xref: /OK3568_Linux_fs/kernel/arch/arm/boot/dts/rk3288-miniarm.dts (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/dts-v1/;
42#include <dt-bindings/clock/rockchip,rk808.h>
43#include "rk3288.dtsi"
44#include "rk3288-rkisp1.dtsi"
45#include "rk3288-linux.dtsi"
46
47/ {
48	compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
49
50	memory {
51		device_type = "memory";
52		reg = <0x0 0x0 0x0 0x80000000>;
53	};
54
55	wireless-bluetooth {
56		compatible = "bluetooth-platdata";
57		uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
58		pinctrl-names = "default","rts_gpio";
59		pinctrl-0 = <&uart0_rts>;
60		pinctrl-1 = <&uart0_gpios>;
61		BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
62		BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
63		BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
64		status = "okay";
65	};
66
67	wireless-wlan {
68		compatible = "wlan-platdata";
69		rockchip,grf = <&grf>;
70		wifi_chip_type = "ap6212";
71		sdio_vref = <1800>;
72		WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
73		status = "okay";
74	};
75
76	ext_gmac: external-gmac-clock {
77		compatible = "fixed-clock";
78		clock-frequency = <125000000>;
79		clock-output-names = "ext_gmac";
80		#clock-cells = <0>;
81	};
82
83	sdio_pwrseq: sdio-pwrseq {
84		compatible = "mmc-pwrseq-simple";
85		clocks = <&rk808 RK808_CLKOUT1>;
86		clock-names = "ext_clock";
87		pinctrl-names = "default";
88		pinctrl-0 = <&chip_enable_h>, <&wifi_enable_h>;
89
90		/*
91		 * On the module itself this is one of these (depending
92		 * on the actual card populated):
93		 * - SDIO_RESET_L_WL_REG_ON
94		 * - PDN (power down when low)
95		 */
96		reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>,
97			<&gpio4 27 GPIO_ACTIVE_LOW>;
98	};
99
100	gpio-keys {
101		compatible = "gpio-keys";
102		#address-cells = <1>;
103		#size-cells = <0>;
104		autorepeat;
105
106		pinctrl-names = "default";
107		pinctrl-0 = <&pwrbtn>;
108
109		button@0 {
110			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
111			linux,code = <116>;
112			label = "GPIO Key Power";
113			linux,input-type = <1>;
114			gpio-key,wakeup = <1>;
115			debounce-interval = <100>;
116		};
117	};
118
119	gpio-leds {
120		compatible = "gpio-leds";
121
122		pwr-led {
123			gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
124			linux,default-trigger = "default-on";
125		};
126
127		act-led {
128			gpios=<&gpio1 24 GPIO_ACTIVE_HIGH>;
129			linux,default-trigger="mmc0";
130		};
131
132		led1-led {
133			gpios=<&gpio1 25 GPIO_ACTIVE_HIGH>;
134			linux,default-trigger="default-off";
135		};
136	};
137
138	sound {
139		compatible = "simple-audio-card";
140		simple-audio-card,format = "i2s";
141		simple-audio-card,name = "rockchip,miniarm-codec";
142		simple-audio-card,mclk-fs = <512>;
143		simple-audio-card,cpu {
144			sound-dai = <&i2s>;
145		};
146		simple-audio-card,codec {
147			sound-dai = <&hdmi>;
148		};
149	};
150
151	vcc_sys: vsys-regulator {
152		compatible = "regulator-fixed";
153		regulator-name = "vcc_sys";
154		regulator-min-microvolt = <5000000>;
155		regulator-max-microvolt = <5000000>;
156		regulator-always-on;
157		regulator-boot-on;
158	};
159
160	/*
161	 * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
162	 * vcc_io directly.  Those boards won't be able to power cycle SD cards
163	 * but it shouldn't hurt to toggle this pin there anyway.
164	 */
165	vcc_sd: sdmmc-regulator {
166		compatible = "regulator-fixed";
167		gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
168		pinctrl-names = "default";
169		pinctrl-0 = <&sdmmc_pwr>;
170		regulator-name = "vcc_sd";
171		regulator-min-microvolt = <3300000>;
172		regulator-max-microvolt = <3300000>;
173		startup-delay-us = <100000>;
174		vin-supply = <&vcc_io>;
175	};
176
177	vcc_cam: vcc-camera {
178		compatible = "regulator-fixed";
179		regulator-name = "vcc_cam";
180		pinctrl-names = "default";
181		pinctrl-0 = <&cam_pwr>;
182		enable-active-high;
183		gpio = <&gpio2 0 GPIO_ACTIVE_HIGH>;
184		regulator-always-on;
185		regulator-boot-on;
186	};
187
188	ext_cam_clk: external-camera-clock {
189		compatible = "fixed-clock";
190		clock-frequency = <25000000>;
191		clock-output-names = "CLK_CAMERA_25MHZ";
192		#clock-cells = <0>;
193	};
194
195	xin32k: xin32k {
196		compatible = "fixed-clock";
197		clock-frequency = <32768>;
198		clock-output-names = "xin32k";
199		#clock-cells = <0>;
200	};
201};
202
203&cpu0 {
204	cpu0-supply = <&vdd_cpu>;
205};
206
207&gmac {
208	phy-supply = <&vcc33_lan>;
209	phy-mode = "rgmii";
210	clock_in_out = "input";
211	snps,reset-gpio = <&gpio4 7 0>;
212	snps,reset-active-low;
213	snps,reset-delays-us = <0 10000 1000000>;
214	assigned-clocks = <&cru SCLK_MAC>;
215	assigned-clock-parents = <&ext_gmac>;
216	pinctrl-names = "default";
217	pinctrl-0 = <&rgmii_pins>;
218	tx_delay = <0x30>;
219	rx_delay = <0x10>;
220	status = "ok";
221};
222
223&gpu {
224	mali-supply = <&vdd_gpu>;
225	status = "okay";
226};
227
228&hdmi {
229	#address-cells = <1>;
230	#size-cells = <0>;
231	#sound-dai-cells = <0>;
232	status = "okay";
233	/* Don't use vopl for HDMI */
234	ports {
235		hdmi_in: port {
236			/delete-node/ endpoint@1;
237		};
238	};
239};
240
241&hevc_service {
242	status = "okay";
243};
244
245&i2c0 {
246	status = "okay";
247	clock-frequency = <400000>;
248
249	rk808: pmic@1b {
250		compatible = "rockchip,rk808";
251		reg = <0x1b>;
252		interrupt-parent = <&gpio0>;
253		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
254		pinctrl-names = "default";
255		pinctrl-0 = <&pmic_int &global_pwroff &dvs_1 &dvs_2>;
256		dvs-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
257				<&gpio0 12 GPIO_ACTIVE_HIGH>;
258
259		rockchip,system-power-controller;
260		wakeup-source;
261		#clock-cells = <1>;
262		clock-output-names = "rk808-clkout1", "rk808-clkout2";
263
264		vcc1-supply = <&vcc_sys>;
265		vcc2-supply = <&vcc_sys>;
266		vcc3-supply = <&vcc_sys>;
267		vcc4-supply = <&vcc_sys>;
268		vcc6-supply = <&vcc_sys>;
269		vcc7-supply = <&vcc_sys>;
270		vcc8-supply = <&vcc_io>;
271		vcc9-supply = <&vcc_io>;
272		vcc10-supply = <&vcc_io>;
273		vcc11-supply = <&vcc_sys>;
274		vcc12-supply = <&vcc_io>;
275		vddio-supply = <&vcc_io>;
276
277		regulators {
278			vdd_cpu: DCDC_REG1 {
279				regulator-always-on;
280				regulator-boot-on;
281				regulator-min-microvolt = <750000>;
282				regulator-max-microvolt = <1450000>;
283				regulator-name = "vdd_arm";
284				regulator-ramp-delay = <6000>;
285				regulator-state-mem {
286					regulator-off-in-suspend;
287				};
288			};
289
290			vdd_gpu: DCDC_REG2 {
291				regulator-always-on;
292				regulator-boot-on;
293				regulator-min-microvolt = <850000>;
294				regulator-max-microvolt = <1250000>;
295				regulator-name = "vdd_gpu";
296				regulator-ramp-delay = <6000>;
297				regulator-state-mem {
298					regulator-on-in-suspend;
299					regulator-suspend-microvolt = <1000000>;
300				};
301			};
302
303			vcc_ddr: DCDC_REG3 {
304				regulator-always-on;
305				regulator-boot-on;
306				regulator-name = "vcc_ddr";
307				regulator-state-mem {
308					regulator-on-in-suspend;
309				};
310			};
311
312			vcc_io: DCDC_REG4 {
313				regulator-always-on;
314				regulator-boot-on;
315				regulator-min-microvolt = <3300000>;
316				regulator-max-microvolt = <3300000>;
317				regulator-name = "vcc_io";
318				regulator-state-mem {
319					regulator-on-in-suspend;
320					regulator-suspend-microvolt = <3300000>;
321				};
322			};
323
324			vcc18_ldo1: LDO_REG1 {
325				regulator-always-on;
326				regulator-boot-on;
327				regulator-min-microvolt = <1800000>;
328				regulator-max-microvolt = <1800000>;
329				regulator-name = "vcc18_ldo1";
330				regulator-state-mem {
331					regulator-on-in-suspend;
332					regulator-suspend-microvolt = <1800000>;
333				};
334			};
335
336			vcc33_mipi: LDO_REG2 {
337				regulator-always-on;
338				regulator-boot-on;
339				regulator-min-microvolt = <3300000>;
340				regulator-max-microvolt = <3300000>;
341				regulator-name = "vcc33_mipi";
342				regulator-state-mem {
343					regulator-off-in-suspend;
344				};
345			};
346
347			vdd_10: LDO_REG3 {
348				regulator-always-on;
349				regulator-boot-on;
350				regulator-min-microvolt = <1000000>;
351				regulator-max-microvolt = <1000000>;
352				regulator-name = "vdd_10";
353				regulator-state-mem {
354					regulator-on-in-suspend;
355					regulator-suspend-microvolt = <1000000>;
356				};
357			};
358
359			vcc18_codec: LDO_REG4 {
360				regulator-always-on;
361				regulator-boot-on;
362				regulator-min-microvolt = <1800000>;
363				regulator-max-microvolt = <1800000>;
364				regulator-name = "vcc18_codec";
365				regulator-state-mem {
366					regulator-on-in-suspend;
367					regulator-suspend-microvolt = <1800000>;
368				};
369			};
370
371			vccio_sd: LDO_REG5 {
372				regulator-always-on;
373				regulator-boot-on;
374				regulator-min-microvolt = <1800000>;
375				regulator-max-microvolt = <3300000>;
376				regulator-name = "vccio_sd";
377				regulator-state-mem {
378					regulator-on-in-suspend;
379					regulator-suspend-microvolt = <3300000>;
380				};
381			};
382
383			vdd10_lcd: LDO_REG6 {
384				regulator-always-on;
385				regulator-boot-on;
386				regulator-min-microvolt = <1000000>;
387				regulator-max-microvolt = <1000000>;
388				regulator-name = "vdd10_lcd";
389				regulator-state-mem {
390					regulator-on-in-suspend;
391					regulator-suspend-microvolt = <1000000>;
392				};
393			};
394
395			vcc_18: LDO_REG7 {
396				regulator-always-on;
397				regulator-boot-on;
398				regulator-min-microvolt = <1800000>;
399				regulator-max-microvolt = <1800000>;
400				regulator-name = "vcc_18";
401				regulator-state-mem {
402					regulator-on-in-suspend;
403					regulator-suspend-microvolt = <1800000>;
404				};
405			};
406
407			vcc18_lcd: LDO_REG8 {
408				regulator-always-on;
409				regulator-boot-on;
410				regulator-min-microvolt = <1800000>;
411				regulator-max-microvolt = <1800000>;
412				regulator-name = "vcc18_lcd";
413				regulator-state-mem {
414					regulator-on-in-suspend;
415					regulator-suspend-microvolt = <1800000>;
416				};
417			};
418
419			vcc33_sd: SWITCH_REG1 {
420				regulator-always-on;
421				regulator-boot-on;
422				regulator-name = "vcc33_sd";
423				regulator-state-mem {
424					regulator-on-in-suspend;
425				};
426			};
427
428			vcc33_lan: SWITCH_REG2 {
429				regulator-always-on;
430				regulator-boot-on;
431				regulator-name = "vcc33_lan";
432				regulator-state-mem {
433					regulator-on-in-suspend;
434				};
435			};
436		};
437	};
438};
439
440&i2c2 {
441	status = "okay";
442
443	camera0: ov5647@36 {
444		compatible = "ovti,ov5647";
445		reg = <0x36>;
446		clocks = <&ext_cam_clk>;
447		status = "okay";
448	};
449
450	camera1: imx219@10 {
451		compatible = "sony,imx219";
452		reg = <0x10>;
453		clocks = <&ext_cam_clk>;
454		status = "okay";
455
456		port {
457			imx219_out: endpoint {
458				remote-endpoint = <&imx219_in>;
459				data-lanes = <1 2>;
460			};
461		};
462	};
463
464	m24c08@50 {
465		compatible = "at,24c08";
466		reg = <0x50>;
467	};
468};
469
470&i2c3 {
471	status = "okay";
472};
473
474&i2c4 {
475	status = "okay";
476};
477
478&isp {
479	status = "okay";
480
481	port {
482		isp_mipi_in: endpoint {
483			remote-endpoint = <&dphy_rx0_out>;
484		};
485	};
486};
487
488&isp_mmu {
489	status = "okay";
490};
491
492&mipi_phy_rx0 {
493	status = "okay";
494
495	ports {
496		#address-cells = <1>;
497		#size-cells = <0>;
498
499		port@0 {
500			reg = <0>;
501
502			imx219_in: endpoint {
503				remote-endpoint = <&imx219_out>;
504				data-lanes = <1 2>;
505			};
506		};
507
508		port@1 {
509			reg = <1>;
510
511			dphy_rx0_out: endpoint {
512				remote-endpoint = <&isp_mipi_in>;
513			};
514		};
515	};
516};
517
518&spi2 {
519	status = "okay";
520	max-freq = <50000000>;
521
522	spidev@0 {
523		compatible = "rockchip,spi_tinker";
524		reg = <0>;
525		spi-max-frequency = <50000000>;
526		spi-cpha = <1>;
527	};
528
529	spidev@1 {
530		compatible = "rockchip,spi_tinker";
531		reg = <1>;
532		spi-max-frequency = <50000000>;
533		spi-cpha = <1>;
534	};
535};
536
537&i2s {
538	#sound-dai-cells = <0>;
539	status = "okay";
540};
541
542&io_domains {
543	status = "okay";
544
545	sdcard-supply = <&vccio_sd>;
546	wifi-supply = <&vcc_18>;
547};
548
549&sdio0 {
550	status = "okay";
551	clock-frequency = <50000000>;
552	clock-freq-min-max = <200000 50000000>;
553	bus-width = <4>;
554	cap-sd-highspeed;
555	cap-sdio-irq;
556	disable-wp;
557	keep-power-in-suspend;
558	mmc-pwrseq = <&sdio_pwrseq>;
559	non-removable;
560	num-slots = <1>;
561	pinctrl-names = "default";
562	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
563	sd-uhs-sdr104;
564	no-sd;
565	no-mmc;
566};
567
568&pwm0 {
569	status = "okay";
570};
571
572&saradc {
573	vref-supply = <&vcc18_ldo1>;
574	status ="okay";
575};
576
577&sdmmc {
578	bus-width = <4>;
579	cap-mmc-highspeed;
580	cap-sd-highspeed;
581	sd-uhs-sdr12;
582	sd-uhs-sdr25;
583	sd-uhs-sdr50;
584	sd-uhs-sdr104;
585	card-detect-delay = <200>;
586	disable-wp;			/* wp not hooked up */
587	num-slots = <1>;
588	pinctrl-names = "default";
589	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
590	status = "okay";
591	no-sdio;
592	no-mmc;
593	vmmc-supply = <&vcc33_sd>;
594	vqmmc-supply = <&vccio_sd>;
595};
596
597&tsadc {
598	rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
599	rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
600	pinctrl-1 = <&otp_out>;
601	status = "okay";
602};
603
604&uart0 {
605	pinctrl-names = "default";
606	pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
607	status = "okay";
608};
609
610&uart1 {
611	status = "okay";
612};
613
614&uart2 {
615	status = "okay";
616};
617
618&uart3 {
619	status = "okay";
620};
621
622&uart4 {
623	status = "okay";
624};
625
626&usbphy {
627	status = "okay";
628};
629
630&usb_host0_ehci {
631	no-relinquish-port;
632	status = "okay";
633};
634
635&usb_host1 {
636	status = "okay";
637};
638
639&usb_otg {
640	status= "okay";
641};
642
643&vopb {
644	status = "okay";
645};
646
647&vopb_mmu {
648	status = "okay";
649};
650
651&vopl {
652	status = "okay";
653	/* Don't use vopl for HDMI */
654	vopl_out: port {
655		/delete-node/ endpoint@0;
656	};
657};
658
659&vopl_mmu {
660	status = "okay";
661};
662
663&vpu_service {
664	status = "okay";
665};
666
667&wdt {
668	status = "okay";
669};
670
671&pinctrl {
672	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
673		drive-strength = <8>;
674	};
675
676	pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
677		bias-pull-up;
678		drive-strength = <8>;
679	};
680
681	backlight {
682		bl_en: bl-en {
683			rockchip,pins = <7 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
684		};
685	};
686
687	buttons {
688		pwrbtn: pwrbtn {
689			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
690		};
691	};
692
693	eth_phy {
694		eth_phy_pwr: eth-phy-pwr {
695			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
696		};
697	};
698
699	pmic {
700		pmic_int: pmic-int {
701			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
702		};
703
704		dvs_1: dvs-1 {
705			rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_down>;
706		};
707
708		dvs_2: dvs-2 {
709			rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_down>;
710		};
711	};
712
713	sdio-pwrseq {
714		wifi_enable_h: wifi-enable-h {
715			rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
716		};
717		chip_enable_h: chip-enable-h {
718			rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
719		};
720	};
721
722	sdmmc {
723		/*
724		 * Default drive strength isn't enough to achieve even
725		 * high-speed mode on EVB board so bump up to 8ma.
726		 */
727		sdmmc_bus4: sdmmc-bus4 {
728			rockchip,pins = <6 RK_PC0 1 &pcfg_pull_up_drv_8ma>,
729					<6 RK_PC1 1 &pcfg_pull_up_drv_8ma>,
730					<6 RK_PC2 1 &pcfg_pull_up_drv_8ma>,
731					<6 RK_PC3 1 &pcfg_pull_up_drv_8ma>;
732		};
733
734		sdmmc_clk: sdmmc-clk {
735			rockchip,pins = <6 RK_PC4 1 &pcfg_pull_none_drv_8ma>;
736		};
737
738		sdmmc_cmd: sdmmc-cmd {
739			rockchip,pins = <6 RK_PC5 1 &pcfg_pull_up_drv_8ma>;
740		};
741
742		sdmmc_pwr: sdmmc-pwr {
743			rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
744		};
745	};
746
747	usb {
748		host_vbus_drv: host-vbus-drv {
749			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
750		};
751
752		pwr_3g: pwr-3g {
753			rockchip,pins = <7 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
754		};
755	};
756
757	wireless-bluetooth {
758		uart0_gpios: uart0-gpios {
759			rockchip,pins = <4 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
760		};
761	};
762
763	cam_pins {
764		cam_pwr: cam-pwr {
765			rockchip,pins = <2 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
766		};
767	};
768};
769