Skip to main content
jasonj2
Associate III
May 28, 2024
Solved

USBOTG_HS and FUSB302 device tree porblem.

  • May 28, 2024
  • 1 reply
  • 2480 views

Hello,

I am developing on a custom STM32MP151AAC board, the software is openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23. The board successfully booted, and most of the part works fine. The problem is I cannot make USBOTG run. My board use FUSB302 instead STUSB1600.

Now, the problem is I cannot make a usable device tree for usbotg_hs and fusb302, the kernel always complains

 

 

OF: graph: no port node found in /soc/i2c@5c002000/typec-portc@22

 

 

I had try my best to find where the problem is but without success. The device tree file and dmesg are attached in the thread.  Could anyone give me some suggestions?

Thanks.

 

 

 
Best answer by PatrickF

Hi @jasonj2 

I'm not expert in that, so I cannot help you more. I assume it is a generic Linux Device Tree issue.

Regards.

1 reply

PatrickF
Technical Moderator
May 28, 2024

Hi @jasonj2 

Did you have a look to https://wiki.st.com/stm32mpu/wiki/OTG_device_tree_configuration#DT_configuration_example_as_high_speed_OTG,_with_Type-C_connector ?

Maybe you simply have issue with i2C board configuration (in DT or in HW).

Regards

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here
jasonj2
jasonj2Author
Associate III
May 29, 2024

Hi PatrickF,

The device tree attached in the original post is according to the link you provided. The FUSB302 is attached to I2C4, the PMIC (axp209) is attached to I2C4 also. I can confirm that the axp209 is working well, so the I2C4 bus can be assumed works OK.

I use STM32CubeMX to generate the DTSs, and modified according my custom board. Here is the fragment of the DTS related to usbotg_hs and FUSB302. The full DTS and dmesg are attached in the original post.

 

&usbotg_hs{
	status = "okay";

	/* USER CODE BEGIN usbotg_hs */
	/* Use USBPHYC HS PHY port #2, 
	 * configure UTMI switch to select USBOTG controller */
	phys = <&usbphyc_port1 0>;
	phy-names = "usb2-phy";
	usb-role-switch;
	role-switch-default-mode = "peripheral";

	port {
		usbotg_hs_ep: endpoint {
			remote-endpoint = <&con_usbotg_hs_ep>;
		};
	};
	/* USER CODE END usbotg_hs */
};

&i2c4{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c4_pins_z_mx>;
	pinctrl-1 = <&i2c4_sleep_pins_z_mx>;
	status = "okay";

	/* USER CODE BEGIN i2c4 */
	i2c-scl-rising-time-ns = <185>;
	i2c-scl-falling-time-ns = <20>;
	clock-frequency = <100000>;
 ...
 ...
	fusb0: typec-portc@22 {
		compatible = "fcs,fusb302", "fairchild,fusb302";
		reg = <0x22>;

		pinctrl-0 = <&fusb0_int_a>;
		pinctrl-names = "default";
		interrupt-parent = <&gpioi>;
		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;

		vbus-supply = <&v5v_typec>;
		vbus = <&v5v_typec>;

		status = "okay";

		connector {
			compatible = "usb-c-connector";
			data-role = "dual";
			label = "USB-C";
			op-sink-microwatt = <5000000>;
			power-role = "dual";
			power-opmode = "default";
			sink-pdos =
				<PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
			source-pdos =
				<PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
			try-power-role = "sink";
			dr_mode = "peripheral";
			role-switch-default-mode = "peripheral"; 

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

			// 	port@0 {
			// 		reg = <0>;
			// 		con_usbotg_hs_ep: endpoint {
			// 			remote-endpoint = <&usbotg_hs_ep>;
			// 		};
			// 	};
			// };

			port {
				con_usbotg_hs_ep: endpoint {
					remote-endpoint = <&usbotg_hs_ep>;
				};
			};
		};
	};
	/* USER CODE END i2c4 */
};

There is only one line that is related to the FUSB302 which is 

OF: graph: no port node found in /soc/i2c@5c002000/typec-portc@22

It looks like because the device tree the kernel even not try to probe the FUSB302.  But I did configure the port and connection between usbotg_hs and fusb302.  It is strange, I cannot figure out where the problem is.

PatrickF
PatrickFBest answer
Technical Moderator
May 29, 2024

Hi @jasonj2 

I'm not expert in that, so I cannot help you more. I assume it is a generic Linux Device Tree issue.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here