NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
MUSB Linux Driver Configuration
The Linux USB drivers have multiple layers, which are controlled by multiple kernel configurations. This page describe these configurations which are required to enable MUSB in AMSDK 8.0 (Kernel 3.14+), and all Processor Linux SDKs (up to kernel v4.9.x).
Contents
Introduction[edit]
The following drivers are required for MUSB, regardless for host-only, device-only, or dual-role mode.
- USB Core Driver
- MUSB Controller Driver
- MUSB Platform Glue Driver
- USB PHY Driver
- CPPI41 DMA Driver (optional)
For MUSB to work in host mode, the USB Class Driver(s) and the corresponding upper layer functional driver(s) are required too. For example, to support USB thumb drive or harddisk, the USB MSC driver and SCSI drivers should be enabled.
And for MUSB to work in device mode, the USB gadget driver(s) is required as well.
Additionally, a (any) gadget driver is required too when the MUSB controller is configured in dual-role mode. (TODO: how to configure the mode in dts)
Configurations[edit]
The following table lists the MUSB related drivers, their CONFIG options, and locations under "Device Drivers" in menuconfig.
Drivers | Options | Locations |
---|---|---|
USB Core | CONFIG_USB_SUPPORT |
|
CONFIG_USB |
| |
MUSB Controller | CONFIG_USB_MUSB_HDRC CONFIG_USB_MUSB_DUAL_ROLE |
|
MUSB Glue | CONFIG_USB_MUSB_DSPS (for AM335x only) |
|
CONFIG_USB_MUSB_DA8XX (for OMAPL138 only) |
| |
USB PHY | CONFIG_NOP_USB_XCEIV CONFIG_AM335X_PHY_USB (for AM335x only) |
. |
CONFIG_NOP_USB_XCEIV (for OMAPL138 only) |
. | |
CPPI41 DMA | CONFIG_DMADEVICES CONFIG_TI_CPPI41 |
|
CONFIG_USB_TI_CPPI41_DMA |
| |
PIO mode | CONFIG_MUSB_PIO_ONLY |
|
USB Class | CONFIG_* |
|
USB Gadget | CONFIG_USB_GADGET CONFIG_* |
|
Kernel Config Merge Script[edit]
The kernel config merge script (scripts/kconfig/merge_config.sh) is a convenient tool to modify kernel config file. Doing the following steps enables MUSB drivers in kernel for AM335x.
- Put the following content into a file, for example, called omap2plus-extra.cfg
# MUSB CONFIG_USB_MUSB_HDRC=m CONFIG_USB_MUSB_HOST=n CONFIG_USB_MUSB_GADGET=n CONFIG_USB_MUSB_DUAL_ROLE=y CONFIG_USB_MUSB_TUSB6010=n CONFIG_USB_MUSB_OMAP2PLUS=n CONFIG_USB_MUSB_AM35X=n CONFIG_USB_MUSB_DSPS=m CONFIG_USB_MUSB_UX500=n CONFIG_USB_TI_CPPI41_DMA=y CONFIG_MUSB_PIO_ONLY=n # MISC to avoid prompt CONFIG_USB_SISUSBVGA=n
- generate .config
$ make omap2plus_defconfig
- merge MUSB options
$ scripts/kconfig/merge_config.sh -m .config omap2plus-extra.cfg
Build Drivers into Kernel Image[edit]
To build all MUSB related drivers into kernel, use one of the following three options.
1. Set the following config options to 'y' instead of 'm' in .config.
CONFIG_USB_MUSB_HDRC=y CONFIG_USB_MUSB_DSPS=y CONFIG_AM335X_PHY_USB=y (for AM335x only)
2. Set the related config options in the table above to <*> instead of '<M>' in menuconfig.
3. Set the corresponding options to 'y', then use merge_config.sh script mentioned in the previous section.
Known Issue: the built-in gadget driver is not functional. But a workaround is to disable CPPI41 DMA and use PIO mode, or build gadget drivers as kernel module.
Notes[edit]
- Config option USB_OTG is not required for MUSB dual-role mode.
- Don't enable Config option USB_OTG_WHITELIST, Unless you know what this option means.