Forum Discussion

teiram's avatar
teiram
Icon for New Contributor rankNew Contributor
1 month ago

Cyclone5 SoC: U-Boot not detecting USB-HUB

Hello there,

I'm working on a design on top of a Chameleon96 Board (CycloneV based), featuring a USB OTG Chip USB3300, and connected to it an USB 2513B Hub. My issue is that neither U-Boot or Linux are able to detect the USB Hub connected to the USB3300. This used to work with  older U-Boot versions and are still working on my board, but I was not able to reproduce such behavior with up-to-date versions (cloned from https://github.com/altera-fpga/u-boot-socfpga and https://github.com/altera-fpga/linux-socfpga).

The Chameleon96 has two GPIO pins to control the reset of the mentioned USB chips, with a fixed configuration on the USB 2513B (the I2C interface is not exposed).

With my version (U-Boot 2025.07-gd4f268660a70-dirty and Linux 6.12.33-g3234b1ed8956), the USB OTG is detected and the hub registered with logs like the following:

[ 0.883275] dwc2 ffb40000.usb: supply vusb_d not found, using dummy regulator
[ 0.890619] dwc2 ffb40000.usb: supply vusb_a not found, using dummy regulator
[ 0.898034] dwc2 ffb40000.usb: Configuration mismatch. dr_mode forced to host
[ 0.905721] dwc2 ffb40000.usb: DWC OTG Controller
[ 0.910454] dwc2 ffb40000.usb: new USB bus registered, assigned bus number 1
[ 0.917571] dwc2 ffb40000.usb: irq 32, io mem 0xffb40000
[ 0.923324] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, b2
[ 0.931588] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber1
[ 0.938800] usb usb1: Product: DWC OTG Controller
[ 0.943509] usb usb1: Manufacturer: Linux 6.12.33-g3234b1ed8956 dwc2_hsotg
[ 0.950362] usb usb1: SerialNumber: ffb40000.usb
[ 0.955682] hub 1-0:1.0: USB hub found
[ 0.959499] hub 1-0:1.0: 1 port detected

 but the connected USB hub never shows up. Similarly  'usb start' from the U-Boot prompt just shows something called U-Boot Root Hub:

=> usb start starting USB...
USB DWC2
Bus usb@ffb40000: 1 USB Device(s) found
                       scanning usb for storage devices... 0 Storage Device(s) found
=> usb tree
USB device tree:
        1 Hub (480 Mb/s, 0mA) U-Boot Root Hub

Older u-boot versions (and linux) are able to detect the USB hub after 'usb start'. In this case, the root hub is named DWT OTC RootHub, and I don't know if this is just a change of naming somewhere or something wrong is also happening while detecting the USB3300 Hub: 

SOCFPGA_CHAMELEON96 # usb start
(Re)start USB...
USB0: Core Release: 2.93a scanning bus 0 for devices... 2 USB Device(s) found
                scanning usb for storage devices... 0 Storage Device(s) found
SOCFPGA_CHAMELEON96 # usb tree
USB device tree:
      1 Hub (480 Mb/s, 0mA)
      |      DWC OTG RootHub
      | +-2 Hub (480 Mb/s, 2mA)

the linux kernel (4.1.33-ltsi-altera)  is also able to detect the USB Hub as can be seen in these logs:

[ 0.913203] ffb40000.usb supply vusb_d not found, using dummy regulator
[ 0.919864] ffb40000.usb supply vusb_a not found, using dummy regulator
[ 0.957196] dwc2 ffb40000.usb: EPs: 16, dedicated fifos, 8064 entries in SPRM
[ 1.817295] dwc2 ffb40000.usb: DWC OTG Controller
[ 1.822011] dwc2 ffb40000.usb: new USB bus registered, assigned bus number 1
[ 1.829076] dwc2 ffb40000.usb: irq 44, io mem 0x00000000
[ 1.834617] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.841394] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber1
[ 1.848596] usb usb1: Product: DWC OTG Controller
[ 1.853282] usb usb1: Manufacturer: Linux 4.1.33-ltsi-altera-svn260 dwc2_hsog
[ 1.860481] usb usb1: SerialNumber: ffb40000.usb
[ 1.865670] hub 1-0:1.0: USB hub found
[ 1.869457] hub 1-0:1.0: 1 port detected
...
[ 2.367190] usb 1-1: new high-speed USB device number 2 using dwc2
[ 2.577385] usb 1-1: New USB device found, idVendor=0424, idProduct=2513
[ 2.584069] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.591939] hub 1-1:1.0: USB hub found
[ 2.595782] hub 1-1:1.0: 3 ports detected

