2009-12-25 03:04:04     questions about usb OTG on BF527 v0.1

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2009-12-25 03:04:04     questions about usb OTG on BF527 v0.1

yacobi chen (CHINA)

Message: 83924   

 

My kernel is 2009R1-RC6 and BF527 is version 0.1.

 

I see the USB OTG controller is either configured as host mode or configured as gadget mode in kernel. However, does it support OTG mode now? I mean the controller can automaticly change its function with different USB cables?

 

Another question is about OTG host controller module. I configure USB controller to host mode as a loadable module in kernel. Module works well when loaded in the first time. however, the kernel will panic when it is loaded in the second time. Debug message is shown as following.

 

 

 

root:/lib/modules/2.6.28.10-ADI-2009R1/kernel/drivers/usb/musb> modprobe musb_hd

rc.ko

[17179593.300000] musb_hdrc: version 6.0, pio, host, debug=0

[17179593.304000] musb_hdrc: kernel must blacklist external hubs

[17179593.316000] musb_hdrc: USB Host mode controller at ffc03800 using PIO, IRQ 59

[17179593.324000] musb_hdrc musb_hdrc.0: MUSB HDRC host driver

[17179593.348000] musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 2

[17179593.360000] usb usb2: configuration #1 chosen from 1 choice

[17179593.376000] hub 2-0:1.0: USB hub found

[17179593.384000] hub 2-0:1.0: 1 port detected

root:/lib/modules/2.6.28.10-ADI-2009R1/kernel/drivers/usb/musb> rmmod musb_hdrc

[17179603.440000] musb_hdrc musb_hdrc.0: remove, state 1

[17179603.444000] usb usb2: USB disconnect, address 1

[17179603.492000] musb_hdrc musb_hdrc.0: USB bus 2 deregistered

[17179603.516000] ------------[ cut here ]------------

[17179603.516000] WARNING: at kernel/irq/manage.c:307 _set_irq_wake+0x98/0xc0()

[17179603.516000] Unbalanced IRQ 59 wake disable

[17179603.516000] Modules linked in: musb_hdrc(-)

[17179603.516000] Hardware Trace:

[17179603.516000]    0 Target : <0x00004b1c> { _dump_stack + 0x0 }

[17179603.516000]      Source : <0x0000f084> { _warn_slowpath + 0x58 } CALL pcrel

[17179603.516000]    1 Target : <0x0000f084> { _warn_slowpath + 0x58 }

[17179603.516000]      Source : <0x000285d2> { _print_modules + 0x7a } RTS

[17179603.516000]    2 Target : <0x000285cc> { _print_modules + 0x74 }

[17179603.516000]      Source : <0x0000f6d2> { _printk + 0x16 } RTS

[17179603.516000]    3 Target : <0x0000f6ce> { _printk + 0x12 }

[17179603.516000]      Source : <0x0000ff34> { _vprintk + 0x12c } RTS

[17179603.516000]    4 Target : <0x0000ff28> { _vprintk + 0x120 }

[17179603.516000]      Source : <0x0000ff1a> { _vprintk + 0x112 } IF !CC JUMP

[17179603.516000]    5 Target : <0x0000ff14> { _vprintk + 0x10c }

[17179603.516000]      Source : <0x00010058> { _vprintk + 0x250 } JUMP.S

[17179603.516000]    6 Target : <0x00010058> { _vprintk + 0x250 }

[17179603.516000]      Source : <0x0000f546> { _wake_up_klogd + 0x1a } RTS

[17179603.516000]    7 Target : <0x0000f52c> { _wake_up_klogd + 0x0 }

[17179603.516000]      Source : <0x0000f94e> { _release_console_sem + 0x1a2 } JUMP.L

[17179603.516000]    8 Target : <0x0000f946> { _release_console_sem + 0x19a }

[17179603.516000]      Source : <0x0000f93a> { _release_console_sem + 0x18e } IF !CC JUMP

