xref: /OK3568_Linux_fs/kernel/arch/arm64/boot/dts/rockchip/rk3368-sheep.dts (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2022 Rockchip Electronics Co., Ltd.
4 *
5 */
6
7/dts-v1/;
8#include <dt-bindings/pwm/pwm.h>
9#include "rk3368.dtsi"
10#include "rk3368-android.dtsi"
11
12/ {
13	model = "Rockchip Sheep board";
14	compatible = "rockchip,sheep", "rockchip,rk3368";
15
16	sound {
17		compatible = "simple-audio-card";
18		simple-audio-card,format = "i2s";
19		simple-audio-card,name = "rockchip,rt5640-codec";
20		simple-audio-card,mclk-fs = <256>;
21		simple-audio-card,widgets =
22			"Microphone", "Mic Jack",
23			"Headphone", "Headphone Jack";
24		simple-audio-card,routing =
25			"Mic Jack", "MICBIAS1",
26			"IN1P", "Mic Jack",
27			"Headphone Jack", "HPOL",
28			"Headphone Jack", "HPOR";
29		simple-audio-card,cpu {
30			sound-dai = <&i2s_8ch>;
31		};
32		simple-audio-card,codec {
33			sound-dai = <&rt5640>;
34		};
35	};
36
37	backlight: backlight {
38		compatible = "pwm-backlight";
39		pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
40		brightness-levels = <
41			135 135 136 136 137 137 138 138
42			139 139 140 140 141 141 142 142
43			143 143 143 144 144 145 145 146
44			146 147 147 148 148 149 149 150
45			150 151 151 151 152 152 153 153
46			154 154 155 155 156 156 157 157
47			158 158 159 159 159 160 160 161
48			161 162 162 163 163 164 164 165
49			165 166 166 167 167 167 168 168
50			169 169 170 170 171 171 172 172
51			173 173 174 174 175 175 175 176
52			176 177 177 178 178 179 179 180
53			180 181 181 182 182 183 183 183
54			184 184 185 185 186 186 187 187
55			188 188 189 189 190 190 191 191
56			191 192 192 193 193 194 194 195
57			195 196 196 197 197 198 198 199
58			199 199 200 200 201 201 202 202
59			203 203 204 204 205 205 206 206
60			207 207 207 208 208 209 209 210
61			210 211 211 212 212 213 213 214
62			214 215 215 215 216 216 217 217
63			218 218 219 219 220 220 221 221
64			222 222 223 223 223 224 224 225
65			225 226 226 227 227 228 228 229
66			229 230 230 231 231 231 232 232
67			233 233 234 234 235 235 236 236
68			237 237 238 238 239 239 239 240
69			240 241 241 242 242 243 243 244
70			244 245 245 246 246 247 247 247
71			248 248 249 249 250 250 251 251
72			252 252 253 253 254 254 255 255>;
73		default-brightness-level = <200>;
74		enable-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
75	};
76
77	rk_key: rockchip-key {
78		compatible = "rockchip,key";
79		status = "okay";
80
81		io-channels = <&saradc 1>;
82
83		vol-up-key {
84			linux,code = <115>;
85			label = "volume up";
86			rockchip,adc_value = <1>;
87		};
88
89		vol-down-key {
90			linux,code = <114>;
91			label = "volume down";
92			rockchip,adc_value = <170>;
93		};
94
95		power-key {
96			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
97			linux,code = <116>;
98			label = "power";
99			gpio-key,wakeup;
100		};
101
102		menu-key {
103			linux,code = <59>;
104			label = "menu";
105			rockchip,adc_value = <355>;
106		};
107
108		home-key {
109			linux,code = <102>;
110			label = "home";
111			rockchip,adc_value = <746>;
112		};
113
114		back-key {
115			linux,code = <158>;
116			label = "back";
117			rockchip,adc_value = <560>;
118		};
119
120		camera-key {
121			linux,code = <212>;
122			label = "camera";
123			rockchip,adc_value = <450>;
124		};
125	};
126
127	vcc_sys: vcc-sys {
128		compatible = "regulator-fixed";
129		regulator-name = "vcc_sys";
130		regulator-always-on;
131		regulator-boot-on;
132		regulator-min-microvolt = <3800000>;
133		regulator-max-microvolt = <3800000>;
134	};
135
136	vcc_host: vcc-host {
137		compatible = "regulator-fixed";
138		enable-active-high;
139		gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;
140		pinctrl-names = "default";
141		pinctrl-0 = <&host_vbus_drv>;
142		regulator-name = "vcc_host";
143		regulator-always-on;
144	};
145
146	vcc_otg_vbus: otg-vbus-regulator {
147		compatible = "regulator-fixed";
148		gpio = <&gpio0 RK_PD1 GPIO_ACTIVE_HIGH>;
149		pinctrl-names = "default";
150		pinctrl-0 = <&otg_vbus_drv>;
151		regulator-name = "vcc_otg_vbus";
152		regulator-min-microvolt = <5000000>;
153		regulator-max-microvolt = <5000000>;
154		enable-active-high;
155	};
156
157	xin32k: xin32k {
158		compatible = "fixed-clock";
159		clock-frequency = <32768>;
160		clock-output-names = "xin32k";
161		#clock-cells = <0>;
162	};
163};
164
165&firmware_android {
166	compatible = "android,firmware";
167	fstab {
168		compatible = "android,fstab";
169		system {
170			compatible = "android,system";
171			dev = "/dev/block/by-name/system";
172			type = "ext4";
173			mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
174			fsmgr_flags = "wait,verify";
175		};
176		vendor {
177			compatible = "android,vendor";
178			dev = "/dev/block/by-name/vendor";
179			type = "ext4";
180			mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
181			fsmgr_flags = "wait,verify";
182		};
183	};
184};
185
186&emmc {
187	status = "okay";
188	bus-width = <8>;
189	cap-mmc-highspeed;
190	mmc-hs200-1_8v;
191	no-sdio;
192	no-sd;
193	disable-wp;
194	non-removable;
195	num-slots = <1>;
196	pinctrl-names = "default";
197	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
198};
199
200&sdmmc {
201	status = "okay";
202	clock-frequency = <37500000>;
203	clock-freq-min-max = <400000 37500000>;
204	no-sdio;
205	no-mmc;
206	cap-mmc-highspeed;
207	cap-sd-highspeed;
208	card-detect-delay = <200>;
209	disable-wp;
210	num-slots = <1>;
211	pinctrl-names = "default";
212	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
213};
214
215&i2c0 {
216	status = "okay";
217
218	syr827: syr827@40 {
219		compatible = "silergy,syr827";
220		reg = <0x40>;
221		status = "okay";
222
223		regulator-compatible = "fan53555-reg";
224		regulator-name = "vdd_arm";
225		regulator-min-microvolt = <712500>;
226		regulator-max-microvolt = <1500000>;
227		regulator-ramp-delay = <1000>;
228		fcs,suspend-voltage-selector = <1>;
229		pinctrl-0 = <&vsel_gpio>;
230		vsel-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
231		regulator-always-on;
232		regulator-boot-on;
233		regulator-initial-state = <3>;
234		regulator-state-mem {
235			regulator-off-in-suspend;
236			regulator-suspend-microvolt = <900000>;
237		};
238	};
239
240	rk818: pmic@1c {
241		compatible = "rockchip,rk818";
242		reg = <0x1c>;
243		status = "okay";
244
245		clock-output-names = "rk818-clkout1", "wifibt_32kin";
246		interrupt-parent = <&gpio0>;
247		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
248		pinctrl-names = "default";
249		pinctrl-0 = <&pmic_int_l>;
250		rockchip,system-power-controller;
251		wakeup-source;
252		#clock-cells = <1>;
253
254		vcc1-supply = <&vcc_sys>;
255		vcc2-supply = <&vcc_sys>;
256		vcc3-supply = <&vcc_sys>;
257		vcc4-supply = <&vcc_sys>;
258		vcc6-supply = <&vcc_sys>;
259		vcc7-supply = <&vcc_sys>;
260		vcc8-supply = <&vcc_sys>;
261		vcc9-supply = <&vcc_io>;
262
263		regulators {
264			vdd_logic: DCDC_REG1 {
265				regulator-name = "vdd_logic";
266				regulator-always-on;
267				regulator-boot-on;
268				regulator-min-microvolt = <750000>;
269				regulator-max-microvolt = <1450000>;
270				regulator-ramp-delay = <6001>;
271				regulator-state-mem {
272					regulator-on-in-suspend;
273					regulator-suspend-microvolt = <1000000>;
274				};
275			};
276
277			vdd_gpu: DCDC_REG2 {
278				regulator-name = "vdd_gpu";
279				regulator-always-on;
280				regulator-boot-on;
281				regulator-min-microvolt = <800000>;
282				regulator-max-microvolt = <1250000>;
283				regulator-ramp-delay = <6001>;
284				regulator-state-mem {
285					regulator-on-in-suspend;
286					regulator-suspend-microvolt = <1000000>;
287				};
288			};
289
290			vcc_ddr: DCDC_REG3 {
291				regulator-always-on;
292				regulator-boot-on;
293				regulator-name = "vcc_ddr";
294				regulator-state-mem {
295					regulator-on-in-suspend;
296				};
297			};
298
299			vcc_io: DCDC_REG4 {
300				regulator-always-on;
301				regulator-boot-on;
302				regulator-min-microvolt = <3300000>;
303				regulator-max-microvolt = <3300000>;
304				regulator-name = "vcc_io";
305				regulator-state-mem {
306					regulator-on-in-suspend;
307					regulator-suspend-microvolt = <3300000>;
308				};
309			};
310
311			vcca_codec: LDO_REG1 {
312				regulator-always-on;
313				regulator-boot-on;
314				regulator-min-microvolt = <3300000>;
315				regulator-max-microvolt = <3300000>;
316				regulator-name = "vcca_codec";
317				regulator-state-mem {
318					regulator-on-in-suspend;
319					regulator-suspend-microvolt = <3300000>;
320				};
321			};
322
323			vcc_tp: LDO_REG2 {
324				regulator-boot-on;
325				regulator-min-microvolt = <3000000>;
326				regulator-max-microvolt = <3000000>;
327				regulator-name = "vcc_tp";
328				regulator-state-mem {
329					regulator-off-in-suspend;
330				};
331			};
332
333			vdd_10: LDO_REG3 {
334				regulator-always-on;
335				regulator-boot-on;
336				regulator-min-microvolt = <1000000>;
337				regulator-max-microvolt = <1000000>;
338				regulator-name = "vdd_10";
339				regulator-state-mem {
340					regulator-on-in-suspend;
341					regulator-suspend-microvolt = <1000000>;
342				};
343			};
344
345			vcc18_lcd: LDO_REG4 {
346				regulator-always-on;
347				regulator-boot-on;
348				regulator-min-microvolt = <1800000>;
349				regulator-max-microvolt = <1800000>;
350				regulator-name = "vcc18_lcd";
351				regulator-state-mem {
352					regulator-on-in-suspend;
353					regulator-suspend-microvolt = <1800000>;
354				};
355			};
356
357			vccio_pmu: LDO_REG5 {
358				regulator-always-on;
359				regulator-boot-on;
360				regulator-min-microvolt = <1800000>;
361				regulator-max-microvolt = <1800000>;
362				regulator-name = "vccio_pmu";
363				regulator-state-mem {
364					regulator-on-in-suspend;
365					regulator-suspend-microvolt = <1800000>;
366				};
367			};
368
369			vdd10_lcd: LDO_REG6 {
370				regulator-always-on;
371				regulator-boot-on;
372				regulator-min-microvolt = <1000000>;
373				regulator-max-microvolt = <1000000>;
374				regulator-name = "vdd10_lcd";
375				regulator-state-mem {
376					regulator-on-in-suspend;
377					regulator-suspend-microvolt = <1000000>;
378				};
379			};
380
381			vcc_18: LDO_REG7 {
382				regulator-always-on;
383				regulator-boot-on;
384				regulator-min-microvolt = <1800000>;
385				regulator-max-microvolt = <1800000>;
386				regulator-name = "vcc_18";
387				regulator-state-mem {
388					regulator-on-in-suspend;
389					regulator-suspend-microvolt = <1800000>;
390				};
391			};
392
393			vccio_wl: LDO_REG8 {
394				regulator-always-on;
395				regulator-boot-on;
396				regulator-min-microvolt = <1800000>;
397				regulator-max-microvolt = <3300000>;
398				regulator-name = "vccio_wl";
399				regulator-state-mem {
400					regulator-on-in-suspend;
401					regulator-suspend-microvolt = <3300000>;
402				};
403			};
404
405			vccio_sd: LDO_REG9 {
406				regulator-always-on;
407				regulator-boot-on;
408				regulator-min-microvolt = <1800000>;
409				regulator-max-microvolt = <3300000>;
410				regulator-name = "vccio_sd";
411				regulator-state-mem {
412					regulator-on-in-suspend;
413					regulator-suspend-microvolt = <3300000>;
414				};
415			};
416
417			vcc_sd: SWITCH_REG {
418				regulator-always-on;
419				regulator-boot-on;
420				regulator-name = "vcc_sd";
421				regulator-state-mem {
422					regulator-on-in-suspend;
423				};
424			};
425
426			boost_otg: DCDC_BOOST {
427				regulator-name = "boost_otg";
428				regulator-always-on;
429				regulator-boot-on;
430				regulator-min-microvolt = <5000000>;
431				regulator-max-microvolt = <5000000>;
432				regulator-state-mem {
433					regulator-on-in-suspend;
434					regulator-suspend-microvolt = <5000000>;
435				};
436			};
437		};
438
439		battery {
440			compatible = "rk818-battery";
441			pinctrl-names = "default";
442			pinctrl-0 = <&dc_irq_gpio>;
443			ocv_table = <
444				3400 3650 3693 3707 3731 3749 3760
445				3770 3782 3796 3812 3829 3852 3882
446				3915 3951 3981 4047 4086 4132 4182>;
447			design_capacity = <8650>;
448			design_qmax = <8800>;
449			bat_res = <85>;
450			max_input_current = <2000>;
451			max_chrg_current = <1800>;
452			max_chrg_voltage = <4200>;
453			sleep_enter_current = <600>;
454			sleep_exit_current = <600>;
455			power_off_thresd = <3400>;
456			zero_algorithm_vol = <3850>;
457			fb_temperature = <115>;
458			sample_res = <10>;
459			max_soc_offset = <60>;
460			energy_mode = <0>;
461			monitor_sec = <5>;
462			virtual_power = <0>;
463			power_dc2otg = <1>;
464			support_usb_adp = <1>;
465			support_dc_adp = <1>;
466			dc_det_gpio = <&gpio0 17 GPIO_ACTIVE_LOW>;
467		};
468	};
469};
470
471&cpu_l0 {
472	cpu-supply = <&syr827>;
473};
474
475&cpu_l1 {
476	cpu-supply = <&syr827>;
477};
478
479&cpu_l2 {
480	cpu-supply = <&syr827>;
481};
482
483&cpu_l3 {
484	cpu-supply = <&syr827>;
485};
486
487&cpu_b0 {
488	cpu-supply = <&syr827>;
489};
490
491&cpu_b1 {
492	cpu-supply = <&syr827>;
493};
494
495&cpu_b2 {
496	cpu-supply = <&syr827>;
497};
498
499&cpu_b3 {
500	cpu-supply = <&syr827>;
501};
502
503&dfi {
504	status = "okay";
505};
506
507&dmc {
508	center-supply = <&vdd_logic>;
509	status = "okay";
510};
511
512&gpu {
513	logic-supply = <&vdd_logic>;
514};
515
516&rockchip_suspend {
517	status = "okay";
518};
519
520&i2c1 {
521	status = "okay";
522
523	rt5640: rt5640@1c {
524		compatible = "realtek,rt5640";
525		reg = <0x1c>;
526		#sound-dai-cells = <0>;
527		clocks = <&cru SCLK_I2S_8CH_OUT>;
528		clock-names = "mclk";
529		pinctrl-names = "default";
530		pinctrl-0 = <&i2s_8ch_mclk>;
531		realtek,in1-differential;
532		status = "okay";
533	};
534};
535
536&i2c2 {
537	status = "okay";
538
539	gt9xx: gt9xx@14 {
540		compatible = "goodix,gt9xx";
541		reg = <0x14>;
542		touch-gpio = <&gpio0 12 IRQ_TYPE_LEVEL_LOW>;
543		reset-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
544		max-x = <1200>;
545		max-y = <1900>;
546		tp-size = <911>;
547		tp-supply = <&vcc_tp>;
548		status = "okay";
549	};
550};
551
552&i2s_8ch {
553	status = "okay";
554	rockchip,i2s-broken-burst-len;
555	rockchip,playback-channels = <8>;
556	rockchip,capture-channels = <2>;
557	#sound-dai-cells = <0>;
558};
559
560&io_domains {
561	status = "okay";
562	dvp-supply = <&vcc_18>;
563	audio-supply = <&vcc_io>;
564	gpio30-supply = <&vcc_io>;
565	gpio1830-supply = <&vcc_io>;
566	sdcard-supply = <&vccio_sd>;
567	wifi-supply = <&vccio_wl>;
568};
569
570&pmu_io_domains {
571	status = "okay";
572
573	pmu-supply = <&vcc_io>;
574	vop-supply = <&vcc_io>;
575};
576
577&pwm0 {
578	status = "okay";
579};
580
581&u2phy {
582	status = "okay";
583
584	u2phy_host: host-port {
585		phy-supply = <&vcc_host>;
586		status = "okay";
587	};
588
589	u2phy_otg: otg-port {
590		vbus-supply = <&vcc_otg_vbus>;
591		status = "okay";
592	};
593};
594
595&usb_host0_ehci {
596	status = "okay";
597};
598
599&usb_host0_ohci {
600	status = "okay";
601};
602
603&mailbox {
604	status = "okay";
605};
606
607&mailbox_scpi {
608	status = "okay";
609};
610
611&dsi {
612	status = "okay";
613
614	panel@0 {
615		compatible = "simple-panel-dsi";
616		reg = <0>;
617		backlight = <&backlight>;
618		enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
619		prepare-delay-ms = <120>;
620
621		dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
622			      MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
623		dsi,format = <MIPI_DSI_FMT_RGB888>;
624		dsi,lanes = <4>;
625
626		display-timings {
627			native-mode = <&timing0>;
628
629			timing0: timing0 {
630				clock-frequency = <150000000>;
631				hactive = <1200>;
632				vactive = <1920>;
633				hback-porch = <80>;
634				hfront-porch = <81>;
635				vback-porch = <21>;
636				vfront-porch = <21>;
637				hsync-len = <10>;
638				vsync-len = <3>;
639				hsync-active = <0>;
640				vsync-active = <0>;
641				de-active = <0>;
642				pixelclk-active = <0>;
643			};
644		};
645
646		ports {
647			#address-cells = <1>;
648			#size-cells = <0>;
649
650			port@0 {
651				reg = <0>;
652				panel_in_dsi: endpoint {
653					remote-endpoint = <&dsi_out_panel>;
654				};
655			};
656		};
657	};
658
659	ports {
660		#address-cells = <1>;
661		#size-cells = <0>;
662
663		port@1 {
664			reg = <1>;
665			dsi_out_panel: endpoint {
666				remote-endpoint = <&panel_in_dsi>;
667			};
668		};
669	};
670};
671
672&route_dsi {
673	status = "okay";
674};
675
676&saradc {
677	status = "okay";
678};
679
680&tsadc {
681	tsadc-supply = <&syr827>;
682	status = "okay";
683};
684
685&pinctrl {
686	pmic {
687		pmic_int_l: pmic-int-l {
688			rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
689		};
690		vsel_gpio: vsel-gpio {
691			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>;
692		};
693	};
694
695	dc_det {
696		dc_irq_gpio: dc-irq-gpio {
697			rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>;
698		};
699	};
700
701	usb2 {
702		host_vbus_drv: host-vbus-drv {
703			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
704		};
705
706		otg_vbus_drv: otg-bus-drv {
707			rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
708		};
709	};
710};
711