From: softwizz <ad...@is...> - 2011-06-17 10:28:37
|
I've been trying hard to get a USB flash drive to mount on my target board (custom board using Overo Water). My build is Scott Ellis's minimal 2.6.34 r97 one, with modifications for my use cases. linux-omap3-2.6.34.bb contains sed scripting to enforce the correct kernel configurations for host, peripheral and OTG modes, but I can't get the OTG configuration to mount the flash drive, yet the host configuration does it fine. The differences between the sed scripts used to condition the kernel config, are as follows :- 1,2c1,2 < if [ "${MUSB_MODE}" = "host" ]; then < sed -i 's:# CONFIG_USB_MUSB_HOST is not set:CONFIG_USB_MUSB_HOST=y:g' ${WORKDIR}/defconfig --- > if [ "${MUSB_MODE}" = "otg" ]; then > sed -i 's:CONFIG_USB_MUSB_HOST=y:# CONFIG_USB_MUSB_HOST is not set:g' ${WORKDIR}/defconfig 4,6c4,6 < sed -i 's:CONFIG_USB_MUSB_OTG=y:# CONFIG_USB_MUSB_OTG is not set:g' ${WORKDIR}/defconfig < sed -i 's:# CONFIG_USB_MUSB_HDRC_HCD is not set:CONFIG_USB_MUSB_HDRC_HCD=y:g' ${WORKDIR}/defconfig < sed -i 's:CONFIG_USB_GADGET_MUSB_HDRC=y:# CONFIG_USB_GADGET_MUSB_HDRC is not set:g' ${WORKDIR}/defconfig --- > sed -i 's:# CONFIG_USB_MUSB_OTG is not set:CONFIG_USB_MUSB_OTG=y:g' ${WORKDIR}/defconfig > sed -i 's:CONFIG_USB_MUSB_HDRC_HCD=y:# CONFIG_USB_MUSB_HDRC_HCD is not set:g' ${WORKDIR}/defconfig > sed -i 's:# CONFIG_USB_GADGET_MUSB_HDRC is not set:CONFIG_USB_GADGET_MUSB_HDRC=y:g' ${WORKDIR}/defconfig The differences between the generated config files, are as follows :- 1134a1135 > CONFIG_USB_OTG=y 1162c1163 < CONFIG_USB_MUSB_HOST=y --- > # CONFIG_USB_MUSB_HOST is not set 1164,1165c1165,1166 < # CONFIG_USB_MUSB_OTG is not set < # CONFIG_USB_GADGET_MUSB_HDRC is not set --- > CONFIG_USB_MUSB_OTG=y > CONFIG_USB_GADGET_MUSB_HDRC=y 1306,1307c1307 < CONFIG_USB_GADGET_OMAP=y < CONFIG_USB_OMAP=y --- > # CONFIG_USB_GADGET_OMAP is not set 1322c1322 < # CONFIG_USB_GADGET_DUALSPEED is not set --- > CONFIG_USB_GADGET_DUALSPEED=y The target is booted up with the flash driver already inserted in the OTG port via a mini-to-standard USB adaptor which has been doctored for use on the OTG port. The differences between the USB-related console boot log entries for the two built kernels are as follows :- 67c67 < musb_hdrc: version 6.0, musb-dma, host, debug=0 --- > musb_hdrc: version 6.0, musb-dma, otg (peripheral+host), debug=0 74,84c74 < 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 2.6.34 musb-hcd < usb usb1: SerialNumber: musb_hdrc < hub 1-0:1.0: USB hub found < hub 1-0:1.0: 1 port detected < musb_hdrc musb_hdrc: USB Host mode controller at fa0ab000 using DMA, IRQ 92 --- > musb_hdrc musb_hdrc: USB OTG mode controller at fa0ab000 using DMA, IRQ 92 95,96c85,86 < rt_fiq_stub_wrapper: c0046720 < fiq_vector: ffff001c, rt_fiq_stub: c0046720, fiq_len: 48 --- > rt_fiq_stub_wrapper: c0045720 > fiq_vector: ffff001c, rt_fiq_stub: c0045720, fiq_len: 48 128c118 < net eth0: MAC Address: 1a:d3:b9:ac:26:3a --- > net eth0: MAC Address: 7e:a8:a0:85:2b:0f 136c126 < ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 2 --- > ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1 139,145c129,135 < usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 < usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 < usb usb2: Product: OMAP-EHCI Host Controller < usb usb2: Manufacturer: Linux 2.6.34 ehci_hcd < usb usb2: SerialNumber: ehci-omap.0 < hub 2-0:1.0: USB hub found < hub 2-0:1.0: 3 ports detected --- > 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: OMAP-EHCI Host Controller > usb usb1: Manufacturer: Linux 2.6.34 ehci_hcd > usb usb1: SerialNumber: ehci-omap.0 > hub 1-0:1.0: USB hub found > hub 1-0:1.0: 3 ports detected 150,152d139 < udc: OMAP UDC driver, version: 4 October 2004 (iso) (dma) 173d159 < usb 1-1: new high speed USB device using musb_hdrc and address 2 176c162 < twl_rtc twl_rtc: setting system clock to 2011-06-16 10:46:31 UTC (1308221191) --- > twl_rtc twl_rtc: setting system clock to 2011-06-15 17:26:49 UTC (1308158809) 178,183d163 < usb 1-1: New USB device found, idVendor=0781, idProduct=5567 < usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 < usb 1-1: Product: Cruzer Blade < usb 1-1: Manufacturer: SanDisk < usb 1-1: SerialNumber: 200607741107BDF258E5 < scsi0 : usb-storage 1-1:1.0 185,186c165,166 < mmc0: new high speed SD card at address 1234 < mmcblk0: mmc0:1234 SA02G 1.83 GiB --- > mmc0: new high speed SD card at address 0007 > mmcblk0: mmc0:0007 SU02G 1.83 GiB 189c169 < EXT3-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended --- > EXT3-fs (mmcblk0p2): warning: maximal mount count reached, running e2fsck is recommended 194c174 < Freeing init memory: 152K --- > Freeing init memory: 148K 196,203d175 < scsi 0:0:0:0: Direct-Access SanDisk Cruzer Blade 1.10 PQ: 0 ANSI: 2 < sd 0:0:0:0: [sda] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB) < sd 0:0:0:0: [sda] Write Protect is off < sd 0:0:0:0: [sda] Assuming drive cache: write through < sd 0:0:0:0: [sda] Assuming drive cache: write through < sda: sda1 < sd 0:0:0:0: [sda] Assuming drive cache: write through < sd 0:0:0:0: [sda] Attached SCSI removable disk 206,207d177 < FAT: bogus number of reserved sectors < VFS: Can't find a valid FAT filesystem on dev sda. Looking at the above, what seems to be the case is that host mode employs drivers/usb/gadget/omap_udc.c via CONFIG_USB_GADGET_OMAP and CONFIG_USB_OMAP, which then detects a whole other hub in addition to the one detected by both the host and OTG builds, and it is on this other hub that the flash drive is found. In place of drivers/usb/gadget/omap_udc.c the OTG build employs other code modules via CONFIG_USB_GADGET_MUSB_HDRC and CONFIG_USB_MUSB_HDRC_HCD, but the net effect of them is a loss of this host-side functionality. I've tried modifying the kernel config (both directly and via the sed scripts) to include both the MUSB stuff and CONFIG_USB_GADGET_OMAP/CONFIG_USB_OMAP, but the config subsystem cannot tolerate these coexisting, and OTG builds without the MUSB configs hit a #error at drivers/usb/gadget/musb_core.h:103 Can anyone give me any clues about where I can take this? Cheers, Mike -- View this message in context: http://old.nabble.com/USB-OTG-not-working-as-host-tp27066693p31867869.html Sent from the Gumstix mailing list archive at Nabble.com. |