How to add rt1711h USB Type-C PD controller to jetson AGX Xavier

Dear nvidia,I want to mount rt1711h USB Type-C PD controller via i2c on jetson agx xavier, how do I configure the device tree and driver configuration to use rt1711h, is there a reference tutorial, or guide me to modify it, thank you very much.

Hi,
On our developer kit, we use Cypress PD controller. Please check refer to the hardware design. For device tree programming, please look at adaptation guide:
Jetson Module Adaptation and Bring-Up: Jetson AGX Xavier Series — Jetson Linux Developer Guide documentation

Hello, I added a node to the ./hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2888-0001-p2822-0000-common.dtsi file, but I don’t know how to associate it to usb phy.How to configure the connection relationship between USB PHY and USB controller?

hdr40_i2c0: i2c@c240000 {	

	rt1711h: rt1711h@4e {
		compatible = "richtek,rt1711h";
		reg = <0x4e>;
		status = "okay";
		// interrupt-parent = <&gpio27>;
		// interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
		// pinctrl-names = "default";
		// pinctrl-0 = <&usb_cfg_func>;

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

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

				port@1 {
					reg = <1>;
					usb_con_ss: endpoint {
						remote-endpoint = <&usb3_data_ss>;
					};
				};
			};
			// ports {
			// 	#address-cells = <1>;
			// 	#size-cells = <0>;
			// 	port@1 {
			// 		reg = <1>;
			// 		usb_con_ss: endpoint {
			// 			remote-endpoint = <&dwc3_ss>;
			// 		};
			// 	};
			// };
		};

please spend some time reading the document… your question shall be covered in doc…

OK, I’ll read the doc first, and then ask if I encounter a problem, thank you

hello,I modified it with reference to the document you sent, the following is the file I modified, but I am not sure if it is correct?
tegra194-p2888-0001-p2822-0000-common.dtsi (10.8 KB)
Major modifications:

***************
*** 30,35 ****
--- 30,36 ----
  #include "tegra194-super-module-e2614-p2888-0000.dtsi"
  #include <t19x-common-platforms/tegra194-no-pll-aon-clock.dtsi>
  #include "dt-bindings/usb/pd.h"
+  #include <dt-bindings/usb/pd.h>
  / {
  	nvidia,dtsfilename = __FILE__;
  	nvidia,dtbbuildtime = __DATE__, __TIME__;
***************
*** 125,130 ****
--- 126,175 ----
  #endif
  
  	hdr40_i2c0: i2c@c240000 {	
+ 
+ 		rt1711h: rt1711h@4e {
+ 			compatible = "richtek,rt1711h";
+ 			reg = <0x4e>;
+ 			status = "okay";
+ 			// interrupt-parent = <&gpio27>;
+ 			// interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+ 			// pinctrl-names = "default";
+ 			// pinctrl-0 = <&usb_cfg_func>;
+ 			// vbus-supply = <&vcc5v0_typec>;
+ 			usb_con: connector {
+ 				compatible = "usb-c-connector";
+ 				label = "USB-C";
+ 				data-role = "dual";
+ 				power-role = "dual";
+ 				try-power-role = "sink";
+ 				source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
+ 				sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)
+ 						PDO_VAR(5000, 12000, 2000)>;
+ 				op-sink-microwatt = <10000000>;
+ 
+ 				ports {
+ 					#address-cells = <1>;
+ 					#size-cells = <0>;
+ 
+ 					port@1 {
+ 						reg = <1>;
+ 						usb_con_ss: endpoint {
+ 							remote-endpoint = <&ucsi_ccg_p0>;
+ 						};
+ 					};
+ 				};
+ 			};
+ 			port {
+ 				#address-cells = <1>;
+ 				#size-cells = <0>;
+ 
+ 				rt1711h_ep: endpoint@0 {
+ 					reg = <0>;
+ 					remote-endpoint = <&usb_role_switch0>;
+ 				};
+ 			};
+ 		};
+ 
  		bmi160@69 {
  			compatible = "bmi,bmi160";
  			reg = <0x69>;
***************
*** 163,171 ****
  				label = "USB-C";
  				data-role = "dual";
  				port {
! 					ucsi_ccg_p0: endpoint {
  						remote-endpoint = <&usb_role_switch0>;
  					};
  				};
  			};
  #endif
--- 208,219 ----
  				label = "USB-C";
  				data-role = "dual";
  				port {
! 					ucsi_ccg_p0: endpoint@0 {
  						remote-endpoint = <&usb_role_switch0>;
  					};
+ 					ucsi_ccg_p1: endpoint@1 {
+ 						remote-endpoint = <&usb_con_ss>;
+ 					};
  				};
  			};
  #endif
***************
*** 202,207 ****
--- 250,256 ----
  						nvidia,function = "xusb";
  						status = "okay";
  					};
+ 
  					usb3-2 {
  						nvidia,function = "xusb";
  						status = "okay";
***************
*** 219,229 ****
  				mode = "otg";
  				usb-role-switch;
  				status = "okay";
  #if TEGRA_XUSB_DT_VERSION >= DT_VERSION_3
  				port {
! 					usb_role_switch0: endpoint {
  						remote-endpoint = <&ucsi_ccg_p0>;
  					};
  				};
  #endif
  			};
--- 268,283 ----
  				mode = "otg";
  				usb-role-switch;
  				status = "okay";
+ 				vbus-supply = <&battery_reg>;
  #if TEGRA_XUSB_DT_VERSION >= DT_VERSION_3
  				port {
! 					usb_role_switch0: endpoint@0 {
  						remote-endpoint = <&ucsi_ccg_p0>;
  					};
+ 					dwc3_role_switch: endpoint@1 {
+ 						reg = <0>;
+ 						remote-endpoint = <&rt1711h_ep>;
+ 					};
  				};
  #endif
  			};

Hi, I mainly want to add a USB type-c CC controller to my system, you can do without implementing PD control, as long as there is CC detection control.

Also, jetson uses make menuconfig to open kernel support options, and compiles with the ./nvbuild.sh -o $PWD/kernel_out command will report an error, can only be configured in ./kernel/kernel-5.10/arch/arm64/configs/tegra_defconfig file configuration? Can I configure kernel support by modifying the Kconfig file?

config TYPEC_RT1711H
	bool "Richtek RT1711H Type-C chip driver"
    default y
	help
	  Richtek RT1711H Type-C chip driver that works with
	  Type-C Port Controller Manager to provide USB PD and USB
	  Type-C functionalities.

Which of these configuration methods is better