[17179603.516000]    9 Target : <0x0000f938> { _release_console_sem + 0x18c }

[17179603.516000]      Source : <0x0000f92a> { _release_console_sem + 0x17e } IF !CC JUMP

[17179603.516000]   10 Target : <0x0000f924> { _release_console_sem + 0x178 }

[17179603.516000]      Source : <0x00021f7c> { _up + 0x38 } RTS

[17179603.516000]   11 Target : <0x00021f76> { _up + 0x32 }

[17179603.516000]      Source : <0x00021f68> { _up + 0x24 } IF !CC JUMP

[17179603.516000]   12 Target : <0x00021f44> { _up + 0x0 }

[17179603.516000]      Source : <0x0000f920> { _release_console_sem + 0x174 } CALL pcrel

[17179603.516000]   13 Target : <0x0000f90c> { _release_console_sem + 0x160 }

[17179603.516000]      Source : <0x0000f7f6> { _release_console_sem + 0x4a } IF !CC JUMP

[17179603.516000]   14 Target : <0x0000f7ce> { _release_console_sem + 0x22 }

[17179603.516000]      Source : <0x0000f8ee> { _release_console_sem + 0x142 } IF !CC JUMP

[17179603.516000]   15 Target : <0x0000f8e8> { _release_console_sem + 0x13c }

[17179603.516000]      Source : <0x0000f49e> { __call_console_drivers + 0x7a } RTS

[17179603.516000] Stack info:

[17179603.516000]  SP: [0x00341ce0] <0x00341ce0> /* kernel dynamic memory */

[17179603.516000]  FP: (0x00341e38)

[17179603.516000]  Memory from 0x00341ce0 to 00342000

[17179603.516000] 00341ce0:[0000f084]<0000f088> 00341d00  0026bf5c  00a4642c  0026bf5c  00000133  00341d00

[17179603.516000] 00341d00: 7465735f  7172695f  6b61775f  78302b65  302f3839  00306378  0037fc4c <0007048e>

[17179603.516000] 00341d20: 031ede7c  002d6b84  002d79b4  00341d40  00341d68 <000700da> 031ede7c  00341d68

[17179603.516000] 00341d40: 03dee5e4  00a46330  00000000  00000001 <000704e8> 031ede94  031ede7c  00341d58

[17179603.516000] 00341d60: 0037fc4c <0007048e> 031ede7c  00a46450 <0007021c> 00344d74  03dee5e4  002bd538

[17179603.516000] 00341d80:<00070224> 00344d74  00000000  00341df4  03dee5e4  00341df4  002c9af8  00341df4

[17179603.516000] 00341da0:<00070460> 00a46330  00000000  00344d74  0037fc4c <001d0d20> 03dee5e4  00000001

[17179603.516000] 00341dc0: 00000000  00341dc4  00341dc4  0037fc4c <0006f044> 000e8f40  00cbe8c4  002d79b4

[17179603.516000] 00341de0: 00341e04 <0002bbd0> 002ccf14  0000ffff  000000ac  00000002  00a46330  00000000

[17179603.516000] 00341e00: 00000001  0000003b <00af816c> 000e8f40  00cbe800  00cbe800  03dee5e4  00afb734

[17179603.516000] 00341e20:<00afb6d8> 002c9af8  00cbe8c4  00cbe800  00000002  00000000 (00000000)<000eaafe>

[17179603.516000] 00341e40: 002c9af8  00afd5cc  002c9ba4  00000068  00000001  00341e64 <000eab9a> 002c9af8

[17179603.516000] 00341e60: 00afd5cc <000ea05c> 00afd624  00afd5cc <000ea062> 00afd624  00afd5cc  00000000

[17179603.516000] 00341e80: ffffe000  0037fc4c <001d0e24> 00000000 <000291d2> 00afd624  00000081  03db1940

[17179603.516000] 00341ea0: 0037fc4c  ffffe000 <00039412> 6273756d  7264685f  00000063  00000000  00000000

