STM32MP15 USB driver not loading
I'm attempting to upgrade from ecosystem v2 to v4 and I've run into an issue where the USB OTG port no longer enumerates at boot time. Specifically, I no longer see any messages in dmesg regarding the dwc device, nor do I see anything in /sys/class/udc/. This is a regression from my v2 build where USB does work as expected.
I am not using ST's Yocto build for my build, rather I have the defconfig and device trees build against the ST repositories directly (as originally demonstrated by Octavo's ubuntu build.)
As I'm not seeing the dwc driver report anything in dmesg, I'm assuming it's some sort of defconfig or device tree settings issue rather than something in the clocks or handoff between the bootloaders and the secure peripheral firewall. Digging through the patch history, the change notes, the wiki, and the existing discovery kit builds/defconfigs/dt files hasn't yielded fruit.
So; has anyone done the upgrade between releases and off the top of their head know what I'm missing?
For completeness, I'm running SP_MIN with the following branches
Arm Trusted Firmware: v2.6-stm32mp-r2
U-Boot: v2021.10-stm32mp-r2
Linux: v5.15-stm32mp-r2
In the tf-a device tree, I have
* enabled the CLK_USBPHY_HSE and CLK_USBO_USBPHY clocks,
* set status="okay" for usbotg_hs, usbphyc, usbphyc_port0, and usbphyc_port1
* set protection DECPROT(STM32MP1_ETZPC_OTG_ID, DECPROT_NS_RW, DECPROT_UNLOCK) in etzpc
In the Linux device tree, I have set the following nodes:
&usbh_ehci {
phys = <&usbphyc_port0>;
phy-names = "usb";
status = "okay";
};
&usbh_ohci{
phys = <&usbphyc_port0>;
phy-names = "usb";
status = "okay";
};
&usbotg_hs{
compatible = "st,stm32mp15-hsotg", "snps,dwc2";
u-boot,dm-pre-reloc;
status = "okay";
phys = <&usbphyc_port1 0>;
phy-names = "usb2-phy";
dr_mode = "peripheral";
usb-role-switch;
role-switch-default-mode = "peripheral";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&usb_otg_hs_pins_mx>;
pinctrl-1 = <&usb_otg_hs_sleep_pins_mx>;
};
&usbphyc{
u-boot,dm-pre-reloc;
status = "okay";
};
&usbphyc_port0{
u-boot,dm-pre-reloc;
status = "okay";
phy-supply = <&vdd_usb>;
st,phy-tuning = <&usb_phy_tuning>;
};
&usbphyc_port1{
u-boot,dm-pre-reloc;
status = "okay";
phy-supply = <&vdd_usb>;
st,phy-tuning = <&usb_phy_tuning>;
};And in the Linux defconfig, I've ensured that I have
CONFIG_USB=y
CONFIG_USB_OTG=y
CONFIG_USB_GADGET=y
CONFIG_USB_DWC2=y
CONFIG_USB_DWC2_DUAL_ROLE=y
CONFIG_PHY_STM32_USBPHYC=y
These settings seem to hit all the high notes in the Wiki, but I've also attached full versions for perusal.
Any help or insight would be appreciated.
