This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB Kernel configuration questions

Expert 2280 points

Hi

Which is the aim of "gadget builtin" option (CONFIG_USB_G_DBGP) in AM335x kernel configuration? UsbgeneralpageLinux-v3p1 says "this is suitable for a board where one port is hardwired to be host only. The builtin gadget would make sure that the host only port works soon after bootup. Second gadget driver module can be inserted after bootup". But why a gadget should be build for a port that will work in host mode?

My custom board has one host port (usb0) and one device port (usb1). Do I need to include "gadget builtin" option in my kernel configuration? Can I or do I need to tell to MUSB controller that one port will work in host mode only, and the second in peripheral mode only?

I'm trying to debug some issues on device port: I think there are some minor typos UsbSoftwareInterface page; debugfs commands would probably look likes "... > /sys/kernel/debug/musb/testmode" instead of  "... > /sys/kernel/debug/testmode". Moreover it seems this command affect just first instance of musb controller, the usb0 related. Would be useful to enhance it to work also on usb1.

Thanks in advance for your clarifications.

Regards, Max

  • Max,

    CONFIG_USB_G_DBGP was needed in PSP-04.06.00.03 and same is no more needed in PSP-04.06.00.04 as musb port mode can be defined in arch/arm/mach-omap2/board-xxx.c file as either HOST only or OTG.

    Thanks for pointing out typo error and testmode for usb0 alone.

    Regards,

    Ajay

  • Ajay,

    I'm using PSP 04.06.00.03: how should I proceed? Please not that in the board design, the USBx_ID pins have been left floating so I'm trying to configure the ports role configuring the USBxMODE register.

    Regards,

    Max

  • Max,

    ID pin configuration using USBxMODE will be fine. You need to do the changes in drivers/usb/musb/ti81xx.c  ti81xx_set_mode() function. The latest tree is available at

    http://arago-project.org/git/projects/?p=linux-am33x.git;a=summary

    Ajay

  • Ajay,

    ti81xx uses the same platform data structure for the two instances of musb controller, so changing .mode value in platform data in board-am335x is not the case.

    Something depending on mode is also in musb_core. So I've changed the code to run musb_init_controller the first time in pheriperal mode, and the second in host mode ("hardcoding" musb->board_mode instead of copying from plat->mode). Musb initialization seems fine, one as pheripheral, the second as host, but host port is not working: no detection when I plug a device.

    Do I need to leave musb instances in OTG mode, and modify only the ti81xx glue code?

    Thanks in advance. Regards

    Max

  • Max,

    in PSP-04.06.00.04 onward mode can be changed for both ports. Refer below at http://arago-project.org/git/projects/?p=linux-am33x.git;a=blob;f=arch/arm/mach-omap2/board-am335xevm.c;h=3919dabff8e10d611dac0305e64fad6814fd2911;hb=13d6d6f8d5f5aaebd584dd2ed07c47cab97666c9

    2102 static struct omap_musb_board_data musb_board_data = {
    2103         .interface_type = MUSB_INTERFACE_ULPI,
    2104         /*
    2105          * mode[0:3] = USB0PORT's mode
    2106          * mode[4:7] = USB1PORT's mode
    2107          * AM335X beta EVM has USB0 in OTG mode and USB1 in host mode.
    2108          */
    2109         .mode           = (MUSB_HOST << 4) | MUSB_OTG,
    2110         .power          = 500,
    2111         .instances      = 1,
    2112 };

    But as you are on PSP-04.06.00.03 so this will not be available. You may want to pick usb related patches from http://arago-project.org/git/projects/?p=linux-am33x.git;a=shortlog;h=refs/heads/v3.2-staging

    ajay

  • Ajay,

    where can I download PSP 04.06.00.04? I did not found it at PSPs page and latest SDK 05.03.03.00 is based on PSP 04.06.00.03.

    If the only way is to download from GIT repository, could you please tell me the command to do it (I'm not very familiar with GIT).

    Thanks. Regards,

    Max

  • AM335x tree is at http://arago-project.org/git/projects/?p=linux-am33x.git;a=summary

    Latest work (on going) is at branch : v3.2-staging   . You can locate it at the bottom of above page.

    PSP 04.06.00.06 (upgraded version of 04.06.00.04 ) at : 
    AM335XPSP_04.06.00.06 branch.

    I would recommend to setup git tool and use it for development as it will be easier for you. After setting up the git you can clone this tree  with all branches.

    To clone the tree: "git clone http://arago-project.org/git/projects/linux-am33x.git"

    Ajay