[17179603.516000] 00341ec0: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

[17179603.516000] 00341ee0: 00000000  00000000  00afd624  00000880  00341ef4  00000000  ffa007e4  00029078

[17179603.516000] 00341f00: 00000081  00000000  ffffe000  031e8776  031dade0  002b4670  00000002  0000003b

[17179603.516000] 00341f20: 00000002  00b0c494  00008000  00000000  00000000  00342000  00b0c494  00b0c494

[17179603.516000] 00341f40:<00b48bc4> ffa00d38  02003025  002ed7cf  002ee361  002ed7ce  002ee354  00000000

[17179603.516000] 00341f60: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

[17179603.516000] 00341f80: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

[17179603.516000] 00341fa0: 00000000  00000000  00000000  03db1940  0037ffe6  0037fc40  0037fc4c  00359f10

[17179603.516000] 00341fc0: 0037fc64  03db1940  031b2408  00b0c488  00000081  00000880  0000014a  00000002

[17179603.516000] 00341fe0: 0000003b  00000002  0037fc6d  00000880  0037fc64  0037fc64  00000081  00000006

[17179603.516000] Return addresses in stack:

[17179603.516000]     address : <0x0000f084> { _warn_slowpath + 0x58 }

[17179603.516000]     address : <0x0000f088> { _warn_slowpath + 0x5c }

[17179603.516000]     address : <0x0007048e> { _remove_dir + 0x22 }

[17179603.516000]     address : <0x000700da> { _sysfs_addrm_start + 0x3e }

[17179603.516000]     address : <0x000704e8> { _sysfs_remove_dir + 0x50 }

[17179603.516000]     address : <0x0007048e> { _remove_dir + 0x22 }

[17179603.516000]     address : <0x0007021c> { _release_sysfs_dirent + 0x30 }

[17179603.516000]     address : <0x00070224> { _release_sysfs_dirent + 0x38 }

[17179603.516000]     address : <0x00070460> { _sysfs_addrm_finish + 0x1b4 }

[17179603.516000]     address : <0x001d0d20> { _mutex_lock + 0xc }

[17179603.516000]     address : <0x0006f044> { _sysfs_hash_and_remove + 0x34 }

[17179603.516000]     address : <0x0002bbd0> { _set_irq_wake + 0x98 }

[17179603.516000]     address : <0x00af816c> { :musb_hdrc:_otg_state_string + 0x16c }

[17179603.516000]     address : <0x00afb6d8> { :musb_hdrc:_cleanup_module + 0x48 }

[17179603.516000]    frame  1 : <0x000eaafe> { ___device_release_driver + 0x52 }

[17179603.516000]     address : <0x000eab9a> { _driver_detach + 0x72 }

[17179603.516000]     address : <0x000ea05c> { _bus_remove_driver + 0x64 }

[17179603.516000]     address : <0x000ea062> { _bus_remove_driver + 0x6a }

[17179603.516000]     address : <0x001d0e24> { _mutex_lock_interruptible + 0xc }

[17179603.516000]     address : <0x000291d2> { _sys_delete_module + 0x15a }

[17179603.516000]     address : <0x00039412> { _do_munmap + 0xce }

[17179603.516000]     address : <0x00b48bc4> [ /bin/busybox + 0x8bc4 ]

[17179603.516000] ---[ end trace 7fee10984166d205 ]---

root:/lib/modules/2.6.28.10-ADI-2009R1/kernel/drivers/usb/musb> modprobe musb_hd

rc.ko

[17179822.236000] musb_hdrc: version 6.0, pio, host, debug=0

[17179822.240000] musb_hdrc: kernel must blacklist external hubs

[17179822.252000] musb_hdrc: USB Host mode controller at ffc03800 using PIO, IRQ 59

[17179822.256000] musb_hdrc musb_hdrc.0: MUSB HDRC host driver

[17179822.280000] musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 2

