From 26b4e128e2a32548fdd431ff5eefc7f01f60af13 Mon Sep 17 00:00:00 2001 From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Date: Thu, 13 Feb 2025 20:13:12 +0100 Subject: [PATCH] board: rockchip: add fusb302 node on Sige5 The Sige5 uses two fusb302 controllers, one of which is on the USB Type C power input connector. Add this controller to the Sige5's u-boot specific tree, as it is critical that it is initialised before Linux takes over, so that it does not kill the power input once someone adds the fusb302 node to its device tree. Also enable the necessary FUSB302 u-boot driver in the Sige5's defconfig. Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> --- arch/arm/dts/rk3576-armsom-sige5-u-boot.dtsi | 40 ++++++++++++++++++++ configs/sige5-rk3576_defconfig | 3 ++ 2 files changed, 43 insertions(+) diff --git a/arch/arm/dts/rk3576-armsom-sige5-u-boot.dtsi b/arch/arm/dts/rk3576-armsom-sige5-u-boot.dtsi index 7e0530d85d1..19f9a042994 100644 --- a/arch/arm/dts/rk3576-armsom-sige5-u-boot.dtsi +++ b/arch/arm/dts/rk3576-armsom-sige5-u-boot.dtsi @@ -1,5 +1,6 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) +#include <dt-bindings/usb/pd.h> #include "rk3576-u-boot.dtsi" / { @@ -9,6 +10,45 @@ }; }; +&i2c0 { + pinctrl-0 = <&i2c0m1_xfer>; + pinctrl-names = "default"; + + status = "okay"; + + usbc_power: usb-typec@22 { + compatible = "fcs,fusb302"; + reg = <0x22>; + interrupt-parent = <&gpio0>; + interrupts = <RK_PC3 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&usbc_power_int>; + pinctrl-names = "default"; + status = "okay"; + + usb_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + data-role = "dual"; + power-role = "sink"; + try-power-role = "sink"; + 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) + >; + }; + }; +}; + +&pinctrl { + usb { + usbc_power_int: usbc-power-int { + rockchip,pins = <0 RK_PC3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + &red_led { default-state = "on"; }; diff --git a/configs/sige5-rk3576_defconfig b/configs/sige5-rk3576_defconfig index 83a49d93a8c..65c372aff8d 100644 --- a/configs/sige5-rk3576_defconfig +++ b/configs/sige5-rk3576_defconfig @@ -45,3 +45,6 @@ CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550_MEM32=y CONFIG_SYSRESET_PSCI=y CONFIG_ERRNO_STR=y +CONFIG_USB=y +CONFIG_TYPEC_TCPM=y +CONFIG_TYPEC_FUSB302=y -- GitLab