Skip to content

Commit

Permalink
Khadas/Edge2: DTS: Enable HDMI, USB-C, Bluetooth and analog audio
Browse files Browse the repository at this point in the history
Note: Wi-Fi and Bluetooth require firmware blobs not yet upstreamed.

Signed-off-by: Mario Bălănică <[email protected]>
  • Loading branch information
mariobalanica committed Jan 3, 2025
1 parent 06408b6 commit 8d32572
Show file tree
Hide file tree
Showing 2 changed files with 272 additions and 1 deletion.
271 changes: 271 additions & 0 deletions devicetree/mainline/rk3588s-khadas-edge2-fixup.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

#include <dt-bindings/soc/rockchip,vop2.h>
#include <dt-bindings/usb/pd.h>
#include "rk3588s-khadas-edge2.dts"

/ {
analog-sound {
compatible = "audio-graph-card";
label = "rk3588-es8316";

widgets = "Microphone", "Mic Jack",
"Headphone", "Headphones";

routing = "MIC2", "Mic Jack",
"Headphones", "HPOL",
"Headphones", "HPOR";

dais = <&i2s0_8ch_p0>;
hp-det-gpios = <&gpio1 RK_PD3 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&hp_detect>;
};

hdmi0-con {
compatible = "hdmi-connector";
type = "a";

port {
hdmi0_con_in: endpoint {
remote-endpoint = <&hdmi0_out_con>;
};
};
};

vbus5v0_typec: regulator-vbus5v0-typec {
compatible = "regulator-fixed";
regulator-name = "vbus5v0_typec";
regulator-boot-on;
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
enable-active-high;
gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&typec5v_pwren>;
vin-supply = <&vcc5v0_sys>;
};
};

&i2c2 {
fusb302: typec-portc@22 {
compatible = "fcs,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio1>;
interrupts = <RK_PB5 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&usbc0_int>;
vbus-supply = <&vbus5v0_typec>;

usb_con: connector {
compatible = "usb-c-connector";
data-role = "dual";
label = "USB-C";
power-role = "dual";
try-power-role = "source";
op-sink-microwatt = <1000000>;
sink-pdos =
<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
PDO_FIXED(9000, 3000, PDO_FIXED_USB_COMM)
PDO_FIXED(12000, 3000, PDO_FIXED_USB_COMM)>;
source-pdos =
<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;

usbc0_orien_sw: endpoint {
remote-endpoint = <&usbdp_phy0_orientation_switch>;
};
};

port@1 {
reg = <1>;

usbc0_role_sw: endpoint {
remote-endpoint = <&dwc3_0_role_switch>;
};
};

port@2 {
reg = <2>;

dp_altmode_mux: endpoint {
remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
};
};
};
};
};
};

&i2c3 {
status = "okay";

es8316: audio-codec@10 {
compatible = "everest,es8316";
reg = <0x10>;
clocks = <&cru I2S0_8CH_MCLKOUT>;
clock-names = "mclk";
assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
assigned-clock-rates = <12288000>;
#sound-dai-cells = <0>;

port {
es8316_p0_0: endpoint {
remote-endpoint = <&i2s0_8ch_p0_0>;
};
};
};
};

&i2s0_8ch {
pinctrl-names = "default";
pinctrl-0 = <&i2s0_lrck
&i2s0_mclk
&i2s0_sclk
&i2s0_sdi0
&i2s0_sdo0>;
status = "okay";

i2s0_8ch_p0: port {
i2s0_8ch_p0_0: endpoint {
dai-format = "i2s";
mclk-fs = <256>;
remote-endpoint = <&es8316_p0_0>;
};
};
};

&pinctrl {
usb-typec {
usbc0_int: usbc0-int {
rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
};

typec5v_pwren: typec5v-pwren {
rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
};
};

sound {
hp_detect: hp-detect {
rockchip,pins = <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
};
};

bluetooth {
bt_reset: bt-reset {
rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
};

bt_dev_wake: bt-dev-wake {
rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
};

bt_host_wake: bt-host-wake {
rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
};
};
};

&uart9 {
pinctrl-names = "default";
pinctrl-0 = <&uart9m2_xfer>, <&uart9m2_rtsn>, <&uart9m2_ctsn>;
uart-has-rtscts;

bluetooth {
compatible = "brcm,bcm43752-bt", "cypress,cyw4373a0-bt";
max-speed = <4000000>;
clocks = <&hym8563>;
clock-names = "lpo";
shutdown-gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
device-wakeup-gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PD5 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "host-wakeup";
pinctrl-names = "default";
pinctrl-0 = <&bt_reset>, <&bt_dev_wake>, <&bt_host_wake>;
};
};

&u2phy0 {
status = "okay";
};

&u2phy0_otg {
status = "okay";
};

&usbdp_phy0 {
mode-switch;
orientation-switch;
sbu1-dc-gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_HIGH>;
sbu2-dc-gpios = <&gpio4 RK_PA1 GPIO_ACTIVE_HIGH>;
status = "okay";

port {
#address-cells = <1>;
#size-cells = <0>;

usbdp_phy0_orientation_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_orien_sw>;
};

usbdp_phy0_dp_altmode_mux: endpoint@1 {
reg = <1>;
remote-endpoint = <&dp_altmode_mux>;
};
};
};

&usb_host0_xhci {
usb-role-switch;
status = "okay";

port {
dwc3_0_role_switch: endpoint {
remote-endpoint = <&usbc0_role_sw>;
};
};
};

&hdmi0 {
status = "okay";
};

&hdmi0_in {
hdmi0_in_vp0: endpoint {
remote-endpoint = <&vp0_out_hdmi0>;
};
};

&hdmi0_out {
hdmi0_out_con: endpoint {
remote-endpoint = <&hdmi0_con_in>;
};
};

&hdptxphy_hdmi0 {
status = "okay";
};

&vop_mmu {
status = "okay";
};

&vop {
status = "okay";
};

&vp0 {
vp0_out_hdmi0: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
reg = <ROCKCHIP_VOP2_EP_HDMI0>;
remote-endpoint = <&hdmi0_in_vp0>;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
VERSION_STRING = 1.0

[Sources]
devicetree/mainline/upstream/src/arm64/rockchip/rk3588s-khadas-edge2.dts
devicetree/mainline/rk3588s-khadas-edge2-fixup.dts

[Packages]
MdePkg/MdePkg.dec
Expand Down

0 comments on commit 8d32572

Please sign in to comment.