Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20704 Discussions

Failed to enumerate any USB device through OTG in ALtera Cyclone5 SoC board

Altera_Forum
Honored Contributor II
1,694 Views

Hi, 

 

I am working on Altera Cyclone5 SoC board with Linux Kernel "Linux cyclone5 4.1.17-ltsi-altera". I want to enumerate USB device through OTG Interface. 

 

I have checked and updated respective Altera Cyclone5 DTS file to add support of USB as OTG. 

 

 

--- Quote Start ---  

usb1: usb@ffb40000 { 

/*compatible = "snps,dwc2";*/ 

compatible = "snps,dwc-otg-15.1", "snps,dwc-otg", "snps,dwc2"; 

/* reg = <0xffb40000 0xffff>; */ 

reg = <0xffb40000 0x00040000>; 

interrupts = <0 128 4>; 

clocks = <&usb_mp_clk>; 

clock-names = "otg"; 

dev-nperio-tx-fifo-size = <4096>; /* embeddedsw.dts.params.dev-nperio-tx-fifo-size type NUMBER */ 

dev-perio-tx-fifo-size = "<512 512 512 512 512 512 512 512 512 512 512 512 512 512 512>"; /* embeddedsw.dts.params.dev-perio-tx-fifo-size type STRING */ 

dev-rx-fifo-size = <512>; /* embeddedsw.dts.params.dev-rx-fifo-size type NUMBER */ 

dev-tx-fifo-size = "<512 512 512 512 512 512 512 512 512 512 512 512 512 512 512>"; /* embeddedsw.dts.params.dev-tx-fifo-size type STRING */ 

dma-mask = <268435455>; /* embeddedsw.dts.params.dma-mask type NUMBER */ 

enable-dynamic-fifo = <1>; /* embeddedsw.dts.params.enable-dynamic-fifo type NUMBER */ 

host-nperio-tx-fifo-size = <2560>; /* embeddedsw.dts.params.host-nperio-tx-fifo-size type NUMBER */ 

host-perio-tx-fifo-size = <2560>; /* embeddedsw.dts.params.host-perio-tx-fifo-size type NUMBER */ 

/* host-rx-fifo-size = <2560>; embeddedsw.dts.params.host-rx-fifo-size type NUMBER */ 

host-rx-fifo-size = <512>; /* embeddedsw.dts.params.host-rx-fifo-size type NUMBER */ 

phys = <&usbphy0>; 

phy-names = "usb2-phy"; 

ulpi-ddr = <0>; /* embeddedsw.dts.params.ulpi-ddr type NUMBER */ 

voltage-switch = <0>; /* embeddedsw.dts.params.voltage-switch type NUMBER */ 

status = "disabled"; 

}; 

--- Quote End ---  

 

 

 

Followig are some kernel logs regarding USB device and OTG Controller Support 

 

 

--- Quote Start ---  

root@cyclone5:~# dmesg | grep usb 

[ 0.203225] usbcore: registered new interface driver usbfs 

[ 0.203285] usbcore: registered new interface driver hub 

[ 0.203344] usbcore: registered new device driver usb 

[ 0.203477] soc:usbphy@0 supply vcc not found, using dummy regulator 

[ 1.014284] ffb40000.usb supply vusb_d not found, using dummy regulator 

[ 1.020924] ffb40000.usb supply vusb_a not found, using dummy regulator 

[ 1.061106] dwc2 ffb40000.usb: EPs: 16, dedicated fifos, 8064 entries in SPRAM 

[ 1.921191] dwc2 ffb40000.usb: DWC OTG Controller 

[ 1.925900] dwc2 ffb40000.usb: new USB bus registered, assigned bus number 1 

[ 1.932957] dwc2 ffb40000.usb: irq 47, io mem 0x00000000 

[ 1.938396] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 

[ 1.945168] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 

[ 1.952367] usb usb1: Product: DWC OTG Controller 

[ 1.957050] usb usb1: Manufacturer: Linux 4.1.17-ltsi-altera dwc2_hsotg 

[ 1.963643] usb usb1: SerialNumber: ffb40000.usb 

[ 1.987992] usbcore: registered new interface driver usb-storage 

[ 2.103199] usbcore: registered new interface driver usbhid 

[ 2.108747] usbhid: USB HID core driver 

 

 

 

root@cyclone5:~# dmesg | grep otg 

[ 1.957050] usb usb1: Manufacturer: Linux 4.1.17-ltsi-altera dwc2_hsotg 

--- Quote End ---  

 

 

I am not able to enumerate any USB device through OTG cable. I am not getting interrupt after connecting or disconnecting any USB device. 

 

So, is there any kernel configuration or device tree configuration missing to work OTG support on this board? 

 

Please let me know if anyone has any idea ro clue to solve this issue. 

 

Regards, 

Ritesh Prajapati
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
669 Views

I have also some more informations regarding this OTG detection issue as I have tested same with pre-build package (dtb and zImage) in which Linux version 3.9.0 is used and OTG is working in that image. So, I am sure that there is no any issue from system point of view as I used system image (rbf) is mine and pre-build package images (dtb and zImage) in which OTG is working fine and i am able to enumerate USB device without any issue. 

 

But, When I tested it with my images (dtb and zImage) at that time I am not able to detect any USB device in OTG cable. 

 

So, Please let me know if anyone has any idea to debug or solve this issue and also let me know if any more informations regarding dts or kernel image configuratios required. 

 

Regards, 

Ritesh Prajapati
0 Kudos
Reply