2009-01-30 11:45:33 BF527 USB OTG problems
Kevin Dimmer (UNITED KINGDOM)
Message: 68594
Hi we are just bringing up a new board based on the BF527.
It has both an ISP1760 USB host controller connected to an A-Type socket and the BF built in USB On The Go connected to a mini-ab socket.
I have managed to configure the kernel and get the ISP1760 to detect and mount a FLASH memory Stick OK.
But I am having some problems with the OTG device.
For this test I have configured the kernel to disable the ISP1760 and enable the OTP as master only (we need to get it working as both master and slave eventually)
I have followed the configuration settings as described here
http://docs.blackfin.uclinux.org/doku.php?id=usb_peripherals#usb_gadget_api_framework
for USB Host side support and the settings here
http://docs.blackfin.uclinux.org/doku.php?id=hw:cards:usb_ez-extender#test_usb_mass_stroage
for the mass storage setup.
This is the console o/p
Linux version 2.6.22.19-ADI-2008R1.5-svn (kevind@vgc-ds1.vitecnet.local) (gcc ve
rsion 4.1.2 (ADI svn)) #150 Fri Jan 30 15:22:54 GMT 2009
early printk enabled on early_BFuart0
Hardware Trace Active and Enabled
Blackfin support (C) 2004-2007 Analog Devices, Inc.
Compiled for ADSP-BF527 Rev 0.1
Warning: Compiled for Rev 1, but running on Rev 2
Blackfin Linux support by http://blackfin.uclinux.org/
Processor Speed: 400 MHz core clock and 133 MHz System Clock
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
text = 0x00001000-0x0017e790
rodata = 0x0017f000-0x001f31a0
data = 0x001f4000-0x0020c000
stack = 0x001f4000-0x001f6000
init = 0x0020c000-0x00227000
bss = 0x00227000-0x0023be44
available = 0x0023be44-0x03700000
rootfs = 0x03700000-0x03f00000
DMA Zone = 0x03f00000-0x04000000
NOMPU: setting up cplb tables for global access
Instruction Cache Enabled
Data Cache Enabled (write-through)
Built 1 zonelists. Total pages: 13970
Kernel command line: root=/dev/mtdblock0 rw rootfs=ext2 earlyprintk=serial,uart0
,57600 cone=ttyBF0,57600 vgcusr=kevind ip=172.16.8.5:172.16.0.4:172.16.0.1:255.2
55.0.0:bf527-dpl:eth0:off
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
console handover: boot [early_BFuart0] -> real [ttyBF0]
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 53456k/65536k RAM, (108k init code, 1525k kernel code, 650k da
ta, 1024k dma, 584k reserved)
Blackfin Scratchpad data SRAM: 4 KB
Blackfin Data A SRAM: 16 KB (15 KB free)
Blackfin Data B SRAM: 16 KB (16 KB free)
Blackfin Instruction SRAM: 48 KB (41 KB free)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
=== DPL === dpl_init(): registering device resources
Generic PHY: Registered new driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
musb_hdrc: version 6.0, musb-dma, host, debug=0
musb_hdrc: USB Host mode controller at ffc03800 using DMA, IRQ 59
musb_hdrc musb_hdrc.0: MUSB HDRC host driver
musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
dma_alloc_init: dma_page @ 0x03602000 - 256 pages at 0x03f00000
hub 1-0:1.0: 1 port detected
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
JFFS2 version 2.2. (NAND) Â 2001-2006 Red Hat, Inc.
JFFS2: default compression mode: priority
JFS: nTxBlock = 417, nTxLock = 3341
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 29) is a BFIN-UART
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
SMSC LAN83C185: Registered new driver
bfin_mac_mdio: probed
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, m
dc_clk=2500000Hz(mdc_div=25)@sclk=133MHz)
bfin_mac: Version 1.1, Blackfin BF53[67] BF527 on-chip Ethernet MAC driver
uclinux[mtd]: RAM probe address=0x3700000 size=0x800000
Creating 1 MTD partitions on "RAM":
0x00000000-0x00800000 : "ROMfs"
mtd: Giving out device 0 to ROMfs
m25p80 spi0.1: m25p128 (16384 Kbytes)
Creating 4 MTD partitions on "m25p80":
0x00000000-0x00040000 : "bootloader"
mtd: Giving out device 1 to bootloader
0x00040000-0x00480000 : "linux kernel"
mtd: Giving out device 2 to linux kernel
0x00480000-0x00c80000 : "rootfs"
mtd: Giving out device 3 to rootfs
0x00c80000-0x01000000 : "app"
mtd: Giving out device 4 to app
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, r
egs_base@ffc00500, dma channel@7
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
i2c /dev entries driver
i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller Driver, Ve
rsion 1.8, regs_base@ffc01400
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
IP-Config: Complete:
device=eth0, addr=172.16.8.5, mask=255.255.0.0, gw=172.16.0.1,
host=bf527-dpl, domain=, nis-domain=(none),
bootserver=172.16.0.4, rootserver=172.16.0.4, rootpath=
mtdblock_open
ok
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 108k freed
rc detected RAMBOOT
MTDSB: path_lookup() returned -2, inode 00000000
mount: mounting /dev/mtdblock4 on /usr failed
hello kevind
PHY: 0:01 - Link is Up - 100/Full
running initialisation file on server
Executing initialistion from target/rc
Mac Add 00:0E:98:00:2B:05
BusyBox v1.4.1 (2009-01-23 14:58:51 GMT) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
After the kernel has booted I plug in a Kingston 4GB DataTraveller FLASH stick connected using a simple mini-ab to USB-A cable. I get the following error messages.
root:/> usb 1-1: new high speed USB device using musb_hdrc and address 2
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high speed USB device using musb_hdrc and address 3
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high speed USB device using musb_hdrc and address 4
usb 1-1: device not accepting address 4, error -71
usb 1-1: new high speed USB device using musb_hdrc and address 5
usb 1-1: device not accepting address 5, error -71
Any suggestions as to what might be wrong?
Thanks
Kevin
QuoteReplyEditDelete
2009-01-30 13:47:19 Re: BF527 USB OTG problems
Mike Frysinger (UNITED STATES)
Message: 68598
our USB expert is on chinese new year atm, but when he gets back he'll take a look ...
QuoteReplyEditDelete
2009-02-02 04:30:04 Re: BF527 USB OTG problems
Bryan Wu (CHINA)
Message: 68662
Hi Kevin,
I found you are using 08R1.5 release and your silicon is BF527 rev 0.2. So please enable the debug message level:
---
<*> Inventra Highspeed Dual Role Controller (TI, ADI, ...)
--- Blackfin BF54x, BF525 and BF527 high speed USB support
Driver Mode (USB Host) --->
[ ] Disable DMA (always use PIO)
(10) Logging Level (0 - none / 3 - annoying / ... )
--
And post the debug message to us. Please.
Did you try other USB Flash disk on BF527 board?
-Bryan
QuoteReplyEditDelete
2009-02-02 12:36:16 Re: BF527 USB OTG problems
Kevin Dimmer (UNITED KINGDOM)
Message: 68686
Hi Bryan
Here are the results with logging set to level 10
Linux version 2.6.22.19-ADI-2008R1.5-svn (kevind@vgc-ds1.vitecnet.local) (gcc ve
rsion 4.1.2 (ADI svn)) #153 Mon Feb 2 17:01:52 GMT 2009
early printk enabled on early_BFuart0
Hardware Trace Active and Enabled
Blackfin support (C) 2004-2007 Analog Devices, Inc.
Compiled for ADSP-BF527 Rev 0.1
Warning: Compiled for Rev 1, but running on Rev 2
Blackfin Linux support by http://blackfin.uclinux.org/
Processor Speed: 400 MHz core clock and 133 MHz System Clock
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
text = 0x00001000-0x0017f920
rodata = 0x00180000-0x001f5148
data = 0x001f6000-0x0020e000
stack = 0x001f6000-0x001f8000
init = 0x0020e000-0x00229000
bss = 0x00229000-0x0023de44
available = 0x0023de44-0x03700000
rootfs = 0x03700000-0x03f00000
DMA Zone = 0x03f00000-0x04000000
NOMPU: setting up cplb tables for global access
Instruction Cache Enabled
Data Cache Enabled (write-through)
Built 1 zonelists. Total pages: 13970
Kernel command line: root=/dev/mtdblock0 rw rootfs=ext2 earlyprintk=serial,uart0
,57600 cone=ttyBF0,57600 vgcusr=kevind ip=172.16.8.5:172.16.0.4:172.16.0.1:255.2
55.0.0:bf527-dpl:eth0:off
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
console handover: boot [early_BFuart0] -> real [ttyBF0]
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 53448k/65536k RAM, (108k init code, 1530k kernel code, 653k da
ta, 1024k dma, 584k reserved)
Blackfin Scratchpad data SRAM: 4 KB
Blackfin Data A SRAM: 16 KB (15 KB free)
Blackfin Data B SRAM: 16 KB (16 KB free)
Blackfin Instruction SRAM: 48 KB (41 KB free)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
=== DPL === dpl_init(): registering device resources
Generic PHY: Registered new driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
musb_hdrc: version 6.0/dbg, pio, host, debug=10
musb_hdrc: USB Host mode controller at ffc03800 using PIO, IRQ 59
musb_hdrc musb_hdrc.0: MUSB HDRC host driver
musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
(NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
JFFS2 version 2.2. (NAND) Â 2001-2006 Red Hat, Inc.
JFFS2: default compression mode: priority
JFS: nTxBlock = 417, nTxLock = 3340
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 29) is a BFIN-UART
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
SMSC LAN83C185: Registered new driver
bfin_mac_mdio: probed
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, m
dc_clk=2500000Hz(mdc_div=25)@sclk=133MHz)
bfin_mac: Version 1.1, Blackfin BF53[67] BF527 on-chip Ethernet MAC driver
uclinux[mtd]: RAM probe address=0x3700000 size=0x800000
Creating 1 MTD partitions on "RAM":
0x00000000-0x00800000 : "ROMfs"
mtd: Giving out device 0 to ROMfs
m25p80 spi0.1: m25p128 (16384 Kbytes)
Creating 4 MTD partitions on "m25p80":
0x00000000-0x00040000 : "bootloader"
mtd: Giving out device 1 to bootloader
0x00040000-0x00480000 : "linux kernel"
mtd: Giving out device 2 to linux kernel
0x00480000-0x00c80000 : "rootfs"
mtd: Giving out device 3 to rootfs
0x00c80000-0x01000000 : "app"
mtd: Giving out device 4 to app
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, r
egs_base@ffc00500, dma channel@7
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
i2c /dev entries driver
i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller Driver, Ve
rsion 1.8, regs_base@ffc01400
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
IP-Config: Complete:
device=eth0, addr=172.16.8.5, mask=255.255.0.0, gw=172.16.0.1,
host=bf527-dpl, domain=, nis-domain=(none),
bootserver=172.16.0.4, rootserver=172.16.0.4, rootpath=
mtdblock_open
ok
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 108k freed
dma_alloc_init: dma_page @ 0x00223000 - 256 pages at 0x03f00000
rc detected RAMBOOT
MTDSB: path_lookup() returned -2, inode 00000000
mount: mounting /dev/mtdblock4 on /usr failed
hello kevind
PHY: 0:01 - Link is Up - 100/Full
running initialisation file on server
Executing initialistion from target/rc
Mac Add 00:0E:98:00:2B:05
=== USB Test ===
BusyBox v1.4.1 (2009-02-02 17:02:12 GMT) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
This is what happens when I plug the Kingston 4GB stick in
root:/> usb 1-1: new high speed USB device using musb_hdrc and address 2
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high speed USB device using musb_hdrc and address 3
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high speed USB device using musb_hdrc and address 4
usb 1-1: device not accepting address 4, error -71
usb 1-1: new high speed USB device using musb_hdrc and address 5
usb 1-1: device not accepting address 5, error -71
If I unplug and plug in again I just get more of the same.
I have tried it with a 128MB Buffalo Clip Drive and get no detection message at all.
Same with a 128MB Kingsmax Stick, no messages
All 3 sticks work OK in my windows PC
I have tried making each stick the 1st thing I plug in after a re-boot, reuslts are the same.
I have also tried the same tests with DMA enabled, results seem to be exactly the same.
I notice that there are some changes in the USB directory after the drop of code we are using, are they likely to be significant with regard to this problem?
Thanks
Kevin
QuoteReplyEditDelete
2009-02-02 21:16:20 Re: BF527 USB OTG problems
Bill Xie (CHINA)
Message: 68692
It is sample problem to my BF527.I cann't solve this problem.
QuoteReplyEditDelete
2009-02-02 21:19:36 Re: BF527 USB OTG problems
Bryan Wu (CHINA)
Message: 68693
Hi Kevin,
Before you plug in the USB flash disk, please run command 'echo 9 > /proc/sys/kernel/printk' in the serial console.Then after you plug in the USB flash disk, more debug message will show up.
And from your description, I guess there are some issues about the hardware power supply to the USB OTG.
Is the board same as EZKIT-BF527? Did you try the same Linux kernel and same USB flash disk on ADI EZKIT-BF527?
Or if you have a self-powered USB Harddisk, please try it on your board.
We should try to know what kind of problem on your side, hardware or software, right?
-Bryan
QuoteReplyEditDelete
2009-02-03 01:26:58 Re: BF527 USB OTG problems
Bryan Wu (CHINA)
Message: 68697
Hi Bill,
I don't understand your words. Do you mean usb function is OK on some your BF527 boards and failed on other boards? same kernel/driver and same usb flash disk? So I guess it's a hardware issue.
-Bryan
QuoteReplyEditDelete
2009-02-03 02:32:26 Re: BF527 USB OTG problems
Bill Xie (CHINA)
Message: 68698
Hi Bryan,
BF527 usb host is ok with uClinux using the third party,but it have many problems.USB host isn't work with uClinux-dist-2008RC1.5-RC3.The Hardware is the same board.
Bill
QuoteReplyEditDelete
2009-02-03 10:37:57 Re: BF527 USB OTG problems
Kevin Dimmer (UNITED KINGDOM)
Message: 68776
Hi Bryan
Thanks for the feedback
I have re-run the test with extra debug turned on, as you requested.
I have also found a Liteon DVD Drive with its own power supply and tested connecting that as well, which seems to behave slightly differently.
I have attached to 2 complete (rather lengthy) log files (hopefully).
To answer your other questions, unfortunately we don't have a EZKIT-BF527 to test this kernel build.
The USB OTG port design is copied from the EZKIT-527 reference design apart from the power control chip which is a dual swich type (part no .MIC2026-2).
We have tested with 2 different boards and they both behave the same.
I have the hardware guys looking at this as well, but they haven't found anything obviously wrong yet.
Thanks
Kevin
Kingston stick and cable.txt
Liteon DVD RW.txt
QuoteReplyEditDelete
2009-02-03 15:01:10 Re: BF527 USB OTG problems
Kevin Dimmer (UNITED KINGDOM)
Message: 68800
Hi Bryan
We seem to have found the problem.
I wasn't quite right when I said we had copied the reference design, we had actually changed the xtal frequecny from 24Mhz on the reference design to 12Mhz on our board.
I adjust the USB_MSEL value in USB_PLLOSC_CTRL from 0x30a8 to 0x30D0 and can now mount the stick ok.
We still seem to be having some issues with the board not detecting when a stick is inserted or removed, have I missed something in the configuration?
Also if i can ask one other question, as I said earlier we have 2 USB ports on this board one is ISP1760 based and will always be a host port can we configure the OTG port to be a peripheral only and work alongside this.
Also in another board build configuration the ISP1760 will be not fitted so I would like to configure the OTG to be HOST and peripheral, can the software cope will having all the drivers loaded and detecting which it is simply by detecting what has been plugged in?
Thanks
Kevin.
QuoteReplyEditDelete
2009-02-04 04:25:08 Re: BF527 USB OTG problems
Bryan Wu (CHINA)
Message: 68843
Hi Kevin
> We still seem to be having some issues with the board not detecting when a stick is inserted or removed, have I missed something in the configuration?
There is no specific configuration to enable stick hotplug in USB driver. And our driver should support stick hotplug, cause there is a software timer thread is polling since we lack hardware insert IRQ.
>Also if i can ask one other question, as I said earlier we have 2 USB ports on this board one is ISP1760 based and will always be a host port can we configure the OTG port to be a peripheral only and work alongside this.
Do you mean you want to set ISP1760 as host and Blackfin USB as peripheral? Yes, you can do that.
>Also in another board build configuration the ISP1760 will be not fitted so I would like to configure the OTG to be HOST and peripheral, can the software cope will having all the drivers loaded and detecting which it is simply by detecting what has been plugged in?
Currently, it can not be automatically detected by software, cause our USB controller does not support ID change IRQ. You need to load modules according to your hardward cable connection.
-Bryan
QuoteReplyEditDelete
2009-02-05 15:05:19 Re: BF527 USB OTG problems
Kevin Dimmer (UNITED KINGDOM)
Message: 68937
Hi Bryan
Once again thanks for the feedback.
I am a little unclear about a couple of the points you made though.
You say "our driver should support stick hotplug, cause there is a software timer thread is polling since we lack hardware insert IRQ."
But we notice that there are 'Connect Indicator' and 'Disconnect Indicator' interrupts in the USB_INTRUSB register but these appear to be masked when the driver is running.
Also you said "Currently, it can not be automatically detected by software, cause our USB controller does not support ID change IRQ."
But there seems to be a couple of bits in the same register that would indicate if an A or B device are connected.
So my question now is, does the driver simply not support these interrupts, maybe because it would be difficult to integrate into the rest of the USB stack, or are there problems with the blackfin implementation in hardware that make them unreliable or un-usable?
Assuming the hardware is ok, are there any plans to upgrade the USB stack to support dynamic OTG switching from host to peripheral modes without our application needing to swap modules around on-the-fly?
And finally!! you said "You need to load modules according to your hardward cable connection."
Can you give me any clues as to how we might detect the cable connection and which modules we would need to change.
Thanks again.
Kevin