I think I've ported all the needed configuration to the u-boot sources (basically resetting the USB hub using the attached GPIOs, and I also tried the reset sequence manually from U-Boot with the gpio command) and I'm not able to figure out how to find where the issue might be. I've forked u-boot sources here: https://github.com/teiram/u-boot-socfpga/, using the socfpga_chameleon96_defconfig configuration.

Could you please support me in order to troubleshoot what the issue might be? I tried to backport my changes to some different branches on u-boot-socpfga but got the same results or even worse (no boot at all). 

I also have sources for a working U-Boot but they are quite old and the configuration changed sensibly since. I think all the needed options are set.

Cheers,
Manuel

13 Replies

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi teiram 

     

    Good day! 

    Is it possible if you could share me the repo for the 4.1.33-ltsi-altera and u-boot that you used previously?

    It seems like the oldest kernel version that is available in the Altera github goes up to 4.9.76-ltsi :)

     

    First thing we could try is comparing the changes between the latest and the old version that you are using.

    Another thing could we take a look at the device tree node for the usb? If you could also share with me the deice tree that you are using for the board.

    There device tree node could have change when the drivers are being updated.

     

    Regards

    tehjingy

     

     

     

     

    • teiram's avatar
      teiram
      Icon for New Contributor rankNew Contributor

      Hello Tehjingy,

      thanks a lot for reaching out.

      the working versions come from an ancient svn repository provided by the board designer (Novtech), which is accessible under registration (https://www.novtech.com/products/chameleon96.html)

      So far I was trying to focus on u-boot because the issue seems to originate that early. With the original u-boot, usb start and usb tree shows the connected HUB and even detects storage devices connected to the HUB, but with the latest u-boot version that is not the case.

      For a working u-boot I can share a public github repository that also works: Raetro

      I built that from sources, deployed to the SD Card and the USB hub is detected on 'usb start'. As far as I see the USB in the DTS is exactly like the one I have. There is a specific configuration for the board in configs/socfpga_chameleon96_defconfig and a DTS at arch/arm/dts/socfpga_cyclone5_chameleon96.dts, and I don't think there are relevant differences compared to the DTS in my repository.

      It's worth mentioning that there are some actions to properly setup GPIOS 0 and 9, which are relevant for the USB devices configuration, that was included as part of the u-boot commands in the Raetro u-boot version, but something equivalent was made in the original u-boot version in the board initialization code (and in my version in board_late_init, see board/novtech/chameleon96/board.c in my u-boot repo). I tried also to follow Raetros approach by issuing GPIO commands from the u-boot prompt (see include/configs/socfpga_chameleon96.h in Raetros) but I was never able to get the USB hub recognized, so I'm not sure if the issue could be related to the GPIO initialization. At least they seem to be in the proper state and changing their level from u-boot prompt seem to not make any difference: The USB HUB seems to be not detected.

       

      Cheers,
      Manuel

       

  • Hello

    Yes, you can go  back to the u-boot stage to see why the USB Hub is not recognized.

    Since the original U-boot could recognize  the USB Hub, but not the recent version of u-boot, here are some items to check. 

    Have you checked that in your device tree file (.dts/.dtsi) that the USB  Hub is defined?    As an example, do you see the command associated with &usb1.    An example of the command can be seen in the u-boot-socfpga/arch/arm/dts/socfpga_cyclone5_socdk.dts at the bottom of the page.   Is your  USB Hub set to a host/peripheral?  You will probably want the USB Hub to a host.

    Have you checked in your configuration file (as seen in the configs/socfpga_cyclone5_defconfig)  that there are lines for USB such as Config_USB and then they have the item of y (yes) after them?  Do you see/not see a line of  Config_USB_Hub?    In your case, you would like it to be a Hub.

    Now for the PIOs for USB Hub, here are some items to check:   Can you first check  within Quartus -> Platform Designer the  assignments and connections  are correct (no warnings)? Within Quartus, can you please check the I/O pin placement (do they correspond to the schematic) and I/O standards? These items are fast to double-check but it will narrow down other issues.

     

    • teiram's avatar
      teiram
      Icon for New Contributor rankNew Contributor

      Hello Erika,

      thanks for your ideas and hints. Let me go over the topics you pointed out:

      1. DTS/DTSI files:

      yes, in fact that part of the dts is shared with the base cyclone5 dts. The only overrides/configuration the chameleon96 specific dts does regarding USB is:

      &usb1 {
          status = "okay";
      };

      The chameleon96 dts does include socfpga_cyclone5.dtsi which in fact includes  socfpga.dtsi, where the main usb stuff is declared. In the working repository I shared I didn't find any difference regarding this topic.

      2. U-Boot USB configuration:

      this is where I was doing more tests, thinking that maybe I was missing some USB configuration there. As I see it, the chameleon96 has two USB Hubs:

      • The USB OTG USB3300, which is directly connected to the SOCPFGA USB pins, this one can be in Host or device mode, which is controlled by GPIO9 or a switch on the board that can be used to force host mode. That switch is currently set for host mode. That is the setup in the following picture with the BJT transistor and the signals arriving at its base:

        I think this is properly detected, or at least so it looks like because U-Boot 'usb tree' command shows an USB Hub and also the linux kernel shows such device. But it might be it's detected but it's not enabled, idk.

      • The USB2513B as child HUB, connected upstream to the USB3300 and providing some ports downstream, and this is the one that I'm sure it's not detected:

        this one has its reset pin controlled by GPIO0. 

      Somehow this combination is not working, either because one of these devices is hold on reset or for some other reason. I understand u-boot is configured with USB support and USB2513B i2c interface is not reachable, so it's expected to have a fixed configuration defined by its polarization.

      I was doing lots of tests with the USB configuration, and I'm not sure if it's fine. But the USB configuration for u-boot changed significantly from the working version to the current version, letting aside that I'm no expert on this. So it might well be an issue with that.

      Also what really beats me on this setup is that the USB3300 reset is connected to the USB2513B reset and they have reverse logic. I guess maybe because at least one of them senses the edge and not the level, but I'm not sure. Anyways, since there are working implementations of u-boot and linux kernel, that shouldn't be an issue. :)

      3. The design including the platform designer setup looks good to me and I found no warnings related to the GPIO configuration whatsoever. I made the design available here

      regards,
      Manuel

       

      • ErikaP_Arrow's avatar
        ErikaP_Arrow
        Icon for New Contributor rankNew Contributor

        Hello Manuel,

        For your comment of “I think this is properly detected, or at least so it looks like because U-Boot 'usb tree' command shows an USB Hub and also the linux kernel shows such device. But it might be it's detected but it's not enabled, idk.”

        Since you can run the usb tree command and the Linux kernel shows this device, yes, it looks like this device is detected and enabled.   The usb tree command is a check that the USB is detected.

        For your issue with the U-boot USB Configuration, where the issue seems to be more with the Child USB USB2513B because this Hub is not getting detected, here are some comments.

        First, it was checked if there is a way to bypass the USB3300  and test the USB2513 directly  but no, this is not possible. Now, since the USB2513 is not being detected, did you try toggling GPI0?  For example, did you try to toggle the GPIO in the u-boot prompt, where the command is gpio <command>  before using the command usb start?    You could try commands such as gpio clear  <GPIO> (for the USB2513B)  and then gpio set GPIO for the USB2513B and then do similar steps for USB3300 to initialize the parts. You should put in some delay time between each command due to initialization time. The reason for toggling the GPIOs is that there are changes in u-boot, as you have seen.   The older versions handled more of the initialization, while in the new version you will need to do more initialization i.e. toggle the I/O.

        Out of curiosity, did Novtech provide you, for reference, an older u-boot version where you can see the Hub?

        Are you able to check in your board.c file that it initializes the board_late_init with the correct initialization of GPIO?

        As per your comment of Also what really beats me on this setup is that the USB3300 reset is connected to the USB2513B reset and they have reverse logic.

        Comment:  The USB3300 has a reset (active high) while the USB2513B has Reset_n (active low).    Now for your question of how can an active high reset be connected to a reset?   As such, can you please note there is an inverter (which is indicated with a very small round circle) to the right of the word “26” (Reset_n pin) on the USB2513B of the schematic?   This circle can be easily missed as it is so small.  No other pins on the USB2513B are shown this way with the inverter.  One thing to do to check the resets of the USB2513B and USB3300.  For example, in  the USB2513B, there is a reset  sequence that halts features (with the assertion of reset_n) vs features that are operational after the negation of reset_n.  The USB2513B Hub only works after a certain period of time after the negation of the reset_n.  When using the reset on USB3300, on the other hand, it is writing to a register.  This register will clear after the completion of the reset.  The reason for the 2 different resets-active high and active low for the two different USB devices is for synchronization during power up.   

        Do the above details help?

  • teiram's avatar
    teiram
    Icon for New Contributor rankNew Contributor

    Hi Erika,

    thanks for your comments. In fact I have a working u-boot as I mentioned earlier in the conversation, coming from Raetro github repository. In this case, the USB HUB seems to get activated as you mentioned, by toggling the relevant GPIOs. I tried to emulate the same behavior from the u-boot prompt but I'm not able to see anything detected at all afterwards by ussing an usb start command.

    I installed again Raetro u-boot on the SD card and I can see the following messages during boot:

    U-Boot SPL 2017.03-gd209b72 (Dec 14 2025 - 08:23:38)
    Trying to boot from MMC1

    U-Boot 2017.03-gd209b72 (Dec 14 2025 - 08:23:38 +0100)

    Watchdog enabled
    I2C: ready
    DRAM: 512 MiB
    socfpga_bridges_reset: FPGA not ready, aborting.
    MMC: dwmmc0@ff704000: 0
    *** Warning - bad CRC, using default environment

    In: serial
    Out: serial
    Err: serial
    Model: Arrow Chameleon96
    Net: No ethernet found.
    Autoboot in 2 seconds
    Resetting USB HUB...
    gpio: pin 09 (gpio 9) value is 0
    gpio: pin 0 (gpio 0) value is 0
    gpio: pin 22 (gpio 22) value is 1
    gpio: pin 09 (gpio 9) value is 1
    gpio: pin 0 (gpio 0) value is 1
    gpio: pin 25 (gpio 25) value is 1
    Programming FPGA...
    reading menu.rbf
    ** Unable to read file menu.rbf **
    Wrong parameters for FPGA request
    ...

    then some errors about not finding the expected rbf file follow, but the important thing is, in my opinion, the GPIO toggling on GPIO0 and GPIO9.

    Once on the u-boot prompt, a usb start shows the two USB hubs:

    => version
    U-Boot 2017.03-gd209b72 (Dec 14 2025 - 08:23:38 +0100)
    arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009
    GNU ld (2.42-1ubuntu1+23) 2.42
    => usb start
    starting USB...
    USB0: Core Release: 2.93a
    scanning bus 0 for devices... 2 USB Device(s) found
    scanning usb for storage devices... 0 Storage Device(s) found
    => usb tree
    USB device tree:
    1 Hub (480 Mb/s, 0mA)
    | U-Boot Root Hub
    |
    +-2 Hub (480 Mb/s, 2mA)

    Also from the prompt:

    • gpio status shows nothing, as if no gpio was claimed (whatever that means).
    • gpio status -a shows all ports in status unknown. porta and portb with ports from 0 to 28 and portc with ports from 0 to 26

    The gpio setting attempt can be seen in the u-boot variables:

    usb_reset=echo Resetting USB HUB...;gpio clear 09;gpio clear 0;sleep 1;gpio set 22;gpio set 09;gpio set 0;gpio set 25


    which is used in bootcmd, here is the content of bootcmd as well as most of the other involved variables:

    bootcmd=run usb_reset; mw 0xff709004 0x800; run mmcload; run mmcboot
    mmcload=mmc rescan;run fpgacheck;run scrtest;run kernel_init
    fpgacheck=if mt 0xFFD05054 0;then run fpgaload;else if mt 0x1FFFF000 0x87654321;then mw 0x1FFFF000 0;env import -t 0x1FFFF004;run fpgaload;fi;fi
    fpgaload=echo Programming FPGA...;load mmc 0:$mmc_boot $fpgadata $core;fpga load 0 $fpgadata $filesize;echo Enabling FPGA to HPS bridges...;bridge enable;mw 0x1FFFF000 0; mw 0xFFD05054 0
    scrtest=if test -e mmc 0:$mmc_boot /linux/u-boot.txt;then load mmc 0:$mmc_boot $loadaddr /linux/u-boot.txt;env import -t $loadaddr;fi
    kernel_init=echo Loading Kernel and Device Tree...;load mmc 0:$mmc_boot $loadaddr $bootimage;setexpr.l fdt_addr $loadaddr + 0x2C;setexpr.l fdt_addr *$fdt_addr + $loadaddr

    After the usb_reset, 0x800 is written to 0xff709004, what seems to be the data direction register of the gpio1 portb, setting to one bit 11, which I would think it should corresponds to GPIO40.  GPIO40 doesn't even show in the device PIN configuration of the HPS so there is something I'm not getting here. I don't know why that bit is set to 1 during initialization.

    I will try to setup again the non-working u-boot to see if I can spot any relevant differences. It beats me that gpio status show no claimed GPIO with this working u-boot, or why I'm not able to see any value at all. but that might be that I don't really understand how it works, or because they are configured as outputs and that is why I cannot see any value.

     

    • ErikaP_Arrow's avatar
      ErikaP_Arrow
      Icon for New Contributor rankNew Contributor

      Hello

      I will be working with others to come up with suggestions/ideas for you.

      Thank you,

      • ErikaP_Arrow's avatar
        ErikaP_Arrow
        Icon for New Contributor rankNew Contributor

        Hello

        First for a review of the schematic:

        The reset of 0 to 1 for GPIO0 looks correct for the USB2513.   The reason is that the USB-2513 needs to be run with Reset_n (1 to 0) but since there is an inverter on the pin 26 of this part, the reset follows the datasheet requirement.   

        The GPI09 is connected to the TC7USB40MU, which is the USB Select.   It changes from 0 to 1.  Since OE is ground (L) and the input S changes from L to H, it selects 2D connections (USB2513’s USBDP_UP and USBDM_UP which are the “upstream USB data signals (host, port or upstream hub).”

        Now for details on the messages that you see:

        For your line of socfpga_bridges_reset: FPGA not ready, aborting.

        This issue tells that the HPS have issues communicating with the FPGA.

        For the lines of  
        MMC: dwmmc0@ff704000: 0
        *** Warning - bad CRC, using default environment

        The warning is stating that default settings are used, because it cannot read the U-boot from the SD card correctly.   The default settings are probably not what you want.

        For the lines of

        ** Unable to read file menu.rbf **
        Wrong parameters for FPGA request

        This means that the FPGA is not configured correctly.   This issue can caused by an SD card issue.

        Question:  Could you please try re-flashing another, new SD card (within the FAT partition) with a new u-boot (including .rbf file)?  (I realized that you installed once more the Raetro u-boot but this is a suggestion)

        For the errors of “not finding the expected .rbf file”,  the .rbf file  defines the operation of the I/Os, thus if is not finding the correct .rbf file, the I/Os could be incorrect.

        Question:  When you open your .dtsi file, can you double-check that gpio I/Os are defined correctly?  Can you also check that the HPS  interfaces are defined correctly?

        Thank you

  • AlanCLTan's avatar
    AlanCLTan
    Icon for Occasional Contributor rankOccasional Contributor

    Hi teiram​ 

    I can't spot any problem with the GPIO0 definition. Just giving a shot here. Could you please try with 

    &usb1 {
        status = "okay";
        dr_mode = "host";
    };

     

    • teiram's avatar
      teiram
      Icon for New Contributor rankNew Contributor

      Hi Alan,

      thanks for your suggestion. I just tried it and got the same result. GPIOs seems to be set properly (at least that is what gpio status -a shows), but the USB HUB is not detected. Followed the same procedure, tried to reset and set GPIOs 0 and 9 and nothing changed :(

       

      • AlanCLTan's avatar
        AlanCLTan
        Icon for Occasional Contributor rankOccasional Contributor

        Hi teiram,

        Let's try these:

        1. Do you have a PHY node for USB3300 in the your previous working u-boot? Something like the example below. Add it into the dtsi:

        {
            /* Define the PHY node outside the soc bus */
            usb_phy0: usb-phy {
                compatible = "usb-nop-xceiv";
                #phy-cells = <0>;
                reset-gpios = <&portb 0 GPIO_ACTIVE_LOW>; 
                status = "okay";
            };
        };
        
        &usb1 {
            status = "okay";
            dr_mode = "host";             // Usually 'host' for Cyclone V boards
            usb-phy = <&usb_phy0>;        // Link to the PHY node
        };

        2. Make sure the Linux kconfig options (set in defconfig) are set:

        CONFIG_USB_DWC2=y
        CONFIG_USB_OHCI_HCD=y --- sometimes needed for full/low speed support
        CONFIG_PHY=y
        CONFIG_NOP_USB_XCEIV=y --- Essential if using the usb-nop-xceiv compatible string.
        CONFIG_USB_ULPI=y --- Required for the ULPI interface protocol.

        3. The USB3300 or an downstream hub requires specific GPIO states to be enabled before the USB stack starts. You can do this in U-Boot with:

        gpio set 9
        usb start