[17179822.292000] usb usb2: configuration #1 chosen from 1 choice

[17179822.304000] hub 2-0:1.0: USB hub found

[17179822.316000] hub 2-0:1.0: 1 port detected

root:/lib/modules/2.6.28.10-ADI-2009R1/kernel/drivers/usb/musb> [17179822.492000] Undefined instruction

[17179822.492000]  - May be used to emulate instructions that are not defined for

[17179822.492000]    a particular processor implementation.

[17179822.492000] Kernel OOPS in progress

[17179822.492000] Deferred Exception context

[17179822.492000]

[17179822.492000] No Valid process in current context

[17179822.492000] return address: [0x00af8fec]; contents of:

[17179822.492000] 0x00af8fc0:  b03c  00af  b03c  00af  8fe8  00af  0001  0000

[17179822.492000] 0x00af8fd0:  0000  0000  0000  0000  0000  0000  0001  0000

[17179822.492000] 0x00af8fe0:  0000  0000  0000  0000  0110  0000 [0001] 0000

[17179822.492000] 0x00af8ff0:  b13c  00af  b23c  00af  b13c  00af  b13c  00af

[17179822.492000]

[17179822.492000] ADSP-BF527-0.1 398(MHz CCLK) 132(MHz SCLK) (mpu off)

[17179822.492000] Linux version 2.6.28.10-ADI-2009R1

[17179822.492000] Built with gcc version 4.1.2 (ADI svn)

[17179822.492000]

[17179822.492000] SEQUENCER STATUS:             Tainted: G        W

[17179822.492000]  SEQSTAT: 00000021  IPEND: c030  SYSCFG: 0006

[17179822.492000]   EXCAUSE   : 0x21

[17179822.492000]   interrupts disabled

[17179822.492000]   physical IVG5 asserted : <0xffa00b7c> { _evt_ivhw + 0x0 }

[17179822.492000]   physical IVG14 asserted : <0xffa00988> { _evt14_softirq + 0x0 }

[17179822.492000]   physical IVG15 asserted : <0xffa00cd4> { _evt_system_call + 0x0 }

[17179822.492000]   logical irq   6 mapped  : <0xffa00364> { _timer_interrupt + 0x0 }

[17179822.492000]   logical irq  13 mapped  : <0x000dc2e0> { _bfin_ts035_irq_error + 0x0 }

[17179822.492000]   logical irq  15 mapped  : <0x00162db4> { _err_handler + 0x0 }

[17179822.492000]   logical irq  21 mapped  : <0x0013aefc> { _bfin_rtc_interrupt + 0x0 }

[17179822.492000]   logical irq  23 mapped  : <0x00161b7c> { _rx_handler + 0x0 }

[17179822.492000]   logical irq  24 mapped  : <0x00161b18> { _tx_handler + 0x0 }

[17179822.492000]   logical irq  27 mapped  : <0x0013d1ec> { _bfin_twi_interrupt_entry + 0x0 }

[17179822.492000]   logical irq  31 mapped  : <0x000e7f88> { _bfin_serial_dma_rx_int + 0x0 }

[17179822.492000]   logical irq  32 mapped  : <0x000e81d4> { _bfin_serial_dma_tx_int + 0x0 }

[17179822.492000]   logical irq  37 mapped  : <0x0011d558> { _bf5xx_nand_dma_irq + 0x0 }

[17179822.492000]   logical irq  46 mapped  : <0x000daf90> { _backlight_timer + 0x0 }

[17179822.492000]   logical irq  59 mapped  : <0x03db1194> { :musb_hdrc:_musb_write_fifo + 0x98 }

[17179822.492000]   logical irq  82 mapped  : <0x000d7a70> { _bfin_poweron_irq + 0x0 }

[17179822.492000]   logical irq  87 mapped  : <0x0012211c> { _usb_hcd_irq + 0x0 }

