All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: rockchip: add usb typec host support to rk3588-jaguar
@ 2025-02-13 16:30 ` Heiko Stuebner
  0 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2025-02-13 16:30 UTC (permalink / raw)
  To: heiko
  Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel,
	Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

Jaguar has two type-c ports connected to fusb302 controllers that can
work both in host and device mode and can also run in display-port
altmode.

While these ports can work in dual-role data mode, they do not support
powering the device itself as power-sink. This causes issues because
the current infrastructure does not cope well with dual-role data
without dual-role power.

So add the necessary nodes for the type-c controllers as well
as enable the relevant core usb nodes, but limit the mode to host-mode
for now until we figure out device mode.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 .../arm64/boot/dts/rockchip/rk3588-jaguar.dts | 178 ++++++++++++++++++
 1 file changed, 178 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts
index 90f823b2c219..329d98011c60 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts
@@ -333,6 +333,52 @@ rtc_twi: rtc@6f {
 		};
 	};
 
+	usb-typec@22 {
+		compatible = "fcs,fusb302";
+		reg = <0x22>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
+		vbus-supply = <&vcc_5v0_usb_c1>;
+
+		connector {
+			compatible = "usb-c-connector";
+			data-role = "dual";
+			label = "USBC-1 P11";
+			power-role = "source";
+			source-pdos =
+				<PDO_FIXED(5000, 1500, PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM)>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					usbc0_hs: endpoint {
+						remote-endpoint = <&usb_host0_xhci_drd_sw>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					usbc0_ss: endpoint {
+						remote-endpoint = <&usbdp_phy0_typec_ss>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+
+					usbc0_sbu: endpoint {
+						remote-endpoint = <&usbdp_phy0_typec_sbu>;
+					};
+				};
+			};
+		};
+	};
+
 	vdd_npu_s0: regulator@42 {
 		compatible = "rockchip,rk8602";
 		reg = <0x42>;
@@ -394,6 +440,52 @@ &i2c8 {
 	pinctrl-0 = <&i2c8m2_xfer>;
 	status = "okay";
 
+	usb-typec@22 {
+		compatible = "fcs,fusb302";
+		reg = <0x22>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <RK_PA4 IRQ_TYPE_LEVEL_LOW>;
+		vbus-supply = <&vcc_5v0_usb_c2>;
+
+		connector {
+			compatible = "usb-c-connector";
+			data-role = "dual";
+			label = "USBC-2 P12";
+			power-role = "source";
+			source-pdos =
+				<PDO_FIXED(5000, 1500, PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM)>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					usbc1_hs: endpoint {
+						remote-endpoint = <&usb_host1_xhci_drd_sw>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					usbc1_ss: endpoint {
+						remote-endpoint = <&usbdp_phy1_typec_ss>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+
+					usbc1_sbu: endpoint {
+						remote-endpoint = <&usbdp_phy1_typec_sbu>;
+					};
+				};
+			};
+		};
+	};
+
 	vdd_cpu_big0_s0: regulator@42 {
 		compatible = "rockchip,rk8602";
 		reg = <0x42>;
@@ -851,6 +943,24 @@ &tsadc {
 	status = "okay";
 };
 
+&u2phy0 {
+	status = "okay";
+};
+
+&u2phy0_otg {
+	phy-supply = <&vcc_5v0_usb_c1>;
+	status = "okay";
+};
+
+&u2phy1 {
+	status = "okay";
+};
+
+&u2phy1_otg {
+	phy-supply = <&vcc_5v0_usb_c2>;
+	status = "okay";
+};
+
 &u2phy2 {
 	status = "okay";
 };
@@ -893,6 +1003,46 @@ &uart7 {
 	status = "okay";
 };
 
+&usbdp_phy0 {
+	orientation-switch;
+	status = "okay";
+
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usbdp_phy0_typec_ss: endpoint@0 {
+			reg = <0>;
+			remote-endpoint = <&usbc0_ss>;
+		};
+
+		usbdp_phy0_typec_sbu: endpoint@1 {
+			reg = <1>;
+			remote-endpoint = <&usbc0_sbu>;
+		};
+	};
+};
+
+&usbdp_phy1 {
+	orientation-switch;
+	status = "okay";
+
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usbdp_phy1_typec_ss: endpoint@0 {
+			reg = <0>;
+			remote-endpoint = <&usbc1_ss>;
+		};
+
+		usbdp_phy1_typec_sbu: endpoint@1 {
+			reg = <1>;
+			remote-endpoint = <&usbc1_sbu>;
+		};
+	};
+};
+
 /* host0 on P10 USB-A */
 &usb_host0_ehci {
 	status = "okay";
@@ -903,6 +1053,34 @@ &usb_host0_ohci {
 	status = "okay";
 };
 
+&usb_host0_xhci {
+	dr_mode = "host";
+	status = "okay";
+
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usb_host0_xhci_drd_sw: endpoint {
+			remote-endpoint = <&usbc0_hs>;
+		};
+	};
+};
+
+&usb_host1_xhci {
+	dr_mode = "host";
+	status = "okay";
+
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usb_host1_xhci_drd_sw: endpoint {
+			remote-endpoint = <&usbc1_hs>;
+		};
+	};
+};
+
 /* host1 on M.2 E-key */
 &usb_host1_ehci {
 	status = "okay";
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread
* Re: [PATCH] arm64: dts: rockchip: add usb typec host support to rk3588-jaguar
@ 2025-02-14 14:17 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-02-14 14:17 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "dtcheck: binding changes may go via different trees"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250213163013.1616467-1-heiko@sntech.de>
References: <20250213163013.1616467-1-heiko@sntech.de>
TO: Heiko Stuebner <heiko@sntech.de>
TO: heiko@sntech.de
CC: quentin.schulz@cherry.de
CC: linux-arm-kernel@lists.infradead.org
CC: linux-rockchip@lists.infradead.org
CC: linux-kernel@vger.kernel.org
CC: Heiko Stuebner <heiko.stuebner@cherry.de>

Hi Heiko,

kernel test robot noticed the following build warnings:

[auto build test WARNING on rockchip/for-next]
[also build test WARNING on linus/master v6.14-rc2 next-20250214]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Heiko-Stuebner/arm64-dts-rockchip-add-usb-typec-host-support-to-rk3588-jaguar/20250214-005733
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
patch link:    https://lore.kernel.org/r/20250213163013.1616467-1-heiko%40sntech.de
patch subject: [PATCH] arm64: dts: rockchip: add usb typec host support to rk3588-jaguar
:::::: branch date: 21 hours ago
:::::: commit date: 21 hours ago
config: arm64-randconfig-r072-20250214 (https://download.01.org/0day-ci/archive/20250214/202502142205.zvKIYux8-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 14.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202502142205.zvKIYux8-lkp@intel.com/

dtcheck warnings: (new ones prefixed by >>)
>> arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts:1060.7-1067.4: Warning (avoid_unnecessary_addr_size): /usb@fc000000/port: unnecessary #address-cells/#size-cells without "ranges", "dma-ranges" or child "reg" property
>> arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts:1074.7-1081.4: Warning (avoid_unnecessary_addr_size): /usb@fc400000/port: unnecessary #address-cells/#size-cells without "ranges", "dma-ranges" or child "reg" property
>> arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts:1060.7-1067.4: Warning (graph_child_address): /usb@fc000000/port: graph node has single child node 'endpoint', #address-cells/#size-cells are not necessary
>> arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts:1074.7-1081.4: Warning (graph_child_address): /usb@fc400000/port: graph node has single child node 'endpoint', #address-cells/#size-cells are not necessary

vim +1060 arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts

d1b8b36a2cc5f4 Heiko Stuebner 2023-12-01  1055  
f14a0f693692a0 Heiko Stuebner 2025-02-13  1056  &usb_host0_xhci {
f14a0f693692a0 Heiko Stuebner 2025-02-13  1057  	dr_mode = "host";
f14a0f693692a0 Heiko Stuebner 2025-02-13  1058  	status = "okay";
f14a0f693692a0 Heiko Stuebner 2025-02-13  1059  
f14a0f693692a0 Heiko Stuebner 2025-02-13 @1060  	port {
f14a0f693692a0 Heiko Stuebner 2025-02-13  1061  		#address-cells = <1>;
f14a0f693692a0 Heiko Stuebner 2025-02-13  1062  		#size-cells = <0>;
f14a0f693692a0 Heiko Stuebner 2025-02-13  1063  
f14a0f693692a0 Heiko Stuebner 2025-02-13  1064  		usb_host0_xhci_drd_sw: endpoint {
f14a0f693692a0 Heiko Stuebner 2025-02-13  1065  			remote-endpoint = <&usbc0_hs>;
f14a0f693692a0 Heiko Stuebner 2025-02-13  1066  		};
f14a0f693692a0 Heiko Stuebner 2025-02-13  1067  	};
f14a0f693692a0 Heiko Stuebner 2025-02-13  1068  };
f14a0f693692a0 Heiko Stuebner 2025-02-13  1069  
f14a0f693692a0 Heiko Stuebner 2025-02-13  1070  &usb_host1_xhci {
f14a0f693692a0 Heiko Stuebner 2025-02-13  1071  	dr_mode = "host";
f14a0f693692a0 Heiko Stuebner 2025-02-13  1072  	status = "okay";
f14a0f693692a0 Heiko Stuebner 2025-02-13  1073  
f14a0f693692a0 Heiko Stuebner 2025-02-13 @1074  	port {
f14a0f693692a0 Heiko Stuebner 2025-02-13  1075  		#address-cells = <1>;
f14a0f693692a0 Heiko Stuebner 2025-02-13  1076  		#size-cells = <0>;
f14a0f693692a0 Heiko Stuebner 2025-02-13  1077  
f14a0f693692a0 Heiko Stuebner 2025-02-13  1078  		usb_host1_xhci_drd_sw: endpoint {
f14a0f693692a0 Heiko Stuebner 2025-02-13  1079  			remote-endpoint = <&usbc1_hs>;
f14a0f693692a0 Heiko Stuebner 2025-02-13  1080  		};
f14a0f693692a0 Heiko Stuebner 2025-02-13  1081  	};
f14a0f693692a0 Heiko Stuebner 2025-02-13  1082  };
f14a0f693692a0 Heiko Stuebner 2025-02-13  1083  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-02-18 21:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-13 16:30 [PATCH] arm64: dts: rockchip: add usb typec host support to rk3588-jaguar Heiko Stuebner
2025-02-13 16:30 ` Heiko Stuebner
2025-02-18 11:24 ` Quentin Schulz
2025-02-18 11:24   ` Quentin Schulz
2025-02-18 21:02   ` Heiko Stübner
2025-02-18 21:02     ` Heiko Stübner
  -- strict thread matches above, loose matches on Subject: below --
2025-02-14 14:17 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.