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.

DRA7xx USB Mass Storage can't find UDC

Other Parts Discussed in Thread: DRA742, DRA752

HI,

I following the GLSDK Software Developers guide #USB DRD(Dual Role Device) Support  and DRD support  to setting up TI DRA7xx OMAP5 EVM board with GLSDK 7.0.1

but i can't use the device board as a mass storage to PC.

i following the DRD support  # DRD Setup instruction but failed in step 3.(Load the usb gadget modules for usb1 port and usb2 port respectively.)

here is my TI Dra74xx log:

root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb# insmod gadget/legacy/g_mass_storage.ko file=/dev/ram0 stall=0

insmod: ERROR: could not insert module gadget/legacy/g_mass_storage.ko: No such device

and the kernel log message show from device:

root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb# dmesg 

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.14.43-dirty (anthony@anthony-VirtualBox) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #2 SMP PREEMPT Mon Aug 17 17:52:58 CST 2015
[ 0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] Machine model: TI DRA742
[ 0.000000] Reserved memory: created CMA memory pool at 0x95800000, size 56 MiB
[ 0.000000] Reserved memory: initialized node ipu2_cma@95800000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created CMA memory pool at 0x99000000, size 64 MiB
[ 0.000000] Reserved memory: initialized node dsp1_cma@99000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created CMA memory pool at 0x9d000000, size 32 MiB
[ 0.000000] Reserved memory: initialized node ipu1_cma@9d000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created CMA memory pool at 0x9f000000, size 8 MiB
[ 0.000000] Reserved memory: initialized node dsp2_cma@9f000000, compatible id shared-dma-pool
[ 0.000000] cma: CMA: reserved 64 MiB at ab800000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 391680
[ 0.000000] free_area_init_node: node 0, pgdat c0a26000, node_mem_map eab8a000
[ 0.000000] Normal zone: 1520 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 193536 pages, LIFO batch:31
[ 0.000000] HighMem zone: 1552 pages used for memmap
[ 0.000000] HighMem zone: 198144 pages, LIFO batch:31
[ 0.000000] DRA752 ES1.1

......

[ 16.389494] (stk) :ldisc_install = 0
[ 17.386593] (stk) : timed out waiting for ldisc to be un-installed
[ 17.393324] Bluetooth: st_register failed -22
[ 179.743085] gadgetfs: USB Gadget filesystem, version 24 Aug 2004
[ 227.753743] couldn't find an available UDC

Device lsmod message:

root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb# lsmod
Module Size Used by
usb_f_mass_storage 41953 0
gadgetfs 16834 0
usb_f_ncm 12219 1
usb_f_ss_lb 14075 2
g_ncm 2597 0
g_zero 4957 0
libcomposite 46434 5 g_ncm,usb_f_ncm,usb_f_ss_lb,g_zero,usb_f_mass_storage
xhci_plat_hcd 4170 0
u_ether 13533 2 g_ncm,usb_f_ncm
configfs 23765 5 usb_f_ncm,usb_f_ss_lb,libcomposite,usb_f_mass_storage
xhci_hcd 97053 1 xhci_plat_hcd
omapdrm_pvr 338798 0
c_can_platform 6680 0
dwc3 49388 0
c_can 9971 1 c_can_platform
can_dev 9761 1 c_can
m25p80 19753 0
dwc3_omap 4881 0
btwilink 3782 0
bluetooth 244489 2 btwilink
6lowpan_iphc 6297 1 bluetooth

and my PC Linux kernel configuration 

#
# I2C HID support
#
# CONFIG_I2C_HID is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_DEBUG=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_OTG=y
CONFIG_USB_OTG_WHITELIST=y
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=y
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PLATFORM=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_HCD_OMAP=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
# CONFIG_USB_FUSBH200_HCD is not set
# CONFIG_USB_FOTG210_HCD is not set
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
# CONFIG_USB_HCD_TEST_MODE is not set
# CONFIG_USB_RENESAS_USBHS is not set

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
CONFIG_USB_WDM=y
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
CONFIG_USB_STORAGE_DEBUG=y
# CONFIG_USB_STORAGE_REALTEK is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_USBAT is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
# CONFIG_USB_STORAGE_SDDR55 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_STORAGE_ALAUDA is not set
# CONFIG_USB_STORAGE_ONETOUCH is not set
# CONFIG_USB_STORAGE_KARMA is not set
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
# CONFIG_USB_STORAGE_ENE_UB6250 is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set
CONFIG_USB_MUSB_HDRC=y
# CONFIG_USB_MUSB_HOST is not set
# CONFIG_USB_MUSB_GADGET is not set
CONFIG_USB_MUSB_DUAL_ROLE=y
CONFIG_USB_MUSB_TUSB6010=y
# CONFIG_USB_MUSB_OMAP2PLUS is not set
# CONFIG_USB_MUSB_AM35X is not set
# CONFIG_USB_MUSB_DSPS is not set
# CONFIG_USB_MUSB_UX500 is not set
# CONFIG_USB_TI_CPPI41_DMA is not set
# CONFIG_USB_TUSB_OMAP_DMA is not set
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_DWC3=y
# CONFIG_USB_DWC3_HOST is not set
# CONFIG_USB_DWC3_GADGET is not set
CONFIG_USB_DWC3_DUAL_ROLE=y

