BeagleY-AI USB on kernel 6.12.x

Hi,

I am having trouble to get the USB ports running on my BeagleY-AI with kernel 6.12.24.
Works fine on kernel 6.1.x, but not on 6.12.x.

With 6.12.24 Lsusb shows nothing, dmesg shows no usb initialization, and the usb ports are not powered-up.

I used the dtb which came with the kernel packacke; also tried the most recent commit from v6.12.x-Beagle branch from the BeagleBoard-DeviceTrees repository.
Comparing the device tree sources from v6.1.x-Beagle and v6.12.x-Beagle it seems to me, that the embedded usb-hub is not properly initialized in the v6.12.x branch. Is that possible, or am I missing something there?

Thanks for any advice,
Michael

Right i was looking at this last week, pretty sure it’s just the usb phy reset nodes… Also need to submit it to mainline.. (at the time the beagley-ai device tree went mainline, usb on j722s wasn’t ready)..

Regards,

Hi, thanks for confirming.

I compared the dts files, added the missing parts and finally got it to work.

Here is what I added:

diff --git a/src/arm64/ti/k3-am67a-beagley-ai.dts b/src/arm64/ti/k3-am67a-beagley-ai.dts
index ee3a953..148c62f 100644
--- a/src/arm64/ti/k3-am67a-beagley-ai.dts
+++ b/src/arm64/ti/k3-am67a-beagley-ai.dts
@@ -29,6 +29,8 @@
 		mmc1 = &sdhci1;
 		mmc2 = &sdhci2;
 		rtc0 = &rtc;
+		usb0 = &usb0;
+		usb1 = &usb1;
 		i2c1 = &mcu_i2c0;
 	};
 
@@ -367,6 +369,12 @@
 		>;
 	};
 
+	main_usb1_pins_default: main-usb1-default-pins {
+		pinctrl-single,pins = <
+			J722S_IOPAD(0x0258, PIN_INPUT, 0) /* (B27) USB1_DRVVBUS */
+		>;
+	};
+
 	pmic_irq_pins_default: pmic-irq-default-pins {
 		pinctrl-single,pins = <
 			J722S_IOPAD(0x01f4, PIN_INPUT_PULLUP, 0) /* (B23) EXTINTn */
@@ -420,6 +428,12 @@
 		>;
 	};
 
+	usb_hub: usb-hub-default-pins {
+		pinctrl-single,pins = <
+			J722S_IOPAD(0x0084, PIN_OUTPUT, 7) /* (N21) GPMC0_ADVn_ALE.GPIO0_32 */
+		>;
+	};
+
 	wifi_pins_default: wifi-default-pins {
 		pinctrl-single,pins = <
 			J722S_IOPAD(0x0120, PIN_INPUT, 0) /* (F27) MMC2_CMD */
@@ -966,6 +980,10 @@
 		      <J722S_SERDES1_LANE0_PCIE0_LANE0>;
 };
 
+&serdes_wiz0 {
+	status = "okay";
+};
+
 &serdes0 {
 	status = "okay";
 	serdes0_usb_link: phy@0 {
@@ -977,6 +995,10 @@
 	};
 };
 
+&serdes_wiz1 {
+	status = "okay";
+};
+
 &serdes1 {
 	serdes1_pcie_link: phy@0 {
 		reg = <0>;
@@ -998,3 +1020,51 @@
 	reset-gpios = <&mcu_gpio0 6 GPIO_ACTIVE_HIGH>;
 	enable-gpios = <&mcu_gpio0 8 GPIO_ACTIVE_HIGH>; /* Extra GPIO for pwr_en for BeagleY AI */
 };
+
+&usbss0 {
+	ti,vbus-divider;
+	status = "okay";
+};
+
+&usb0 {
+	dr_mode = "otg";
+	usb-role-switch;
+};
+
+&usbss1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_usb1_pins_default>;
+	ti,vbus-divider;
+	status = "okay";
+};
+
+&usb1 {
+	dr_mode = "host";
+	maximum-speed = "super-speed";
+	phys = <&serdes0_usb_link>;
+	phy-names = "cdns3,usb3-phy";
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb_hub>;
+	status = "okay";
+
+	/* 2.0 hub on port 1 */
+	hub_2_0: hub@1 {
+		compatible = "usb451,8142";
+		reg = <1>;
+		peer-hub = <&hub_3_0>;
+		reset-gpios = <&main_gpio0 32 GPIO_ACTIVE_LOW>;
+		vdd-supply = <&vdd_3v3>;
+	};
+
+	/* 3.0 hub on port 2 */
+	hub_3_0: hub@2 {
+		compatible = "usb451,8140";
+		reg = <2>;
+		peer-hub = <&hub_2_0>;
+		reset-gpios = <&main_gpio0 32 GPIO_ACTIVE_LOW>;
+		vdd-supply = <&vdd_3v3>;
+	};
+};

Hope this helps

–Michael