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.

Registering musb driver and DA8xx/OMAP-L1x glue layer

Other Parts Discussed in Thread: OMAPL138, DA8XX

I am trying to use the build in the musb driver and use the omapl1x glue layer.

I'm in kernel version 3.19, and i see that from version 3.08 to 3.09 they removed the option for this glue layer from the musb menuconfig by adding 'depends on broken' to the musb kconfig? Does anyone know why? Should we not try to use this driver?

Even when i delete the extra dependency and build the glue layer into my kernel, i don't see any printk's that i added to the glue layer probe function in the kernel output on boot.

This driver and its corresponding glue layer are what is called in the da850evm (omapl138lcdk)? It seems that it does a good job of setting up the necessary registers during the probe function. Is this driver now obselete, if so which should I try to use for omapl138 part?

Thanks,

Dan

  • Hi,
    Are you facing this same problem on this thread too ?
    e2e.ti.com/.../411195
  • Yes That problem is me, but i have since made more progress, and its more relevant to just linux than specifically the omap device so i have moved the question here.

    I was on kernel version 3.19 where menconfig does not allow selection of the da8xx/omap-l1x glue layer. I have since checked out version 3.8 of the kernel and I can see the glue layers probe function running! I do not see any failures w/ regards to registering the driver and i see 5V coming out of the drv_vbus which in turn puts 5 volts out to my USB connector.

    However, i do not see any feedback from the kernel when inserting or removing a USB stick, and i don't see the USB device at media/sdax. Is the driver and glue layer supposed to automatically mount the USB device or am i missing a step?

    Thanks,

    Dan

  • Hi Daniel,


    I was on kernel version 3.19 where menconfig does not allow selection of the da8xx/omap-l1x glue layer. I have since checked out version 3.8 of the kernel and I can see the glue layers probe function running! I do not see any failures w/ regards to registering the driver and i see 5V coming out of the drv_vbus which in turn puts 5 volts out to my USB connector.

    I suspect that the link got broken since all davinci processor merged to one single (option) defconfig called "davinci_all_defconfig", so we may not having support to select options "ARCH_DAVINCI_DA8XX" and "USB_MUSB_DAVINCI" etc.,

    How did you configure the kernel in linux3.8 ?
    With separate DA8XX defconfig or like this "davinci_all_defconfig" ?

    I'm looking into the latest kernel and will get back to you.
    Thanks for your patience.

    Mean while, please update us if you got any further improvement if any.
  • It is a custom .config which i can copy here if needed. I don't really care if the latest kernel will work, going back to 3.8 is OK for me.

    In the mean time i have gone back  even further to the MCSDK which uses kernel version 3.3.0. Using this version i can see that the musb-da8xx driver is in 'a_idle' mode by going to /sys/devices/platform/musb-da8xx/musb-hdrc and doing a cat mode. However, when i insert a USB stick (PNY stick formatted on my host machine to have 1 FAT32 partition) nothing happens and there is no /media/sdx directory. Am i still missing something with the driver configuration, or do i need to call some commands to the driver?

    -Dan

  • Hi Daniel,

    In the mean time i have gone back even further to the MCSDK which uses kernel version 3.3.0. Using this version i can see that the musb-da8xx driver is in 'a_idle' mode by going to /sys/devices/platform/musb-da8xx/musb-hdrc and doing a cat mode. However, when i insert a USB stick (PNY stick formatted on my host machine to have 1 FAT32 partition) nothing happens and there is no /media/sdx directory. Am i still missing something with the driver configuration, or do i need to call some commands to the driver?

    Is that problem from kernel 3.8 or 3.3 ?
    Could you attach the complete boot log.
    Are you trying USB2.0 and seen the problem from host mode or device mode or both ?

    Do you have DA850 SDI EVM or OMAPL138 LCDK ?
  • The following is from the MCSDK/3.3 kernel. This is a custom board, but the USB hardware has been verified in the past. We are using USB0 peripheral on the OMAPL138, so no GPIO is needed. At the end of the boot output you can see the printed mode of the driver.

    5226.Kernel Output and Config.txt

    I am using the musb da8xx driver to setup USB OTG, but the ID pin on my board is tied to ground and we should be forced to host mode. If it is preferable to use OHCI or EHCI I can do that also, the goal is just to be able to hot plug and remove and access any inserted USB stick.

  • In bootlog, the "USB2.0 HUB" found print was missing.
    If you have any OMAPL138 EVM then you can compare the both your custom board and EVM bootup logs..

    processors.wiki.ti.com/.../DaVinci_PSP_03.21.00.04_Device_Driver_Features_and_Performance_Guide
  • I have changed the config make mass storage gadget a module instead of built in because it seems all the examples are that way. There results are better. First when the module runs it detects the port, then it says it detected an SCSI device and attaches it, however i dont know how to access it...

    root@arago:/lib/modules/3.3.0/kernel/drivers/usb/gadget# modprobe g_mass_storage
    gadget: Mass Storage Function, version: 2009/09/11
    gadget: Number of LUNs=1
    lun0: LUN: removable file: (no medium)
    gadget: Mass Storage Gadget, version: 2009/09/11
    gadget: userspace failed to provide iSerialNumber
    gadget: g_mass_storage ready
    musb-hdrc musb-hdrc: MUSB HDRC host driver
    musb-hdrc musb-hdrc: new USB bus registered, assigned bus number 1
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: MUSB HDRC host driver
    usb usb1: Manufacturer: Linux 3.3.0 musb-hcd
    usb usb1: SerialNumber: musb-hdrc
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    root@arago:/lib/modules/3.3.0/kernel/drivers/usb/gadget# usb 1-1: new high-speed USB device number 2 using musb-hdrc
    usb 1-1: New USB device found, idVendor=154b, idProduct=005b
    usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 1-1: Product: USB 2.0 FD
    usb 1-1: Manufacturer: PNY Technologies
    usb 1-1: SerialNumber: AA00000000000575
    scsi0 : usb-storage 1-1:1.0
    scsi 0:0:0:0: Direct-Access PNY USB 2.0 FD 1100 PQ: 0 ANSI: 4
    sd 0:0:0:0: Attached scsi generic sg0 type 0
    sd 0:0:0:0: [sda] 63901440 512-byte logical blocks: (32.7 GB/30.4 GiB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] No Caching mode page present
    sd 0:0:0:0: [sda] Assuming drive cache: write through
    <7>usb-storage: usb_stor_bulk_transfer_sglist: xfer 18 bytes, 1 entries
    sd 0:0:0:0: [sda] No Caching mode page present
    sd 0:0:0:0: [sda] Assuming drive cache: write through
    sda: sda1
    sd 0:0:0:0: [sda] No Caching mode page present
    sd 0:0:0:0: [sda] Assuming drive cache: write through
    sd 0:0:0:0: [sda] Attached SCSI removable disk


    If i do a find, i can see the sda device...
    root@arago:/# find -name sda*
    ./mnt/sda1
    ./sys/devices/platform/musb-da8xx/musb-hdrc/usb1/1-1/1-1:1.0/host1/target1:0:0/1:0:0:0/block/sda
    ./sys/devices/platform/musb-da8xx/musb-hdrc/usb1/1-1/1-1:1.0/host1/target1:0:0/1:0:0:0/block/sda/sda1
    ./sys/class/block/sda
    ./sys/class/block/sda1
    ./sys/block/sda
    root@arago:/#

    however on the usb stick there is a file name 'dan' and when i cd to these directories i dont see that, instead i see the following;
    root@arago:/# cd /sys/class/block/sda1
    root@arago:/sys/devices/platform/musb-da8xx/musb-hdrc/usb1/1-1/1-1:1.0/host1/target1:0:0/1:0:0:0/block/sda/sda1# ls -l
    -r--r--r-- 1 root root 4096 Aug 5 19:34 alignment_offset
    -r--r--r-- 1 root root 4096 Aug 5 19:34 dev
    -r--r--r-- 1 root root 4096 Aug 5 19:34 discard_alignment
    drwxr-xr-x 2 root root 0 Aug 5 19:34 holders
    -r--r--r-- 1 root root 4096 Aug 5 19:34 inflight
    -r--r--r-- 1 root root 4096 Aug 5 19:34 partition
    -r--r--r-- 1 root root 4096 Aug 5 19:34 ro
    -r--r--r-- 1 root root 4096 Aug 5 19:34 size
    -r--r--r-- 1 root root 4096 Aug 5 19:34 start
    -r--r--r-- 1 root root 4096 Aug 5 19:34 stat
    lrwxrwxrwx 1 root root 0 Aug 5 19:34 subsystem -> ../../../../../../../../../../../../../class/block
    -rw-r--r-- 1 root root 4096 Aug 5 19:34 uevent
    root@arago:/sys/devices/platform/musb-da8xx/musb-hdrc/usb1/1-1/1-1:1.0/host1/target1:0:0/1:0:0:0/block/sda/sda1#
  • If you want to access your attached pendrive then do the following commands.

    mkdir /mnt
    mount /dev/sda1 /mnt
  • Please see my log post from earlier. There is no directory at /dev/sda1 so i cannot mount it to /mnt. I must be missing something in the driver or missing a step because there is no /dev/sda1 directory after attaching the scsi device.

    sd 0:0:0:0: [sda] Attached SCSI removable disk

    root@arago:~# cd /
    root@arago:/# mkdir /mnt
    mkdir: cannot create directory '/mnt': File exists
    root@arago:/# ls
    bin etc linuxrc mnt sys var
    boot home lost+found proc tmp
    dev lib media sbin usr
    root@arago:/# cd mnt
    root@arago:/mnt# ls
    card cf net ram
    root@arago:/mnt# cd /
    root@arago:/# mount /dev/sda1 /mnt
    mount: mounting /dev/sda1 on /mnt failed: No such file or directory

    As said above, a find command for sda* returns only the following;

    root@arago:/# find -name sda*
    ./sys/devices/platform/musb-da8xx/musb-hdrc/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/block/sda
    ./sys/devices/platform/musb-da8xx/musb-hdrc/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda1
    ./sys/class/block/sda
    ./sys/class/block/sda1
    ./sys/block/sda

  • What type of format used for your pendrive ?
    ie FAT, ext3 etc., ?

    Format your pendrive in FAT and format and try.

    Also provide the output of the following command.

    cat /proc/filesystem
  • I used gparted on my host machine to format and partition the pen drive. It is a FAT32 filesystem with 1 partition.

    root@arago:/media# cd /
    root@arago:/# cat /proc/filesystems
    nodev sysfs
    nodev rootfs
    nodev bdev
    nodev proc
    nodev tmpfs
    nodev debugfs
    nodev sockfs
    nodev pipefs
    nodev anon_inodefs
    nodev rpc_pipefs
    nodev devpts
    ext3
    ext2
    cramfs
    nodev ramfs
    vfat
    msdos
    iso9660
    nodev nfs
    nodev jffs2
    nodev autofs
    nodev mqueue
    nodev mtd_inodefs
    nodev ubifs
    root@arago:/#