16d9a7bd6SLevin Du// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
26d9a7bd6SLevin Du/*
36d9a7bd6SLevin Du * Copyright (c) 2017 T-Chip Intelligent Technology Co., Ltd
46d9a7bd6SLevin Du */
56d9a7bd6SLevin Du
66d9a7bd6SLevin Du/dts-v1/;
76d9a7bd6SLevin Du#include "rk3399-roc-pc.dtsi"
86d9a7bd6SLevin Du
96d9a7bd6SLevin Du/*
106d9a7bd6SLevin Du * Notice:
116d9a7bd6SLevin Du * 1. rk3399-roc-pc-plus is powered by dc_12v directly.
126d9a7bd6SLevin Du * 2. rk3399-roc-pc-plus has only vcc_bus_typec0 in schematic, which is coresponding
136d9a7bd6SLevin Du *    to vcc_vbus_typec1 in rk3399-roc-pc.
146d9a7bd6SLevin Du *    For simplicity, reserve the node name of vcc_vbus_typec1.
156d9a7bd6SLevin Du * 3. vcc5v0_host is actually 2 regulators (host0, 1) controlled by the same gpio.
166d9a7bd6SLevin Du */
176d9a7bd6SLevin Du
186d9a7bd6SLevin Du/delete-node/ &fusb1;
196d9a7bd6SLevin Du/delete-node/ &hub_rst;
206d9a7bd6SLevin Du/delete-node/ &mp8859;
216d9a7bd6SLevin Du/delete-node/ &vcc_sys_en;
226d9a7bd6SLevin Du/delete-node/ &vcc_vbus_typec0;
236d9a7bd6SLevin Du/delete-node/ &yellow_led;
246d9a7bd6SLevin Du
256d9a7bd6SLevin Du/ {
266d9a7bd6SLevin Du	model = "Firefly ROC-RK3399-PC-PLUS Board";
276d9a7bd6SLevin Du	compatible = "firefly,roc-rk3399-pc-plus", "rockchip,rk3399";
286d9a7bd6SLevin Du
296d9a7bd6SLevin Du	dc_12v: dc-12v {
306d9a7bd6SLevin Du		compatible = "regulator-fixed";
316d9a7bd6SLevin Du		regulator-name = "dc_12v";
326d9a7bd6SLevin Du		regulator-always-on;
336d9a7bd6SLevin Du		regulator-boot-on;
346d9a7bd6SLevin Du		regulator-min-microvolt = <12000000>;
356d9a7bd6SLevin Du		regulator-max-microvolt = <12000000>;
366d9a7bd6SLevin Du	};
376d9a7bd6SLevin Du
386d9a7bd6SLevin Du	es8388-sound {
396d9a7bd6SLevin Du		compatible = "simple-audio-card";
406d9a7bd6SLevin Du		pinctrl-names = "default";
416d9a7bd6SLevin Du		pinctrl-0 = <&hp_det_pin>;
426d9a7bd6SLevin Du		simple-audio-card,name = "rockchip,es8388-codec";
436d9a7bd6SLevin Du		simple-audio-card,format = "i2s";
446d9a7bd6SLevin Du		simple-audio-card,mclk-fs = <256>;
456d9a7bd6SLevin Du		simple-audio-card,widgets =
466d9a7bd6SLevin Du			"Microphone", "Mic Jack",
476d9a7bd6SLevin Du			"Headphone", "Headphones";
486d9a7bd6SLevin Du		simple-audio-card,routing =
496d9a7bd6SLevin Du			"LINPUT1", "Mic Jack",
506d9a7bd6SLevin Du			"Headphone Amp INL", "LOUT2",
516d9a7bd6SLevin Du			"Headphone Amp INR", "ROUT2",
526d9a7bd6SLevin Du			"Headphones", "Headphone Amp OUTL",
536d9a7bd6SLevin Du			"Headphones", "Headphone Amp OUTR";
546d9a7bd6SLevin Du		simple-audio-card,hp-det-gpio = <&gpio2 RK_PA6 GPIO_ACTIVE_HIGH>;
556d9a7bd6SLevin Du		simple-audio-card,aux-devs = <&headphones_amp>;
566d9a7bd6SLevin Du		simple-audio-card,pin-switches = "Headphones";
576d9a7bd6SLevin Du
586d9a7bd6SLevin Du		simple-audio-card,codec {
596d9a7bd6SLevin Du			sound-dai = <&es8388>;
606d9a7bd6SLevin Du		};
616d9a7bd6SLevin Du
626d9a7bd6SLevin Du		simple-audio-card,cpu {
636d9a7bd6SLevin Du			sound-dai = <&i2s1>;
646d9a7bd6SLevin Du		};
656d9a7bd6SLevin Du	};
666d9a7bd6SLevin Du
676d9a7bd6SLevin Du	gpio-fan {
686d9a7bd6SLevin Du		#cooling-cells = <2>;
696d9a7bd6SLevin Du		compatible = "gpio-fan";
706d9a7bd6SLevin Du		gpio-fan,speed-map = <0 0 3000 1>;
716d9a7bd6SLevin Du		gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
726d9a7bd6SLevin Du	};
736d9a7bd6SLevin Du
746d9a7bd6SLevin Du	/delete-node/ gpio-keys;
756d9a7bd6SLevin Du
766d9a7bd6SLevin Du	/* not amplifier, used as switcher only */
776d9a7bd6SLevin Du	headphones_amp: headphones-amp {
786d9a7bd6SLevin Du		compatible = "simple-audio-amplifier";
796d9a7bd6SLevin Du		pinctrl-names = "default";
806d9a7bd6SLevin Du		pinctrl-0 = <&ear_ctl_pin>;
816d9a7bd6SLevin Du		enable-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
826d9a7bd6SLevin Du		sound-name-prefix = "Headphone Amp";
836d9a7bd6SLevin Du		VCC-supply = <&vcca3v0_codec>;
846d9a7bd6SLevin Du	};
856d9a7bd6SLevin Du
866d9a7bd6SLevin Du	ir-receiver {
876d9a7bd6SLevin Du		linux,rc-map-name = "rc-khadas";
886d9a7bd6SLevin Du	};
896d9a7bd6SLevin Du
906d9a7bd6SLevin Du	leds {
916d9a7bd6SLevin Du		pinctrl-names = "default";
926d9a7bd6SLevin Du		pinctrl-0 = <&work_led_pin>, <&diy_led_pin>;
936d9a7bd6SLevin Du	};
946d9a7bd6SLevin Du};
956d9a7bd6SLevin Du
966d9a7bd6SLevin Du&fusb0 {
976d9a7bd6SLevin Du	vbus-supply = <&vcc_vbus_typec1>;
986d9a7bd6SLevin Du};
996d9a7bd6SLevin Du
1006d9a7bd6SLevin Du&i2c0 {
101*67a9aeefSSebastian Reichel	hym8563: rtc@51 {
1026d9a7bd6SLevin Du		compatible = "haoyu,hym8563";
1036d9a7bd6SLevin Du		reg = <0x51>;
1046d9a7bd6SLevin Du		interrupt-parent = <&gpio0>;
1056d9a7bd6SLevin Du		interrupts = <RK_PA5 IRQ_TYPE_EDGE_FALLING>;
1066d9a7bd6SLevin Du		#clock-cells = <0>;
1076d9a7bd6SLevin Du		clock-output-names = "xin32k";
1086d9a7bd6SLevin Du		pinctrl-names = "default";
1096d9a7bd6SLevin Du		pinctrl-0 = <&hym8563_int>;
1106d9a7bd6SLevin Du	};
1116d9a7bd6SLevin Du};
1126d9a7bd6SLevin Du
1136d9a7bd6SLevin Du&i2c1 {
1146d9a7bd6SLevin Du	es8388: es8388@11 {
1156d9a7bd6SLevin Du		compatible = "everest,es8388";
1166d9a7bd6SLevin Du		reg = <0x11>;
1176d9a7bd6SLevin Du		clock-names = "mclk";
1186d9a7bd6SLevin Du		clocks = <&cru SCLK_I2S_8CH_OUT>;
1196d9a7bd6SLevin Du		#sound-dai-cells = <0>;
1206d9a7bd6SLevin Du	};
1216d9a7bd6SLevin Du};
1226d9a7bd6SLevin Du
1236d9a7bd6SLevin Du/* <4 RK_PA0 1 &pcfg_pull_none> is used as i2s_8ch_mclk_pin */
1246d9a7bd6SLevin Du&i2s0_8ch_bus {
1256d9a7bd6SLevin Du	rockchip,pins =
1266d9a7bd6SLevin Du		<3 RK_PD0 1 &pcfg_pull_none>,
1276d9a7bd6SLevin Du		<3 RK_PD1 1 &pcfg_pull_none>,
1286d9a7bd6SLevin Du		<3 RK_PD2 1 &pcfg_pull_none>,
1296d9a7bd6SLevin Du		<3 RK_PD3 1 &pcfg_pull_none>,
1306d9a7bd6SLevin Du		<3 RK_PD4 1 &pcfg_pull_none>,
1316d9a7bd6SLevin Du		<3 RK_PD5 1 &pcfg_pull_none>,
1326d9a7bd6SLevin Du		<3 RK_PD6 1 &pcfg_pull_none>,
1336d9a7bd6SLevin Du		<3 RK_PD7 1 &pcfg_pull_none>;
1346d9a7bd6SLevin Du};
1356d9a7bd6SLevin Du
1366d9a7bd6SLevin Du&i2s1 {
1376d9a7bd6SLevin Du	pinctrl-names = "default";
1386d9a7bd6SLevin Du	pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
1396d9a7bd6SLevin Du	rockchip,playback-channels = <2>;
1406d9a7bd6SLevin Du	rockchip,capture-channels = <2>;
1416d9a7bd6SLevin Du	status = "okay";
1426d9a7bd6SLevin Du};
1436d9a7bd6SLevin Du
1446d9a7bd6SLevin Du&pinctrl {
1456d9a7bd6SLevin Du	es8388 {
1466d9a7bd6SLevin Du		ear_ctl_pin: ear-ctl-pin {
1476d9a7bd6SLevin Du			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_output_high>;
1486d9a7bd6SLevin Du		};
1496d9a7bd6SLevin Du
1506d9a7bd6SLevin Du		hp_det_pin: hp-det-pin {
1516d9a7bd6SLevin Du			rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_down>;
1526d9a7bd6SLevin Du		};
1536d9a7bd6SLevin Du	};
1546d9a7bd6SLevin Du
1556d9a7bd6SLevin Du	hym8563 {
1566d9a7bd6SLevin Du		hym8563_int: hym8563-int {
1576d9a7bd6SLevin Du			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
1586d9a7bd6SLevin Du		};
1596d9a7bd6SLevin Du	};
1606d9a7bd6SLevin Du
1616d9a7bd6SLevin Du	i2s1 {
1626d9a7bd6SLevin Du		i2s_8ch_mclk_pin: i2s-8ch-mclk-pin {
1636d9a7bd6SLevin Du			rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
1646d9a7bd6SLevin Du		};
1656d9a7bd6SLevin Du	};
1666d9a7bd6SLevin Du};
1676d9a7bd6SLevin Du
1686d9a7bd6SLevin Du&u2phy0 {
1696d9a7bd6SLevin Du	status = "okay";
1706d9a7bd6SLevin Du
1716d9a7bd6SLevin Du	u2phy0_otg: otg-port {
1726d9a7bd6SLevin Du		phy-supply = <&vcc_vbus_typec1>;
1736d9a7bd6SLevin Du		status = "okay";
1746d9a7bd6SLevin Du	};
1756d9a7bd6SLevin Du
1766d9a7bd6SLevin Du	u2phy0_host: host-port {
1776d9a7bd6SLevin Du		phy-supply = <&vcc5v0_host>;
1786d9a7bd6SLevin Du		status = "okay";
1796d9a7bd6SLevin Du	};
1806d9a7bd6SLevin Du};
1816d9a7bd6SLevin Du
1826d9a7bd6SLevin Du&u2phy1 {
1836d9a7bd6SLevin Du	status = "okay";
1846d9a7bd6SLevin Du
1856d9a7bd6SLevin Du	u2phy1_otg: otg-port {
1866d9a7bd6SLevin Du		phy-supply = <&vcc5v0_host>;
1876d9a7bd6SLevin Du		status = "okay";
1886d9a7bd6SLevin Du	};
1896d9a7bd6SLevin Du
1906d9a7bd6SLevin Du	u2phy1_host: host-port {
1916d9a7bd6SLevin Du		phy-supply = <&vcc5v0_host>;
1926d9a7bd6SLevin Du		status = "okay";
1936d9a7bd6SLevin Du	};
1946d9a7bd6SLevin Du};
1956d9a7bd6SLevin Du
1966d9a7bd6SLevin Du&uart0 {
1976d9a7bd6SLevin Du	pinctrl-names = "default";
1986d9a7bd6SLevin Du	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
1996d9a7bd6SLevin Du	status = "okay";
2006d9a7bd6SLevin Du};
2016d9a7bd6SLevin Du
2026d9a7bd6SLevin Du&usbdrd_dwc3_0 {
2036d9a7bd6SLevin Du	dr_mode = "host";
2046d9a7bd6SLevin Du	status = "okay";
2056d9a7bd6SLevin Du};
2066d9a7bd6SLevin Du
2076d9a7bd6SLevin Du&vcc_sys {
2086d9a7bd6SLevin Du	/* vcc_sys is fixed, not controlled by any gpio */
2096d9a7bd6SLevin Du	/delete-property/ gpio;
2106d9a7bd6SLevin Du	/delete-property/ pinctrl-names;
2116d9a7bd6SLevin Du	/delete-property/ pinctrl-0;
2126d9a7bd6SLevin Du};
2136d9a7bd6SLevin Du
2146d9a7bd6SLevin Du&vcc5v0_host {
2156d9a7bd6SLevin Du	pinctrl-names = "default";
2166d9a7bd6SLevin Du	pinctrl-0 = <&vcc5v0_host_en>;
2176d9a7bd6SLevin Du};
218