[17179822.492000]   logical irq 101 mapped  : <0x000e4c4c> { _bfin_ads7846_irq + 0x0 }

[17179822.492000]  RETE: <0x00000000> /* Maybe null pointer? */

[17179822.492000]  RETN: <0x002e7e38> /* kernel dynamic memory */

[17179822.492000]  RETX: <0x00000480> /* Maybe fixed code section */

[17179822.492000]  RETS: <0x00016ac8> { _run_timer_softirq + 0xb0 }

[17179822.492000]  PC  : <0x00af8fec> /* kernel dynamic memory */

[17179822.492000] DCPLB_FAULT_ADDR: <0x002e7e34> /* kernel dynamic memory */

[17179822.492000] ICPLB_FAULT_ADDR: <0x00af8fec> /* kernel dynamic memory */

[17179822.492000]

[17179822.492000] PROCESSOR STATE:

[17179822.492000]  R0 : 00cbe8c4    R1 : 0000ffff    R2 : ffffd268    R3 : 00000000

[17179822.492000]  R4 : 0000000a    R5 : 002c951c    R6 : 00000100    R7 : 002e6000

[17179822.492000]  P0 : 00afd754    P1 : 002e7e44    P2 : 002e6000    P3 : 00af8fe4

[17179822.492000]  P4 : 002e7e44    P5 : 002b94f4    FP : 002cb4b8    SP : 002e7d5c

[17179822.492000]  LB0: 000cfeec    LT0: 000cfeea    LC0: 00000000

[17179822.492000]  LB1: 0000d6b6    LT1: 0000d6a0    LC1: 00000000

[17179822.492000]  B0 : 00000000    L0 : 00000000    M0 : 00000000    I0 : 00000000

[17179822.492000]  B1 : 00000000    L1 : 00000000    M1 : 00000000    I1 : ffffffff

[17179822.492000]  B2 : 00000000    L2 : 00000000    M2 : 00000000    I2 : ffffffff

[17179822.492000]  B3 : 00000000    L3 : 00000000    M3 : 00000000    I3 : ffffffff

[17179822.492000] A0.w: 003d08f5   A0.x: 00000000   A1.w: 00000932   A1.x: 00000000

[17179822.492000] USP : 002e8000  ASTAT: 02002000

[17179822.492000]

[17179822.492000] Hardware Trace:

[17179822.492000]    0 Target : <0x00004c24> { _trap_c + 0x0 }

[17179822.492000]      Source : <0xffa00622> { _exception_to_level5 + 0xae } CALL pcrel

[17179822.492000]    1 Target : <0xffa00574> { _exception_to_level5 + 0x0 }

[17179822.492000]      Source : <0xffa00432> { _bfin_return_from_exception + 0x6 } RTX

[17179822.492000]    2 Target : <0xffa0042c> { _bfin_return_from_exception + 0x0 }

[17179822.492000]      Source : <0xffa004cc> { _ex_trap_c + 0x6c } JUMP.S

[17179822.492000]    3 Target : <0xffa00460> { _ex_trap_c + 0x0 }

[17179822.492000]      Source : <0xffa006ae> { _trap + 0x2a } JUMP (P4)

[17179822.492000]    4 Target : <0xffa00684> { _trap + 0x0 }

[17179822.492000]      Source : <0x00af8fea> /* kernel dynamic memory */ 0x0000

[17179822.492000]    5 Target : <0x00af8fe4> /* kernel dynamic memory */

[17179822.492000]      Source : <0x00016ac6> { _run_timer_softirq + 0xae } CALL (P3)

[17179822.492000]    6 Target : <0x00016a9c> { _run_timer_softirq + 0x84 }

[17179822.492000]      Source : <0x00016a7a> { _run_timer_softirq + 0x62 } IF !CC JUMP

[17179822.492000]    7 Target : <0x00016a2c> { _run_timer_softirq + 0x14 }

[17179822.492000]      Source : <0x00021a7e> { _hrtimer_run_pending + 0x82 } RTS

