Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

Socrates board : USB issue

Altera_Forum
Honored Contributor II
1,157 Views

Hi all,My issue : I can't make USB OTG port of the EBV Socrates board working properly in host mode.If this is better to post on rocketboard.org regarding SoC issues please tell me where to post.So here is my tests :1) The kernel that comes with EBV Socrates board (3.9) on the µSDCard is not stable regarding USB OTG support : It can read USB sticks but not write on it, and if I unplug then replug the USB stick it does not work anymore. This kernel uses the old dwc_otg driver.2) The kernel that I found on http://www.rocketboards.org/foswiki/view/projects/socrateshwreferencedesign is a newer version (3.12) that uses the new dwc2 driver. Since the device-tree included in the SDCard image does not match with dwc2 driver it is not detected. When changing the device-tree "compatible" field of the USB controller it is recognize, but this time the USB controller is locked in device-mode and does not want to switch to host mode when I plug a USB stick3) So I compile all by myself (SoC configuration, bsp-editor, preloader, uboot, kernel) in order to master all the chain. I use the latest version of git://git.rocketboards.org/linux-socfpga.git. And I have the same issue than in 2) : the controller is stucked in deice mode. The rest of this post is my current status with this issue.Hardware : So I check the SOPC configuration of the SoC : the USB1 controller is well activated. I don't thing that the issue comes from here since my test 1) is able to use USB. And test 2) and 3) works in device mode.SPL/uboot : I look inside SPL and uboot configuration. In both SPL and uboot, the USB support is not activated (in software/spl_bsp/uboot-socfpga/include/configs/socfpga_common.h). I tried to activate it but compilation fails at linking stage. However I don't thing this is the issue since in test 1) the controller works in host mode even if uboot does not include USB supportDevice-tree : Here is my USB related part of my device-tree : hps_0_usb0: usb@0xffb00000 { compatible = "snps,dwc-otg-1.0", "snps,dwc-otg", "snps,dwc2"; reg = < 0xFFB00000 0x00001000 >; interrupt-parent = < &hps_0_arm_gic_0 >; interrupts = < 0 125 4 >; dev-nperio-tx-fifo-size = < 4096 >; dev-perio-tx-fifo-size = ""; dev-tx-fifo-size = ""; dev_rx_fifo-size = < 512 >; dma-mask = < 268435455 >; host_rx_fifo-size = < 512 >; ulpi-ddr = < 0 >; voltage-switch = < 0 >; status = "disabled"; }; //end usb@0xffb00000 (hps_0_usb0) hps_0_usb1: usb@0xffb40000 { compatible = "snps,dwc2"; reg = < 0xFFB40000 0x00001000 >; interrupt-parent = < &hps_0_arm_gic_0 >; interrupts = < 0 128 4 >; dev-nperio-tx-fifo-size = < 4096 >; dev-perio-tx-fifo-size = ""; dev-tx-fifo-size = ""; dev_rx_fifo-size = < 512 >; dma-mask = < 268435455 >; host_rx_fifo-size = < 512 >; ulpi-ddr = < 0 >; voltage-switch = < 0 >; clocks = ; clock-names = "otg"; //phys = ; //phy-names = "usb2-phy"; }; //end usb@0xffb40000 (hps_0_usb1)USB0 is disabled since not used on the Socrates BoardI add snps,dwc2 in the compatible section in order dwc2 driver recognize the controller.Maybe some infos are missing for proper configuration, but I can't find what while looking linux-socfpga/Documentation/devicetree/bindings/usb/dwc2.txtI think this device-tree is correct.Kernel configuration : I add dwc2 support to the kernel, here is my USB related configuration :CONFIG_USB_HID=yCONFIG_USB_OHCI_LITTLE_ENDIAN=yCONFIG_USB_SUPPORT=yCONFIG_USB_COMMON=yCONFIG_USB_AR CH_HAS_HCD=yCONFIG_USB=yCONFIG_USB_ANNOUNCE_NEW_DE VICES=yCONFIG_USB_DEFAULT_PERSIST=yCONFIG_USB_OTG= yCONFIG_USB_EHCI_HCD=yCONFIG_USB_EHCI_ROOT_HUB_TT= yCONFIG_USB_EHCI_TT_NEWSCHED=yCONFIG_USB_EHCI_HCD_PLATFORM=yCONFIG_USB_OHCI_HCD=yCONFIG_USB_OHCI_HCD_PLATFORM=yCONFIG_USB_PRINTER=yCONFIG_USB_STORAGE=yCONFIG_USB_DWC2=y =>dwc2 driverCONFIG_USB_DWC2_DEBUG=y => with debug traceCONFIG_USB_DWC2_TRACK_MISSED_SOFS=yCONFIG_USB_PHY=yCONFIG_NOP_USB_XCEIV=yCONFIG_USB_GPIO_VBUS=yCONFIG_USB_ULPI=y => USB PHY on socrates board is ULPII think that is correctSo the controller is well detected but when I plug a USB stick the core does not want to switch in host mode.Even the power of the USB Stick is not present (no LED lighting).Maybe the last log is the issue : Mode Mismatch Interrupt: currently in Device modeSo I don't really know where to look forward. The issue can come from the USB OTG PHY of the board that is not well recognize by the kernel, so the kernel does not receive interrupts when the controller switch to host mode.Does someone had the same issue with Socrates or any other SoC development kits ?Best regards

0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
437 Views

Yes, I meet the same problem in raspberrypi. I suspect whether is it some HW failed.

0 Kudos
Altera_Forum
Honored Contributor II
437 Views

I double check our IO board about USB_OTG_ID, which is float, while it is pulled low in RPI-CMIO-V1_2-SCHEMATIC.pdf. 

 

Then I short it by GND. 

The error is fixed!! Now, I could log in.
0 Kudos
Reply