#
# Platform Glue Driver Support
#
CONFIG_USB_DWC3_OMAP=y

#
# Debugging features
#
CONFIG_USB_DWC3_DEBUG=y
# CONFIG_USB_DWC3_VERBOSE is not set
CONFIG_DWC3_HOST_USB3_LPM_ENABLE=y
CONFIG_USB_DWC2=y
CONFIG_USB_DWC2_DEBUG=y
# CONFIG_USB_DWC2_VERBOSE is not set
CONFIG_USB_DWC2_TRACK_MISSED_SOFS=y
CONFIG_USB_DWC2_DEBUG_PERIODIC=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_CHIPIDEA_DEBUG=y

#
# USB port drivers
#
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
CONFIG_USB_TEST=y
# CONFIG_USB_EHSET_TEST_FIXTURE is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set
# CONFIG_USB_EZUSB_FX2 is not set
# CONFIG_USB_HSIC_USB3503 is not set

#
# USB Physical Layer drivers
#
CONFIG_USB_PHY=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_AM335X_CONTROL_USB=y
CONFIG_AM335X_PHY_USB=y
CONFIG_SAMSUNG_USBPHY=y
CONFIG_SAMSUNG_USB2PHY=y
CONFIG_SAMSUNG_USB3PHY=y
CONFIG_USB_GPIO_VBUS=y
# CONFIG_USB_ISP1301 is not set
# CONFIG_USB_RCAR_PHY is not set
CONFIG_USB_ULPI=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG=y
# CONFIG_USB_GADGET_VERBOSE is not set
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_DEBUG_FS=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2

#
# USB Peripheral Controller
#
# CONFIG_USB_FUSB300 is not set
# CONFIG_USB_FOTG210_UDC is not set
# CONFIG_USB_GR_UDC is not set
# CONFIG_USB_R8A66597 is not set
# CONFIG_USB_PXA27X is not set
# CONFIG_USB_MV_UDC is not set
# CONFIG_USB_MV_U3D is not set
# CONFIG_USB_M66592 is not set
# CONFIG_USB_NET2272 is not set
# CONFIG_USB_DUMMY_HCD is not set
CONFIG_USB_LIBCOMPOSITE=m
CONFIG_USB_F_ACM=m
CONFIG_USB_F_SS_LB=m
CONFIG_USB_U_SERIAL=m
CONFIG_USB_U_ETHER=m
CONFIG_USB_F_SERIAL=m
CONFIG_USB_F_OBEX=m
CONFIG_USB_F_NCM=m
CONFIG_USB_F_ECM=m
CONFIG_USB_F_EEM=m
CONFIG_USB_F_SUBSET=m
CONFIG_USB_F_RNDIS=m
CONFIG_USB_F_MASS_STORAGE=m
CONFIG_USB_F_FS=m
CONFIG_USB_CONFIGFS=m
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_ZERO=m
CONFIG_USB_ZERO_HNPTEST=y
# CONFIG_USB_AUDIO is not set
# CONFIG_USB_ETH is not set
# CONFIG_USB_G_NCM is not set
CONFIG_USB_GADGETFS=m
CONFIG_USB_FUNCTIONFS=m
CONFIG_USB_FUNCTIONFS_ETH=y
CONFIG_USB_FUNCTIONFS_RNDIS=y
CONFIG_USB_FUNCTIONFS_GENERIC=y
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
CONFIG_USB_MIDI_GADGET=m
# CONFIG_USB_G_PRINTER is not set
# CONFIG_USB_CDC_COMPOSITE is not set
# CONFIG_USB_G_ACM_MS is not set
CONFIG_USB_G_MULTI=m
CONFIG_USB_G_MULTI_RNDIS=y
# CONFIG_USB_G_MULTI_CDC is not set
# CONFIG_USB_G_HID is not set
CONFIG_USB_G_DBGP=m
# CONFIG_USB_G_DBGP_PRINTK is not set
CONFIG_USB_G_DBGP_SERIAL=y
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_UNSAFE_RESUME=y
# CONFIG_MMC_CLKGATE is not set

 

