1*6d9a7bd6SLevin Du// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2*6d9a7bd6SLevin Du/*
3*6d9a7bd6SLevin Du * Copyright (c) 2017 T-Chip Intelligent Technology Co., Ltd
4*6d9a7bd6SLevin Du */
5*6d9a7bd6SLevin Du
6*6d9a7bd6SLevin Du/dts-v1/;
7*6d9a7bd6SLevin Du#include "rk3399-roc-pc.dtsi"
8*6d9a7bd6SLevin Du
9*6d9a7bd6SLevin Du/*
10*6d9a7bd6SLevin Du * Notice:
11*6d9a7bd6SLevin Du * 1. rk3399-roc-pc-plus is powered by dc_12v directly.
12*6d9a7bd6SLevin Du * 2. rk3399-roc-pc-plus has only vcc_bus_typec0 in schematic, which is coresponding
13*6d9a7bd6SLevin Du *    to vcc_vbus_typec1 in rk3399-roc-pc.
14*6d9a7bd6SLevin Du *    For simplicity, reserve the node name of vcc_vbus_typec1.
15*6d9a7bd6SLevin Du * 3. vcc5v0_host is actually 2 regulators (host0, 1) controlled by the same gpio.
16*6d9a7bd6SLevin Du */
17*6d9a7bd6SLevin Du
18*6d9a7bd6SLevin Du/delete-node/ &fusb1;
19*6d9a7bd6SLevin Du/delete-node/ &hub_rst;
20*6d9a7bd6SLevin Du/delete-node/ &mp8859;
21*6d9a7bd6SLevin Du/delete-node/ &vcc_sys_en;
22*6d9a7bd6SLevin Du/delete-node/ &vcc_vbus_typec0;
23*6d9a7bd6SLevin Du/delete-node/ &yellow_led;
24*6d9a7bd6SLevin Du
25*6d9a7bd6SLevin Du/ {
26*6d9a7bd6SLevin Du	model = "Firefly ROC-RK3399-PC-PLUS Board";
27*6d9a7bd6SLevin Du	compatible = "firefly,roc-rk3399-pc-plus", "rockchip,rk3399";
28*6d9a7bd6SLevin Du
29*6d9a7bd6SLevin Du	dc_12v: dc-12v {
30*6d9a7bd6SLevin Du		compatible = "regulator-fixed";
31*6d9a7bd6SLevin Du		regulator-name = "dc_12v";
32*6d9a7bd6SLevin Du		regulator-always-on;
33*6d9a7bd6SLevin Du		regulator-boot-on;
34*6d9a7bd6SLevin Du		regulator-min-microvolt = <12000000>;
35*6d9a7bd6SLevin Du		regulator-max-microvolt = <12000000>;
36*6d9a7bd6SLevin Du	};
37*6d9a7bd6SLevin Du
38*6d9a7bd6SLevin Du	es8388-sound {
39*6d9a7bd6SLevin Du		compatible = "simple-audio-card";
40*6d9a7bd6SLevin Du		pinctrl-names = "default";
41*6d9a7bd6SLevin Du		pinctrl-0 = <&hp_det_pin>;
42*6d9a7bd6SLevin Du		simple-audio-card,name = "rockchip,es8388-codec";
43*6d9a7bd6SLevin Du		simple-audio-card,format = "i2s";
44*6d9a7bd6SLevin Du		simple-audio-card,mclk-fs = <256>;
45*6d9a7bd6SLevin Du		simple-audio-card,widgets =
46*6d9a7bd6SLevin Du			"Microphone", "Mic Jack",
47*6d9a7bd6SLevin Du			"Headphone", "Headphones";
48*6d9a7bd6SLevin Du		simple-audio-card,routing =
49*6d9a7bd6SLevin Du			"LINPUT1", "Mic Jack",
50*6d9a7bd6SLevin Du			"Headphone Amp INL", "LOUT2",
51*6d9a7bd6SLevin Du			"Headphone Amp INR", "ROUT2",
52*6d9a7bd6SLevin Du			"Headphones", "Headphone Amp OUTL",
53*6d9a7bd6SLevin Du			"Headphones", "Headphone Amp OUTR";
54*6d9a7bd6SLevin Du		simple-audio-card,hp-det-gpio = <&gpio2 RK_PA6 GPIO_ACTIVE_HIGH>;
55*6d9a7bd6SLevin Du		simple-audio-card,aux-devs = <&headphones_amp>;
56*6d9a7bd6SLevin Du		simple-audio-card,pin-switches = "Headphones";
57*6d9a7bd6SLevin Du
58*6d9a7bd6SLevin Du		simple-audio-card,codec {
59*6d9a7bd6SLevin Du			sound-dai = <&es8388>;
60*6d9a7bd6SLevin Du		};
61*6d9a7bd6SLevin Du
62*6d9a7bd6SLevin Du		simple-audio-card,cpu {
63*6d9a7bd6SLevin Du			sound-dai = <&i2s1>;
64*6d9a7bd6SLevin Du		};
65*6d9a7bd6SLevin Du	};
66*6d9a7bd6SLevin Du
67*6d9a7bd6SLevin Du	gpio-fan {
68*6d9a7bd6SLevin Du		#cooling-cells = <2>;
69*6d9a7bd6SLevin Du		compatible = "gpio-fan";
70*6d9a7bd6SLevin Du		gpio-fan,speed-map = <0 0 3000 1>;
71*6d9a7bd6SLevin Du		gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
72*6d9a7bd6SLevin Du	};
73*6d9a7bd6SLevin Du
74*6d9a7bd6SLevin Du	/delete-node/ gpio-keys;
75*6d9a7bd6SLevin Du
76*6d9a7bd6SLevin Du	/* not amplifier, used as switcher only */
77*6d9a7bd6SLevin Du	headphones_amp: headphones-amp {
78*6d9a7bd6SLevin Du		compatible = "simple-audio-amplifier";
79*6d9a7bd6SLevin Du		pinctrl-names = "default";
80*6d9a7bd6SLevin Du		pinctrl-0 = <&ear_ctl_pin>;
81*6d9a7bd6SLevin Du		enable-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
82*6d9a7bd6SLevin Du		sound-name-prefix = "Headphone Amp";
83*6d9a7bd6SLevin Du		VCC-supply = <&vcca3v0_codec>;
84*6d9a7bd6SLevin Du	};
85*6d9a7bd6SLevin Du
86*6d9a7bd6SLevin Du	ir-receiver {
87*6d9a7bd6SLevin Du		linux,rc-map-name = "rc-khadas";
88*6d9a7bd6SLevin Du	};
89*6d9a7bd6SLevin Du
90*6d9a7bd6SLevin Du	leds {
91*6d9a7bd6SLevin Du		pinctrl-names = "default";
92*6d9a7bd6SLevin Du		pinctrl-0 = <&work_led_pin>, <&diy_led_pin>;
93*6d9a7bd6SLevin Du	};
94*6d9a7bd6SLevin Du};
95*6d9a7bd6SLevin Du
96*6d9a7bd6SLevin Du&fusb0 {
97*6d9a7bd6SLevin Du	vbus-supply = <&vcc_vbus_typec1>;
98*6d9a7bd6SLevin Du};
99*6d9a7bd6SLevin Du
100*6d9a7bd6SLevin Du&i2c0 {
101*6d9a7bd6SLevin Du	hym8563: hym8563@51 {
102*6d9a7bd6SLevin Du		compatible = "haoyu,hym8563";
103*6d9a7bd6SLevin Du		reg = <0x51>;
104*6d9a7bd6SLevin Du		interrupt-parent = <&gpio0>;
105*6d9a7bd6SLevin Du		interrupts = <RK_PA5 IRQ_TYPE_EDGE_FALLING>;
106*6d9a7bd6SLevin Du		#clock-cells = <0>;
107*6d9a7bd6SLevin Du		clock-frequency = <32768>;
108*6d9a7bd6SLevin Du		clock-output-names = "xin32k";
109*6d9a7bd6SLevin Du		pinctrl-names = "default";
110*6d9a7bd6SLevin Du		pinctrl-0 = <&hym8563_int>;
111*6d9a7bd6SLevin Du	};
112*6d9a7bd6SLevin Du};
113*6d9a7bd6SLevin Du
114*6d9a7bd6SLevin Du&i2c1 {
115*6d9a7bd6SLevin Du	es8388: es8388@11 {
116*6d9a7bd6SLevin Du		compatible = "everest,es8388";
117*6d9a7bd6SLevin Du		reg = <0x11>;
118*6d9a7bd6SLevin Du		clock-names = "mclk";
119*6d9a7bd6SLevin Du		clocks = <&cru SCLK_I2S_8CH_OUT>;
120*6d9a7bd6SLevin Du		#sound-dai-cells = <0>;
121*6d9a7bd6SLevin Du	};
122*6d9a7bd6SLevin Du};
123*6d9a7bd6SLevin Du
124*6d9a7bd6SLevin Du/* <4 RK_PA0 1 &pcfg_pull_none> is used as i2s_8ch_mclk_pin */
125*6d9a7bd6SLevin Du&i2s0_8ch_bus {
126*6d9a7bd6SLevin Du	rockchip,pins =
127*6d9a7bd6SLevin Du		<3 RK_PD0 1 &pcfg_pull_none>,
128*6d9a7bd6SLevin Du		<3 RK_PD1 1 &pcfg_pull_none>,
129*6d9a7bd6SLevin Du		<3 RK_PD2 1 &pcfg_pull_none>,
130*6d9a7bd6SLevin Du		<3 RK_PD3 1 &pcfg_pull_none>,
131*6d9a7bd6SLevin Du		<3 RK_PD4 1 &pcfg_pull_none>,
132*6d9a7bd6SLevin Du		<3 RK_PD5 1 &pcfg_pull_none>,
133*6d9a7bd6SLevin Du		<3 RK_PD6 1 &pcfg_pull_none>,
134*6d9a7bd6SLevin Du		<3 RK_PD7 1 &pcfg_pull_none>;
135*6d9a7bd6SLevin Du};
136*6d9a7bd6SLevin Du
137*6d9a7bd6SLevin Du&i2s1 {
138*6d9a7bd6SLevin Du	pinctrl-names = "default";
139*6d9a7bd6SLevin Du	pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
140*6d9a7bd6SLevin Du	rockchip,playback-channels = <2>;
141*6d9a7bd6SLevin Du	rockchip,capture-channels = <2>;
142*6d9a7bd6SLevin Du	status = "okay";
143*6d9a7bd6SLevin Du};
144*6d9a7bd6SLevin Du
145*6d9a7bd6SLevin Du&pinctrl {
146*6d9a7bd6SLevin Du	es8388 {
147*6d9a7bd6SLevin Du		ear_ctl_pin: ear-ctl-pin {
148*6d9a7bd6SLevin Du			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_output_high>;
149*6d9a7bd6SLevin Du		};
150*6d9a7bd6SLevin Du
151*6d9a7bd6SLevin Du		hp_det_pin: hp-det-pin {
152*6d9a7bd6SLevin Du			rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_down>;
153*6d9a7bd6SLevin Du		};
154*6d9a7bd6SLevin Du	};
155*6d9a7bd6SLevin Du
156*6d9a7bd6SLevin Du	hym8563 {
157*6d9a7bd6SLevin Du		hym8563_int: hym8563-int {
158*6d9a7bd6SLevin Du			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
159*6d9a7bd6SLevin Du		};
160*6d9a7bd6SLevin Du	};
161*6d9a7bd6SLevin Du
162*6d9a7bd6SLevin Du	i2s1 {
163*6d9a7bd6SLevin Du		i2s_8ch_mclk_pin: i2s-8ch-mclk-pin {
164*6d9a7bd6SLevin Du			rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
165*6d9a7bd6SLevin Du		};
166*6d9a7bd6SLevin Du	};
167*6d9a7bd6SLevin Du};
168*6d9a7bd6SLevin Du
169*6d9a7bd6SLevin Du&u2phy0 {
170*6d9a7bd6SLevin Du	status = "okay";
171*6d9a7bd6SLevin Du
172*6d9a7bd6SLevin Du	u2phy0_otg: otg-port {
173*6d9a7bd6SLevin Du		phy-supply = <&vcc_vbus_typec1>;
174*6d9a7bd6SLevin Du		status = "okay";
175*6d9a7bd6SLevin Du	};
176*6d9a7bd6SLevin Du
177*6d9a7bd6SLevin Du	u2phy0_host: host-port {
178*6d9a7bd6SLevin Du		phy-supply = <&vcc5v0_host>;
179*6d9a7bd6SLevin Du		status = "okay";
180*6d9a7bd6SLevin Du	};
181*6d9a7bd6SLevin Du};
182*6d9a7bd6SLevin Du
183*6d9a7bd6SLevin Du&u2phy1 {
184*6d9a7bd6SLevin Du	status = "okay";
185*6d9a7bd6SLevin Du
186*6d9a7bd6SLevin Du	u2phy1_otg: otg-port {
187*6d9a7bd6SLevin Du		phy-supply = <&vcc5v0_host>;
188*6d9a7bd6SLevin Du		status = "okay";
189*6d9a7bd6SLevin Du	};
190*6d9a7bd6SLevin Du
191*6d9a7bd6SLevin Du	u2phy1_host: host-port {
192*6d9a7bd6SLevin Du		phy-supply = <&vcc5v0_host>;
193*6d9a7bd6SLevin Du		status = "okay";
194*6d9a7bd6SLevin Du	};
195*6d9a7bd6SLevin Du};
196*6d9a7bd6SLevin Du
197*6d9a7bd6SLevin Du&uart0 {
198*6d9a7bd6SLevin Du	pinctrl-names = "default";
199*6d9a7bd6SLevin Du	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
200*6d9a7bd6SLevin Du	status = "okay";
201*6d9a7bd6SLevin Du};
202*6d9a7bd6SLevin Du
203*6d9a7bd6SLevin Du&usbdrd_dwc3_0 {
204*6d9a7bd6SLevin Du	dr_mode = "host";
205*6d9a7bd6SLevin Du	status = "okay";
206*6d9a7bd6SLevin Du};
207*6d9a7bd6SLevin Du
208*6d9a7bd6SLevin Du&vcc_sys {
209*6d9a7bd6SLevin Du	/* vcc_sys is fixed, not controlled by any gpio */
210*6d9a7bd6SLevin Du	/delete-property/ gpio;
211*6d9a7bd6SLevin Du	/delete-property/ pinctrl-names;
212*6d9a7bd6SLevin Du	/delete-property/ pinctrl-0;
213*6d9a7bd6SLevin Du};
214*6d9a7bd6SLevin Du
215*6d9a7bd6SLevin Du&vcc5v0_host {
216*6d9a7bd6SLevin Du	pinctrl-names = "default";
217*6d9a7bd6SLevin Du	pinctrl-0 = <&vcc5v0_host_en>;
218*6d9a7bd6SLevin Du};
219