[17179822.492000]    8 Target : <0x00021a72> { _hrtimer_run_pending + 0x76 }

[17179822.492000]      Source : <0x00021a22> { _hrtimer_run_pending + 0x26 } IF !CC JUMP

[17179822.492000]    9 Target : <0x000219fc> { _hrtimer_run_pending + 0x0 }

[17179822.492000]      Source : <0x00016a28> { _run_timer_softirq + 0x10 } CALL pcrel

[17179822.492000]   10 Target : <0x00016a18> { _run_timer_softirq + 0x0 }

[17179822.492000]      Source : <0x000134f8> { ___do_softirq + 0x58 } CALL (P2)

[17179822.492000]   11 Target : <0x000134e4> { ___do_softirq + 0x44 }

[17179822.492000]      Source : <0x000134f0> { ___do_softirq + 0x50 } IF CC JUMP

[17179822.492000]   12 Target : <0x000134ee> { ___do_softirq + 0x4e }

[17179822.492000]      Source : <0x000134e2> { ___do_softirq + 0x42 } JUMP.S

[17179822.492000]   13 Target : <0x000134a0> { ___do_softirq + 0x0 }

[17179822.492000]      Source : <0x000137e0> { _irq_exit + 0x30 } JUMP.L

[17179822.492000]   14 Target : <0x000137e0> { _irq_exit + 0x30 }

[17179822.492000]      Source : <0x000137dc> { _irq_exit + 0x2c } IF !CC JUMP

[17179822.492000]   15 Target : <0x000137b0> { _irq_exit + 0x0 }

[17179822.492000]      Source : <0xffa002ee> { _asm_do_IRQ + 0x66 } CALL pcrel

[17179822.492000]

[17179822.492000] Kernel Stack

[17179822.492000] Stack info:

[17179822.492000]  SP: [0x002e7f54] <0x002e7f54> /* kernel dynamic memory */

[17179822.492000]  Memory from 0x002e7f50 to 002e8000

[17179822.492000] 002e7f50: 00000000 [00000000] 00000000  003a1940  00000003  002e8000  002c951c  ffa00250

[17179822.492000] 002e7f70: 002e6000  002af8a4  002c951c  002e6000  ffa008a8  002af004  00000000  00000000

[17179822.492000] 002e7f90: 00000000  00000001  00000001  0000ffff  0000ffff  0000ffff  ffa008a8  00000006

[17179822.492000] 002e7fb0: 002af004  00000000  00000000  002e86d6  002bbd64  003030f4  002af010  002af004

[17179822.492000] 002e7fd0: 00000000  003030f4  002ade78  0000004a  002e80a8  00305b44  002e8000  002f5a74

[17179822.492000] 002e7ff0: 00000000  00000000  00000000  ffb00000

[17179822.492000] Return addresses in stack:

[17179822.492000] Modules linked in: musb_hdrc [last unloaded: musb_hdrc]

[17179822.492000] Kernel panic - not syncing: Kernel exception

QuoteReplyEditDelete

 

 

2009-12-25 03:20:42     Re: questions about usb OTG on BF527 v0.1

Sonic Zhang (CHINA)

Message: 83939   

 

No. OTG is not suppported in 2009R1. We are working on it in SVN trunk kernel.

QuoteReplyEditDelete

 

 

2009-12-25 03:37:40     Re: questions about usb OTG on BF527 v0.1

yacobi chen (CHINA)

Message: 83940   

 

Hi Sonic,

 

Thanks for your replying.

 

do you have any idea about my second question?

QuoteReplyEditDelete

 

 

2010-01-03 22:34:32     Re: questions about usb OTG on BF527 v0.1

Cliff Cai (CHINA)

Message: 84149   

 

1.Cable based role switching is supported in svn head now.See:

 

https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:musb#usb_otg_support

 

2.Could you please post your kernel config file here?

 

Cliff

Attachments

    Outcomes