and where can find the OMAP UDC device driver to solve this issue? or have an other way to meet my requirement?

 

thanks

 

  • Hello Jim,

    Could you follow the listed steps again?

    Build kernel and usb gadget modules
    1. Build the kernel default omap2plus_defconfig

    2. make sure the dr_mode is set to "otg" for usb1/2 in platform specific .dtsi specific files.

    dr_mode = "otg";
    For dra7xx, set dr_mode to "otg" in arch/arm/boot/dts/dra7.dtsi and arch/arm/boot/dts/dra7-evm.dts files.
    For omap5, set dr_mode to "otg" in arch/arm/boot/dts/omap5.dtsi file.
    3. Build the kernel and usb gadgets as modules (for example g_zero.ko , g_mass_storage.ko etc).

    5. create the sd card with file system and boot partition, refer to GLSDK software developers guide for more info.

    6. copy arch/arm/boot/uImage and arch/arm/boot/dts/dra7-evm.dtb to /media/boot partition of sd card.

    7. install the modules to sdcard rootfs mount directory.

    #make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=/media/rootfs

    Take a look on the links - e2e.ti.com/.../399501
    processors.wiki.ti.com/.../Linux_Core_DWC3_User's_Guide
    processors.wiki.ti.com/.../AM335x-PSP_04.06.00.08_Features_and_Performance_Guide

    Best regards,
    Yanko
  • Hi Yanko,

    Thanks for your response,

    i have tried with the document 

    and your suggest  but also could not load the g_mass_storage driver

    device log:

    dra7xx-evm login: root
    root@dra7xx-evm:~# dmesg | head | tail
    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 3.14.43-dirty (anthony@anthony-VirtualBox) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 SMP PREEMPT Wed Aug 19 11:33:06 CST 2015
    [ 0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=10c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
    [ 0.000000] Machine model: TI DRA742
    [ 0.000000] Reserved memory: created CMA memory pool at 0x95800000, size 56 MiB
    [ 0.000000] Reserved memory: initialized node ipu2_cma@95800000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created CMA memory pool at 0x99000000, size 64 MiB
    [ 0.000000] Reserved memory: initialized node dsp1_cma@99000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created CMA memory pool at 0x9d000000, size 32 MiB
    root@dra7xx-evm:~# dmesg | tail
    [ 13.256535] (stk) : timed out waiting for ldisc to be un-installed
    [ 13.363552] (stk) :ldisc_install = 1
    [ 14.366533] (stk) :ldisc installation timeout
    [ 14.369422] (stk) :ldisc_install = 0
    [ 15.366534] (stk) : timed out waiting for ldisc to be un-installed
    [ 15.478259] (stk) :ldisc_install = 1
    [ 16.476532] (stk) :ldisc installation timeout
    [ 16.479420] (stk) :ldisc_install = 0
    [ 17.476531] (stk) : timed out waiting for ldisc to be un-installed
    [ 17.483258] Bluetooth: st_register failed -22
    root@dra7xx-evm:~# cd /lib/modules/3.14.43
    3.14.43/ 3.14.43-dirty/
    root@dra7xx-evm:~# cd /lib/modules/3.14.43
    3.14.43/ 3.14.43-dirty/
    root@dra7xx-evm:~# cd /lib/modules/3.14.43-dirty/
    build modules.dep modules.pcimap
    extra/ modules.dep.bin modules.seriomap
    kernel/ modules.devname modules.softdep
    modules.alias modules.ieee1394map modules.symbols
    modules.alias.bin modules.inputmap modules.symbols.bin
    modules.builtin modules.isapnpmap modules.usbmap
    modules.builtin.bin modules.ofmap source
    modules.ccwmap modules.order
    root@dra7xx-evm:~# cd /lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget/
    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# insmod function/usb_f_mass_storage.ko
    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# insmod legacy/g
    g_acm_ms.ko g_ether.ko g_midi.ko g_serial.ko
    g_audio.ko g_ffs.ko g_multi.ko g_webcam.ko
    g_cdc.ko g_hid.ko g_ncm.ko g_zero.ko
    g_dbgp.ko g_mass_storage.ko g_printer.ko gadgetfs.ko
    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# insmod legacy/g_
    g_acm_ms.ko g_ether.ko g_midi.ko g_serial.ko
    g_audio.ko g_ffs.ko g_multi.ko g_webcam.ko
    g_cdc.ko g_hid.ko g_ncm.ko g_zero.ko
    g_dbgp.ko g_mass_storage.ko g_printer.ko
    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# insmod legacy/g_mass_storage.ko file=/dev/ram0 stall=0
    insmod: ERROR: could not insert module legacy/g_mass_storage.ko: No such device
    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# dmesg | tail
    [ 13.363552] (stk) :ldisc_install = 1
    [ 14.366533] (stk) :ldisc installation timeout
    [ 14.369422] (stk) :ldisc_install = 0
    [ 15.366534] (stk) : timed out waiting for ldisc to be un-installed
    [ 15.478259] (stk) :ldisc_install = 1
    [ 16.476532] (stk) :ldisc installation timeout
    [ 16.479420] (stk) :ldisc_install = 0
    [ 17.476531] (stk) : timed out waiting for ldisc to be un-installed
    [ 17.483258] Bluetooth: st_register failed -22
    [ 150.448473] couldn't find an available UDC
    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget#

    in other way i found the kconfg file 

    ti-glsdk_dra7xx-evm_7_01_00_03/board-support/linux/drivers/usb/gadget/udc/Kconfig:

    config USB_OMAP
    tristate "OMAP USB Device Controller"
    depends on ARCH_OMAP1
    depends on ISP1301_OMAP || !(MACH_OMAP_H2 || MACH_OMAP_H3)
    help
    Many Texas Instruments OMAP processors have flexible full
    speed USB device controllers, with support for up to 30
    endpoints (plus endpoint zero). This driver supports the
    controller in the OMAP 1611, and should work with controllers
    in other OMAP processors too, given minor tweaks.

    Say "y" to link the driver statically, or "m" to build a
    dynamically linked module called "omap_udc" and force all
    gadget drivers to also be dynamically linked.

    the USB_OMAP is depends on OMAP1 is it right?

  • Hello Jim,

    Try to apply the sequence in the pictures below:

    root@dra7xx-evm:/lib/modules/3.14.31/kernel/drivers/usb/gadget# ls -la
    drwxr-xr-x 2 root root 4096 Mar 1 18:25 .
    drwxr-xr-x 10 root root 4096 Mar 1 18:08 ..
    -rw-r--r-- 1 root root 12100 Mar 1 18:03 g_acm_ms.ko
    -rw-r--r-- 1 root root 21956 Mar 1 18:03 g_audio.ko
    -rw-r--r-- 1 root root 9672 Mar 1 18:03 g_cdc.ko
    -rw-r--r-- 1 root root 6344 Mar 1 18:03 g_dbgp.ko
    -rw-r--r-- 1 root root 11552 Mar 1 18:03 g_ether.ko
    -rw-r--r-- 1 root root 14940 Mar 1 18:03 g_ffs.ko
    -rw-r--r-- 1 root root 18300 Mar 1 18:03 g_hid.ko
    -rw-r--r-- 1 root root 12192 Mar 1 18:03 g_mass_storage.ko
    -rw-r--r-- 1 root root 19208 Mar 1 18:03 g_midi.ko
    -rw-r--r-- 1 root root 15976 Mar 1 18:03 g_multi.ko
    -rw-r--r-- 1 root root 8904 Mar 1 18:03 g_ncm.ko
    -rw-r--r-- 1 root root 24236 Mar 1 18:03 g_printer.ko
    -rw-r--r-- 1 root root 9376 Mar 1 18:03 g_serial.ko
    -rw-r--r-- 1 root root 28880 Mar 1 18:03 g_webcam.ko
    -rw-r--r-- 1 root root 13448 Mar 1 18:03 g_zero.ko
    -rw-r--r-- 1 root root 27896 Mar 1 18:03 gadgetfs.ko
    -rw-r--r-- 1 root root 61064 Mar 1 18:03 libcomposite.ko
    -rw-r--r-- 1 root root 22328 Mar 1 18:03 u_ether.ko
    -rw-r--r-- 1 root root 18204 Mar 1 18:03 u_serial.ko
    -rw-r--r-- 1 root root 11644 Mar 1 18:03 usb_f_acm.ko
    -rw-r--r-- 1 root root 15460 Mar 1 18:03 usb_f_ecm.ko
    -rw-r--r-- 1 root root 11748 Mar 1 18:03 usb_f_ecm_subset.ko
    -rw-r--r-- 1 root root 30096 Mar 1 18:03 usb_f_fs.ko
    -rw-r--r-- 1 root root 59616 Mar 1 18:03 usb_f_mass_storage.ko
    -rw-r--r-- 1 root root 21508 Mar 1 18:03 usb_f_ncm.ko
    -rw-r--r-- 1 root root 9680 Mar 1 18:03 usb_f_obex.ko
    -rw-r--r-- 1 root root 33732 Mar 1 18:03 usb_f_rndis.ko
    -rw-r--r-- 1 root root 8132 Mar 1 18:03 usb_f_serial.ko
    -rw-r--r-- 1 root root 21024 Mar 1 18:03 usb_f_ss_lb.ko
    root@dra7xx-evm:/lib/modules/3.14.31/kernel/drivers/usb/gadget#

    Try to insmod ./g_mass_storage.ko.

    Best regards,

    Yanko

  • HI Yanko,

    thanks you quick reply

    I have enable the OTG Support and Dual Role Mode from beginning. but it's seen not work.

    # Miscellaneous USB options
    #
    CONFIG_USB_DEFAULT_PERSIST=y
    CONFIG_USB_DYNAMIC_MINORS=y
    CONFIG_USB_OTG=y
    CONFIG_USB_OTG_WHITELIST=y
    # CONFIG_USB_OTG_BLACKLIST_HUB is not set

    # USB Imaging devices
    #
    # CONFIG_USB_MDC800 is not set
    # CONFIG_USB_MICROTEK is not set
    CONFIG_USB_MUSB_HDRC=y
    # CONFIG_USB_MUSB_HOST is not set
    # CONFIG_USB_MUSB_GADGET is not set
    CONFIG_USB_MUSB_DUAL_ROLE=y

     

    and i have a question that the building Linux kernel version is 3.14.43 from the GLSDK  by myself. but if is origin GLSDK 7_01_00_03 releases package the Linux kernel version is 3.14.31

     g_mass_storage.ko file are located in different path:

    • Linux 3.14.43:
      /lib/modules/3.14.43/kernel/drivers/usb/gadget/legacy/g_mass_storage.ko

    • Linux 3.14.31:
      /lib/modules/3.14.31/kernel/drivers/usb/gadget/g_mass_storage.ko

    why are there have the different path?

  • Hello Jim,

    According to the latest TRM version DRD is not supported.

    24.7.4.4.3 OTG Control Software API
    NOTE: The current implementation of the SuperSpeed USB DRD subsystem does not support OTG
    2.0 protocols SRP and ADP. OTG 2.0 Host Negotiation Protocol (HNP) is supported.
    NOTE: When controller is set to OTG mode, SuperSpeed (USB3.0) is not supported.

    Refer to Global Control register USB_GCTL[13:12] PRTCAPDIR - Port Capability Direction
    0x1: Core acts as DRD in host mode
    0x3: Core acts as OTG DRD, with the mode set by the ID. IN THIS CASE SuperSpeed MODE IS NOT SUPPORTED.
    0x2: Core acts as DRD in device mode

    Therefore DRA7xx doesn't support DRD.

    Best regards,
    Yanko
  • Hi Yanko,

    thank your answer, but where can find the TRM of DRA7xx document?

    Best regards,
    Jim

  • Hi Yanko,

    I also want to know why DRA7xx USB DRD is not suppoted in the latest ?

    thanks in advance

    Best regards
    Jim
  • Hello Jim,

    Please contact your FAE, who must provide you DRA7xx Technical Reference Manual.

    Best regards,

    Yanko

  • Hi Yanko,

    thanks i got the TRM document.

    but i only use USB 2.0 not USB 3.0(SuperSpeed) so.. why are not support DRD ? Could you explain more detail ?

    and according to the GLSDK_7.01.00.03_Data_Sheet is show support USB DRD mode.

    Features Not Supported

    • OTG support (HNP/SRP)

    Features Supported

    • USB Host mode.
    • USB Peripheral mode
    • USB DRD mode (Dual Role Device)

    USB Configuration

    For USB configuration selection please refer to USB General Guide Linux

    Driver Features

    The driver supports the following features

    DRD (Dual Role Device) support

    The DRD (Dual role device) support enable the each instance of controller to configure either as "Host" or "Device" mode. Refer to User's Guide for more details how to configure the controller into DRD mode.

     

    and this is show USB Mass Storage can be work ? how to do it ?

  • Hi Yanko

    in the DRA75x_74x_SR1.1_NDA_TRM_vZ

    24.7.1 SuperSpeed USB DRD Subsystem Overview

    SuperSpeed USB DRD Subsystem has four instances in the device providing the following functions:

    USB1: SuperSpeed (SS) USB 3.0 Dual-Role-Device (DRD) subsystem with integrated SS (USB3.0)

    PHY and HS/FS (USB2.0) PHY

    • USB2: High-Speed (HS) USB 2.0 Dual-Role-Device (DRD) subsystem with integrated HS/FS PHY

    • USB3: HS USB 2.0 Dual-Role-Device (DRD) subsystem with ULPI (SDR) interface to external HS/FS

    PHYs

    • USB4: HS USB 2.0 Dual-Role-Device (DRD) subsystem with ULPI (SDR) interface to external HS/FS

    PHYs.

    is't mean SS USB 3.0 supports the DRD? and we also want to use DRD rather then OTG..

  • Hello Jim,

    I have been investigated the issue with DRD.

    See the listed points, which I discussed with GLSDK experts:

    • The dra7xx USBIP does not support OTG, but it support DRD.
    • The DRD is capability of controller to configure either in host mode or device mode.
    • The OTG uses HNP/SNP protocol for switching role b/w host and device.

    I have new suggestion about the issue with DRD enabling in GLSDK.

    For device mode you have to set dr_mode to “peripheral” in arch/arm/boot/dts/dra7-evm*.dts file

    For example: 

    &usb1 {
    dr_mode =  "peripheral" "otg";
    };

    &usb2 {
    dr_mode = "host";
    };

    Then rebuild your Kernel and test on your board.

    The GLSDK kernel (6.04.x onwards) supports DRD feature, Where USB ports has capable of switching between device mode or host mode dynamically based on the usb cable type connected.

    If host-type (A-type) usb cable is connected, the port switched to host mode.

    If device-type (B-type) usb cable is connected, the port switched to device mode.

    Best regards,

    Yanko

  • Hi Yanko,

    Thanks for you advice.

    i have edit the arch/arm/boot/dts/dra7-evm.dts file

    and usb1 setting up to peripheral as below:

    &usb1 {

           dr_mode = "peripheral";

    };

    and rebuild kernel wtih "make linux_clean", "make linux", "make linux_install" then copy kernel zImage and dra7*.dtb(device tree file), /lib/module/* into flash SD card

    but on the target board the g_mass_storage.ko device drive also can not load UDC

    the loading g_mass_storage.ko fail message

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# insmod legacy/g_mass_storage.ko

    insmod: ERROR: could not insert module legacy/g_mass_storage.ko: No such device

    and kernel message:

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# dmesg | tail
    [ 14.396573] (stk) :ldisc installation timeout
    [ 14.399464] (stk) :ldisc_install = 0
    [ 15.396575] (stk) : timed out waiting for ldisc to be un-installed
    [ 15.508301] (stk) :ldisc_install = 1
    [ 16.506572] (stk) :ldisc installation timeout
    [ 16.509461] (stk) :ldisc_install = 0
    [ 17.506571] (stk) : timed out waiting for ldisc to be un-installed
    [ 17.513299] Bluetooth: st_register failed -22
    [ 241.549485] couldn't find an available UDC
    [ 616.511753] couldn't find an available UDC

     

    so i check the source code ”linux/drivers/usb/gadget/udc/udc-core.c”  in the function usb_gadget_probe_driver() is show the couldn't find an available UDC

    and than in the ”linux/drivers/usb/gadget/udc/omap_udc.c” function omap_udc_probe() should be register to UDC-core 

    but i can't found the kernel option with OMAP UDC (Device Drivers->USB support->USB Gadget Support) 

    is it a key point?

  • Hello Jim,

    My last suggestion about your problem with UDC support.

    You need to insert the dependent module from drivers/usb/gadget/function/usb_f_mass_storage.ko.

    Then insert g_mass_storage.ko.
    #insmod g_mass_stoarge.ko file=/dev/ram0 stall=0

    Make sure previous inserted gadget modules are rmmod (incase of port is configured for DRD).

    Best regards,
    Yanko
  • Hello Jim,

    Do you have any updates with your issue?

    Best regards,
    Yanko
  • Hi Yanko,

    Yes, usb_f_mass_storage.ko. has inserted. But g_mass_storage.ko was still had UDC error , no matter I added " file=/dev/ram0 stall=0" or not.

    Thanks.
  • Hello Jim,

    Could you share complete console logs?

    Do you use DRA7xx EVM or you have designed your own board?

    Best regards,
    Yanko
  • I use TI-J6 EVM board.

    root@dra7xx-evm:~# dmesg |head

    [    0.000000] Booting Linux on physical CPU 0x0

    [    0.000000] Linux version 3.14.43-dirty (anthony@anthony-VirtualBox) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #2 SMP PREEMPT Fri Aug 28 10:40:39 CST 2015

    [    0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=10c5387d

    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache

    [    0.000000] Machine model: TI DRA742

    [    0.000000] Reserved memory: created CMA memory pool at 0x95800000, size 56 MiB

    [    0.000000] Reserved memory: initialized node ipu2_cma@95800000, compatible id shared-dma-pool

    [    0.000000] Reserved memory: created CMA memory pool at 0x99000000, size 64 MiB

    [    0.000000] Reserved memory: initialized node dsp1_cma@99000000, compatible id shared-dma-pool

    [    0.000000] Reserved memory: created CMA memory pool at 0x9d000000, size 32 MiB

    root@dra7xx-evm:~#

    root@dra7xx-evm:~# dmesg |tail

    [   14.276798] (stk) : timed out waiting for ldisc to be un-installed

    [   14.388524] (stk) :ldisc_install = 1

    [   15.386797] (stk) :ldisc installation timeout

    [   15.389686] (stk) :ldisc_install = 0

    [   16.386824] (stk) : timed out waiting for ldisc to be un-installed

    [   16.498607] (stk) :ldisc_install = 1

    [   17.496800] (stk) :ldisc installation timeout

    [   17.499691] (stk) :ldisc_install = 0

    [   18.496798] (stk) : timed out waiting for ldisc to be un-installed

    [   18.503527] Bluetooth: st_register failed -22

    root@dra7xx-evm:~#

    root@dra7xx-evm:~# cd /lib/mod

    modprobe.d/ modules/

    root@dra7xx-evm:~# cd /lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget/

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget#

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# insmod function/usb_f_mass_storage.ko

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget#

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# insmod legacy/g_mass_storage.ko file=/dev/ram0 stall=0

    insmod: ERROR: could not insert module legacy/g_mass_storage.ko: No such device

  • Here is the dmesg after insmod.

     

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# insmod legacy/g_mass_storage.ko file=/dev/ram0 stall=0

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget# dmesg |tai

    l

    [   15.389686] (stk) :ldisc_install = 0

    [   16.386824] (stk) : timed out waiting for ldisc to be un-installed

    [   16.498607] (stk) :ldisc_install = 1

    [   17.496800] (stk) :ldisc installation timeout

    [   17.499691] (stk) :ldisc_install = 0

    [   18.496798] (stk) : timed out waiting for ldisc to be un-installed

    [   18.503527] Bluetooth: st_register failed -22

    [  421.669461] couldn't find an available UDC

    [  883.771148] couldn't find an available UDC

    [ 1038.261245] couldn't find an available UDC

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget#

  • Hello Jim,

    See some comments from SW team:

    Can you check whether legacy/g_mass_storage.ko file exists?

    Have tried with default GLSDK release image ?

    Also make sure the USB port you are trying to load module, the dr_mode should be set to “otg”. Check arch/arm/boot/dts/dra7-evm.dts file.

    Best regards,
    Yanko
  • 1.  g_mass_storage.ko is existed.

    root@dra7xx-evm:/lib/modules/3.14.43-dirty/kernel/drivers/usb/gadget/legacy# ls -la g_mas*.*

    -rw-r--r--    1 root     root        110600 Aug 28  2015 g_mass_storage.ko

    2. It's no used. You can check 8/24,27 reply.

    3. Did TI try this issue on EVM board? I think it's easy to reproduce.

     

    Best Regards,

    Jim Lin