xref: /OK3568_Linux_fs/kernel/arch/arm/boot/dts/rk3288-evb.dtsi (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3#include <dt-bindings/input/input.h>
4#include <dt-bindings/pwm/pwm.h>
5#include "rk3288.dtsi"
6
7/ {
8	memory@0 {
9		device_type = "memory";
10		reg = <0x0 0x0 0x0 0x80000000>;
11	};
12
13	adc-keys {
14		compatible = "adc-keys";
15		io-channels = <&saradc 1>;
16		io-channel-names = "buttons";
17		keyup-threshold-microvolt = <1800000>;
18
19		button-up {
20			label = "Volume Up";
21			linux,code = <KEY_VOLUMEUP>;
22			press-threshold-microvolt = <100000>;
23		};
24
25		button-down {
26			label = "Volume Down";
27			linux,code = <KEY_VOLUMEDOWN>;
28			press-threshold-microvolt = <300000>;
29		};
30
31		menu {
32			label = "Menu";
33			linux,code = <KEY_MENU>;
34			press-threshold-microvolt = <640000>;
35		};
36
37		esc {
38			label = "Esc";
39			linux,code = <KEY_ESC>;
40			press-threshold-microvolt = <1000000>;
41		};
42
43		home  {
44			label = "Home";
45			linux,code = <KEY_HOME>;
46			press-threshold-microvolt = <1300000>;
47		};
48	};
49
50	sound: sound {
51		compatible = "simple-audio-card";
52		simple-audio-card,format = "i2s";
53		simple-audio-card,name = "rockchip,rt5640-codec";
54		simple-audio-card,mclk-fs = <512>;
55		status = "okay";
56
57		simple-audio-card,dai-link@0 {
58			format = "i2s";
59			cpu {
60				sound-dai = <&i2s>;
61			};
62
63			codec {
64				sound-dai = <&rt5640>;
65			};
66		};
67
68		simple-audio-card,dai-link@1 {
69			format = "i2s";
70			cpu {
71				sound-dai = <&i2s>;
72			};
73
74			codec {
75				sound-dai = <&hdmi>;
76			};
77		};
78	};
79
80	hdmi_analog_sound: hdmi-analog-sound {
81		compatible = "rockchip,rk3288-hdmi-analog",
82			     "rockchip,rk3368-hdmi-analog";
83		rockchip,model = "rockchip,rt5640-codec";
84		rockchip,cpu = <&i2s>;
85		rockchip,codec = <&rt5640>, <&hdmi>;
86		status = "disabled";
87	};
88
89	backlight: backlight {
90		compatible = "pwm-backlight";
91		brightness-levels = <
92			  0   1   2   3   4   5   6   7
93			  8   9  10  11  12  13  14  15
94			 16  17  18  19  20  21  22  23
95			 24  25  26  27  28  29  30  31
96			 32  33  34  35  36  37  38  39
97			 40  41  42  43  44  45  46  47
98			 48  49  50  51  52  53  54  55
99			 56  57  58  59  60  61  62  63
100			 64  65  66  67  68  69  70  71
101			 72  73  74  75  76  77  78  79
102			 80  81  82  83  84  85  86  87
103			 88  89  90  91  92  93  94  95
104			 96  97  98  99 100 101 102 103
105			104 105 106 107 108 109 110 111
106			112 113 114 115 116 117 118 119
107			120 121 122 123 124 125 126 127
108			128 129 130 131 132 133 134 135
109			136 137 138 139 140 141 142 143
110			144 145 146 147 148 149 150 151
111			152 153 154 155 156 157 158 159
112			160 161 162 163 164 165 166 167
113			168 169 170 171 172 173 174 175
114			176 177 178 179 180 181 182 183
115			184 185 186 187 188 189 190 191
116			192 193 194 195 196 197 198 199
117			200 201 202 203 204 205 206 207
118			208 209 210 211 212 213 214 215
119			216 217 218 219 220 221 222 223
120			224 225 226 227 228 229 230 231
121			232 233 234 235 236 237 238 239
122			240 241 242 243 244 245 246 247
123			248 249 250 251 252 253 254 255>;
124		default-brightness-level = <128>;
125		enable-gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
126		pinctrl-names = "default";
127		pinctrl-0 = <&bl_en>;
128		pwms = <&pwm0 0 1000000 PWM_POLARITY_INVERTED>;
129	};
130
131	ext_gmac: external-gmac-clock {
132		compatible = "fixed-clock";
133		clock-frequency = <125000000>;
134		clock-output-names = "ext_gmac";
135		#clock-cells = <0>;
136	};
137
138	panel: panel {
139		compatible = "simple-panel";
140		backlight = <&backlight>;
141		enable-gpios = <&gpio7 RK_PA4 GPIO_ACTIVE_HIGH>;
142		pinctrl-names = "default";
143		pinctrl-0 = <&lcd_cs>;
144		prepare-delay-ms = <120>;
145
146		panel-timing {
147			clock-frequency = <200000000>;
148			hactive = <1536>;
149			hfront-porch = <12>;
150			hback-porch = <48>;
151			hsync-len = <16>;
152			vactive = <2048>;
153			vfront-porch = <8>;
154			vback-porch = <8>;
155			vsync-len = <4>;
156			hsync-active = <0>;
157			vsync-active = <0>;
158			de-active = <0>;
159			pixelclk-active = <0>;
160		};
161
162		ports {
163			panel_in: port {
164				panel_in_edp: endpoint {
165					remote-endpoint = <&edp_out_panel>;
166				};
167			};
168		};
169	};
170
171	gpio-keys {
172		compatible = "gpio-keys";
173		autorepeat;
174
175		pinctrl-names = "default";
176		pinctrl-0 = <&pwrbtn>;
177
178		power {
179			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
180			linux,code = <KEY_POWER>;
181			label = "GPIO Key Power";
182			linux,input-type = <1>;
183			wakeup-source;
184			debounce-interval = <100>;
185		};
186	};
187
188	/* This turns on USB vbus for both host0 (ehci) and host1 (dwc2) */
189	vcc_host: vcc-host-regulator {
190		compatible = "regulator-fixed";
191		enable-active-high;
192		gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
193		pinctrl-names = "default";
194		pinctrl-0 = <&host_vbus_drv>;
195		regulator-name = "vcc_host";
196		regulator-always-on;
197		regulator-boot-on;
198	};
199
200	vcc_otg_vbus: otg-vbus-regulator {
201		compatible = "regulator-fixed";
202		enable-active-high;
203		gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
204		pinctrl-names = "default";
205		pinctrl-0 = <&otg_vbus_drv>;
206		regulator-name = "vcc_otg_vbus";
207	};
208
209	vcc_phy: vcc-phy-regulator {
210		compatible = "regulator-fixed";
211		enable-active-high;
212		gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
213		pinctrl-names = "default";
214		pinctrl-0 = <&eth_phy_pwr>;
215		regulator-name = "vcc_phy";
216		regulator-min-microvolt = <3300000>;
217		regulator-max-microvolt = <3300000>;
218		regulator-always-on;
219		regulator-boot-on;
220	};
221
222	vcc_sys: vsys-regulator {
223		compatible = "regulator-fixed";
224		regulator-name = "vcc_sys";
225		regulator-min-microvolt = <5000000>;
226		regulator-max-microvolt = <5000000>;
227		regulator-always-on;
228		regulator-boot-on;
229	};
230
231	/*
232	 * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
233	 * vcc_io directly.  Those boards won't be able to power cycle SD cards
234	 * but it shouldn't hurt to toggle this pin there anyway.
235	 */
236	vcc_sd: sdmmc-regulator {
237		compatible = "regulator-fixed";
238		gpio = <&gpio7 RK_PB3 GPIO_ACTIVE_LOW>;
239		pinctrl-names = "default";
240		pinctrl-0 = <&sdmmc_pwr>;
241		regulator-name = "vcc_sd";
242		regulator-min-microvolt = <3300000>;
243		regulator-max-microvolt = <3300000>;
244		startup-delay-us = <100000>;
245		vin-supply = <&vcc_io>;
246	};
247
248	wireless-bluetooth {
249		compatible = "bluetooth-platdata";
250		uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
251		pinctrl-names = "default", "rts_gpio";
252		pinctrl-0 = <&uart0_rts>;
253		pinctrl-1 = <&uart0_gpios>;
254		BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
255		BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
256		BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
257		status = "okay";
258	};
259
260	wireless-wlan {
261		compatible = "wlan-platdata";
262		rockchip,grf = <&grf>;
263		wifi_chip_type = "ap6335";
264		sdio_vref = <1800>;
265		WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
266		status = "okay";
267	};
268};
269
270&cpu0 {
271	cpu0-supply = <&vdd_cpu>;
272};
273
274&edp {
275	force-hpd;
276	status = "okay";
277
278	ports {
279		edp_out: port@1 {
280			reg = <1>;
281			#address-cells = <1>;
282			#size-cells = <0>;
283
284			edp_out_panel: endpoint@0 {
285				reg = <0>;
286				remote-endpoint = <&panel_in_edp>;
287			};
288		};
289	};
290};
291
292&edp_phy {
293	status = "okay";
294};
295
296&emmc {
297	bus-width = <8>;
298	cap-mmc-highspeed;
299	no-sdio;
300	no-sd;
301	disable-wp;
302	non-removable;
303	pinctrl-names = "default";
304	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
305	status = "okay";
306};
307
308&saradc {
309	vref-supply = <&vcc_18>;
310	status = "okay";
311};
312
313&sdmmc {
314	bus-width = <4>;
315	cap-mmc-highspeed;
316	sd-uhs-sdr12;
317	sd-uhs-sdr25;
318	sd-uhs-sdr50;
319	sd-uhs-sdr104;
320	cap-sd-highspeed;
321	no-mmc;
322	no-sdio;
323	card-detect-delay = <200>;
324	disable-wp;			/* wp not hooked up */
325	pinctrl-names = "default";
326	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
327	status = "okay";
328	vmmc-supply = <&vcc_sd>;
329	vqmmc-supply = <&vccio_sd>;
330};
331
332&gmac {
333	phy-supply = <&vcc_phy>;
334	phy-mode = "rgmii";
335	clock_in_out = "output";
336	assigned-clocks = <&cru SCLK_MAC>;
337	assigned-clock-parents = <&cru PLL_NPLL>;
338	assigned-clock-rates = <125000000>;
339	snps,reset-gpio = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
340	snps,reset-active-low;
341	snps,reset-delays-us = <0 10000 1000000>;
342	pinctrl-names = "default";
343	pinctrl-0 = <&rgmii_pins>;
344	tx_delay = <0x30>;
345	rx_delay = <0x10>;
346	status = "okay";
347};
348
349&gpu {
350	mali-supply = <&vdd_gpu>;
351	status = "okay";
352};
353
354&hdmi {
355	status = "okay";
356};
357
358&i2c0 {
359	status = "okay";
360};
361
362&i2c2 {
363	status = "okay";
364
365	rt5640: rt5640@1c {
366		#sound-dai-cells = <0>;
367		compatible = "realtek,rt5640";
368		reg = <0x1c>;
369		clocks = <&cru SCLK_I2S0_OUT>;
370		clock-names = "mclk";
371		interrupt-parent = <&gpio7>;
372		interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
373		pinctrl-names = "default";
374		pinctrl-0 = <&i2s0_mclk>;
375	};
376};
377
378&i2c4 {
379	status = "okay";
380	clock-frequency = <400000>;
381
382	gsl3673@40 {
383		compatible = "GSL,GSL3673";
384		reg = <0x40>;
385		screen_max_x = <1536>;
386		screen_max_y = <2048>;
387		irq_gpio_number = <&gpio7 6 IRQ_TYPE_LEVEL_LOW>;
388		rst_gpio_number = <&gpio7 5 GPIO_ACTIVE_HIGH>;
389		status = "okay";
390	};
391};
392
393&i2s {
394	#sound-dai-cells = <0>;
395	status = "okay";
396};
397
398&wdt {
399	status = "okay";
400};
401
402&pwm0 {
403	status = "okay";
404};
405
406&sdio0 {
407	status = "okay";
408	max-frequency = <150000000>;
409	bus-width = <4>;
410	cap-sd-highspeed;
411	no-mmc;
412	no-sd;
413	cap-sdio-irq;
414	mmc-pwrseq = <&sdio_pwrseq>;
415	keep-power-in-suspend;
416	non-removable;
417	pinctrl-names = "default";
418	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
419	sd-uhs-sdr104;
420};
421
422&uart0 {
423	pinctrl-names = "default";
424	pinctrl-0 = <&uart0_xfer &uart0_cts>;
425	status = "okay";
426};
427
428&uart2 {
429	status = "okay";
430};
431
432&tsadc {
433	rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
434	rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
435	status = "okay";
436};
437
438&pinctrl {
439	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
440		drive-strength = <8>;
441	};
442
443	pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
444		bias-pull-up;
445		drive-strength = <8>;
446	};
447
448	backlight {
449		bl_en: bl-en {
450			rockchip,pins = <7 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
451		};
452	};
453
454	buttons {
455		pwrbtn: pwrbtn {
456			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
457		};
458	};
459
460	lcd {
461		lcd_cs: lcd-cs {
462			rockchip,pins = <7 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
463		};
464	};
465
466	pmic {
467		pmic_int: pmic-int {
468			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
469		};
470	};
471
472	sdio-pwrseq {
473		wifi_enable_h: wifi-enable-h {
474			rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
475		};
476	};
477
478	sdmmc {
479		/*
480		 * Default drive strength isn't enough to achieve even
481		 * high-speed mode on EVB board so bump up to 8ma.
482		 */
483		sdmmc_bus4: sdmmc-bus4 {
484			rockchip,pins = <6 RK_PC0 1 &pcfg_pull_up_drv_8ma>,
485					<6 RK_PC1 1 &pcfg_pull_up_drv_8ma>,
486					<6 RK_PC2 1 &pcfg_pull_up_drv_8ma>,
487					<6 RK_PC3 1 &pcfg_pull_up_drv_8ma>;
488		};
489
490		sdmmc_clk: sdmmc-clk {
491			rockchip,pins = <6 RK_PC4 1 &pcfg_pull_none_drv_8ma>;
492		};
493
494		sdmmc_cmd: sdmmc-cmd {
495			rockchip,pins = <6 RK_PC5 1 &pcfg_pull_up_drv_8ma>;
496		};
497
498		sdmmc_pwr: sdmmc-pwr {
499			rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
500		};
501	};
502
503	usb {
504		host_vbus_drv: host-vbus-drv {
505			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
506		};
507
508		otg_vbus_drv: otg-bus-drv {
509			rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
510		};
511	};
512
513	eth_phy {
514		eth_phy_pwr: eth-phy-pwr {
515			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
516		};
517	};
518
519	wireless-bluetooth {
520		uart0_gpios: uart0-gpios {
521			rockchip,pins = <4 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
522		};
523	};
524};
525
526&usbphy {
527	status = "okay";
528};
529
530&usb_host0_ehci {
531	rockchip-relinquish-port;
532	status = "okay";
533};
534
535&usb_host0_ohci {
536	status = "okay";
537};
538
539&usb_host1 {
540	status = "okay";
541};
542
543&usb_otg {
544	vbus-supply = <&vcc_otg_vbus>;
545	status = "okay";
546};
547
548&vopb {
549	status = "okay";
550};
551
552&vopb_mmu {
553	status = "okay";
554};
555
556&vopl {
557	status = "okay";
558};
559
560&vopl_mmu {
561	status = "okay";
562};
563