dpeng
Occasional Contributor
1 month agoCyclone V: how to enable USB1 with a ULPI USB PHY (USB3320)?
I want to enable USB1 (USB 2.0 controller) of the Cyclone V in host-only mode. But Vbus is not present and no device is detected.
- A ULPI-compatible Microchip USB3320 USB PHY is connected to the Cyclone V with a ULPI interface. The CPEN pin of the USB3320 controls a power switch on the board. To enable the 5V Vbus voltage, used to power USB devices, the CPEN pin must be driven high. Its POR state is low.
- HPS_GPIO0 is connected to the active-low RESET# pin of the USB3320.
- To check if Vbus is on, I connected a mouse, that should light up when connected to a USB host.
The main DT file is socfpga.dtsi. I altered it a little in both Barebox and Linux v6.6.22:
&usbphy0 {
reset-gpios = <&porta 0 GPIO_ACTIVE_LOW>;
status = "okay";
};
&usb1 {
status = "okay";
dr_mode = "host";
};Barebox shows that GPIO0 (RESET#) is an output and is high, which is OK:
barebox:/ gpioinfo ff708000.gpio@ff708000:gpio-controller@0.of
GPIOs 454-482, chip ff708000.gpio@ff708000:gpio-controller@0.of:
dir val requested name label
GPIO 0: out hi active low soc:usbphy.of reset
GPIO 1: in lo false
GPIO 2: in lo falseBarebox shows that the dwc2 driver binds to usb1:
barebox@Enclustra Mercury+ SA2:/ drvinfo dwc2
Driver Device(s)
--------------------
dwc2
ffb40000.usb@ffb40000.ofLinux boot log:
# dmesg | grep -Ei 'usb|dwc2'
[ 0.042372] usbcore: registered new interface driver usbfs
[ 0.042408] usbcore: registered new interface driver hub
[ 0.042448] usbcore: registered new device driver usb
[ 0.896138] usbcore: registered new interface driver usb-storage
[ 0.920377] usbcore: registered new interface driver usbhid
[ 0.932106] usbhid: USB HID core driver
[ 1.086689] usb_phy_generic soc:usbphy: dummy supplies not allowed for exclusive requests
[ 1.095129] dwc2 ffb40000.usb: supply vusb_d not found, using dummy regulator
[ 1.111913] dwc2 ffb40000.usb: supply vusb_a not found, using dummy regulator
[ 1.137639] dwc2 ffb40000.usb: DWC OTG Controller
[ 1.142362] dwc2 ffb40000.usb: new USB bus registered, assigned bus number 1
[ 1.149465] dwc2 ffb40000.usb: irq 48, io mem 0xffb40000
[ 1.155604] hub 1-0:1.0: USB hub foundI was told that the "dummy regulator" messages are nothing to worry about.
More Linux commands:
# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.22 dwc2_hsotg DWC OTG Controller
# gpioinfo gpiochip0
gpiochip0 - 29 lines:
line 0: unnamed "reset" output active-low [used]
line 1: unnamed unused input active-high
line 2: unnamed unused input active-highPastebin
- my configuration: https://paste.debian.net/hidden/77078877
- Buildroot defconfig: https://paste.debian.net/hidden/e8b1d0fc
- Linux defconfig: https://paste.debian.net/hidden/d578d0f9
Hi Alan,
Thanks for giving it a thought. I finally got it working: a misconfigured switch. No comments, please...
David