2023-10-09 03:57 PM
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.
Solved! Go to Solution.
2023-11-03 08:41 AM
I have resolved this issue. At the end of the day it was *something* in the defconfig not getting set correctly. My process for generating a minimal defconfig for my setup was flawed.
What did work to generate a working defconfig was to only interact with `make menuconfig` and hunt down all the entries I wished to remove graphically. Then `make savedefconfig` would make sure that options required but which had been transitively implied became explicit.
2023-10-10 06:29 AM
Hello @MWalk.3 ,
I do not have a lot of stuff to help you here with the information I have. and I do not see any obvious issue in both your configuration file and your device tree.
I think the only way to understand what happens here is to activate dynamig debug to have more traces, and raise loglevel to 8 in the Kernel bootcmd. Then I propose you to share entirely your dmesg to check what is done and if errors are displayed.
Kind regards,
Erwan.
2023-11-03 08:41 AM
I have resolved this issue. At the end of the day it was *something* in the defconfig not getting set correctly. My process for generating a minimal defconfig for my setup was flawed.
What did work to generate a working defconfig was to only interact with `make menuconfig` and hunt down all the entries I wished to remove graphically. Then `make savedefconfig` would make sure that options required but which had been transitively implied became explicit.