Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

USB OTG port Cyclone 5 Altera Linux - mouse doesn't power on

Hi,

I am working the Cyclone 5 development board. I am trying to use the prebuilt binaries for the altera linux 3.7 to work with the USB otg port. I have followed the tutorial below and I am able to boot the linux just fine and connect via the serial port.

http://rocketboards.org/foswiki/documentation/alterasocdevelopmentboardsoftwaregettingstarted


uname -a
Linux socfpga_cyclone5 3.7.0# 1 SMP Fri Apr 5 14:42:17 CDT 2013 armv7l GNU/Linux

So, altera linux is up and running just fine, but nothing happens when I plug a mouse into the USB OTG port. By looking at the /var/log/messages, it would appear to me that the USB drivers are at least loading:

Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: usbcore: registered new interface driver usbfs
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: usbcore: registered new interface driver hub
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: usbcore: registered new device driver usb
...
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: Initializing USB Mass Storage driver...
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: usbcore: registered new interface driver usb-storage
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: USB Mass Storage support registered.
Apr  5 20:02:00 socfpga_cyclone5 user.warn kernel: dwc_otg_core_reset() HANG! AHB Idle GRSTCTL=0
Apr  5 20:02:00 socfpga_cyclone5 user.warn kernel: dwc_otg_core_reset() HANG! AHB Idle GRSTCTL=0
...
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: dwc_otg ffb00000.usb: DWC OTG Controller
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: dwc_otg ffb00000.usb: new USB bus registered, assigned bus number 1
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: dwc_otg ffb00000.usb: irq 653, io mem 0xffb00000
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: Init: Port Power? op_state=b_peripheral
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: hub 1-0:1.0: USB hub found
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: hub 1-0:1.0: 1 port detected
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: Dedicated Tx FIFOs mode
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: Using DMA mode
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: dwc_otg ffb40000.usb: DWC OTG Controller
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: dwc_otg ffb40000.usb: new USB bus registered, assigned bus number 2
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: dwc_otg ffb40000.usb: irq 656, io mem 0xffb40000
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: Init: Port Power? op_state=b_peripheral
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: hub 2-0:1.0: USB hub found
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: hub 2-0:1.0: 1 port detected
...
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: usbcore: registered new interface driver usbhid
Apr  5 20:02:00 socfpga_cyclone5 user.info kernel: usbhid: USB HID core driver

But when I plug a mouse into the USB OTG port(J1), The mouse led does not power on. When I run lsusb. It only shows the 2 hubs. And if I look at the /var/log/messages. Nothing appears when I plug the mouse in.


lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So, if anyone can help, here are my questions:

1. Should the USB OTG port be ready to go with the out of box altera linux 3.7 or is there something I need to do here to enable it?

2. Is there any physical jumper or dip switch setting that I need to change to make the proper USB connections? I am using the default from the tutorial link I posted above. Does it matter what is the FPGA image?

3. Anything obvious I am missing here?

Thanks for any help.

John

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok, So I figured out the problem. The Linux socfpga_cyclone5 3.7.0 kernel does not have USB support. I upgraded to the 3.11 kernel and it solved me problem. :)

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Ok, So I figured out the problem. The Linux socfpga_cyclone5 3.7.0 kernel does not have USB support. I upgraded to the 3.11 kernel and it solved me problem. :)

    --- Quote End ---

    Hi John,

    I have the same problem with kernel 3.7, but upgrading to 3.11 didn't solve it for me. In 3.11, even the boot messages containing "dwc_otg ffb40000.usb:" are missing.

    Did you change anything else (kernel config or device tree)?

    Thanks & best regards,

    Richard
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Richard,

    One thing you should look at is what the .config file ends up being after you change to kernel 3.11 or whatever. I am still having trouble getting some of the new versions to compile and load correctly and this seems to be a stumbling block for me.

    Anyhow, I attached the zImage I am using with kernel 3.11, as well as the device table that was generated and the .config the I used to compile the kernel. Hopefully you find this helpful. Take a look at the .config file, maybe make a comparison and see if there is anything I added.

    Does anybody know what commands you should be using to get the right .config file generated? Would the following work correctly or is there something else?

    
    //How to compile kernel
    cd ~
    mkdir linux-socfpga-3.11
    git clone http://git.rocketboards.org/linux-socfpga.git
    cd linux-socfpga
    rm .config
    git checkout -b socfpga-3.11 origin/socfpga-3.11
    export CROSS_COMPILE=/opt/altera-linux/linaro/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/bin/arm-linux-gnueabihf-
    // generate the .config file... not sure about this
    make ARCH=arm menuconfig
    make ARCH=arm
    

    or should I be using?

    
    make ARCH=arm socfpga_defconfig
    

    John
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok, so I was trying this a little more. I am still thinking the problem is that the .config is not being generated with everything. I was trying to get 3.12 working and running into similar issues. Still not sure what is the "right" way to get the right .config for each release. But, here is pretty much what I did today and I was able to the usb working.

    
    //How to compile kernel
    cd ~
    mkdir linux-socfpga-3.12
    git clone http://git.rocketboards.org/linux-socfpga.git
    cd linux-socfpga
    rm .config
    git checkout -b socfpga-3.12 origin/socfpga-3.12
    export CROSS_COMPILE=/opt/altera-linux/linaro/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/bin/arm-linux-gnueabihf-
    // generate the .config file...
    make ARCH=arm menuconfig
    make ARCH=arm
    

    Then you can grab the device file and the zImage

    arch/arm/boot/dts/socfpga_cyclone5.dtb

    arch/arm/boot/zImage .