linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Nokia N900: musb is in wrong state after boot
@ 2016-01-09 15:16 Pali Rohár
  2016-01-19 20:33 ` Tony Lindgren
  0 siblings, 1 reply; 41+ messages in thread
From: Pali Rohár @ 2016-01-09 15:16 UTC (permalink / raw)
  To: Tony Lindgren, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel, linux-omap, Ivaylo Dimitrov, Sebastian Reichel,
	Aaro Koskinen, Pavel Machek, Nishanth Menon


[-- Attachment #1.1: Type: text/plain, Size: 1213 bytes --]

Hello,

when I boot 4.4.0-rc7+ kernel compiled with g_nokia into zImage on Nokia 
N900 into userspace then usb gadget (g_nokia) does not work. Notebook, 
connected on other side does not see any usb device... Connecting and 
disconnecting cable does not change anything, still not work.

But if I run this command
$ echo peripheral > /sys/bus/platform/devices/musb-hdrc.0.auto/mode 

then gadget starts working. Other side see usb device and can use it. 
Also connecting and disconnecting usb cable working fine. After 
connecting it again, usb device OK.

So it looks like musb is in some wrong state after boot if above command 
is not called.

Any idea where is problem? In attachment is output from more musb sysfs 
entries (before and after calling that command) which I think could be 
useful. If you want to see more logs, let me know what.

Note that host mode on Nokia N900 does not work because of HW design. 
For 2.6.28 Nokia's kernel there are special and ugly (!) patches which 
enable host mode together with userspace interaction. So it does not 
make sense to have other than peripheral mode enabled by default on 
Nokia N900...

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #1.2: musb_log --]
[-- Type: text/plain, Size: 5794 bytes --]

Nokia-N900:~# grep "" /sys/bus/platform/devices/musb-hdrc.0.auto/*
/sys/bus/platform/devices/musb-hdrc.0.auto/driver_override:(null)
/sys/bus/platform/devices/musb-hdrc.0.auto/modalias:platform:musb-hdrc
/sys/bus/platform/devices/musb-hdrc.0.auto/mode:b_idle
/sys/bus/platform/devices/musb-hdrc.0.auto/uevent:DRIVER=musb-hdrc
/sys/bus/platform/devices/musb-hdrc.0.auto/uevent:MODALIAS=platform:musb-hdrc
/sys/bus/platform/devices/musb-hdrc.0.auto/vbus:Vbus on, timeout 1100 msec
Nokia-N900:~# grep "" /sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/*
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/a_alt_hnp_support:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/a_hnp_support:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/b_hnp_enable:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/current_speed:UNKNOWN
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/is_a_peripheral:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/is_otg:1
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/is_selfpowered:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/maximum_speed:high-speed
grep: /sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/soft_connect: Permission denied
grep: /sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/srp: Permission denied
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/state:not attached
Nokia-N900:~# cat /sys/kernel/debug/musb-hdrc.0.auto/regdump
MUSB (M)HDRC Register Dump
FAddr       : 00
Power       : a0
Frame       : 0000
Index       : 00
Testmode    : 00
TxMaxPp     : a000
TxCSRp      : 0000
RxMaxPp     : 0000
RxCSR       : ffff
RxCount     : fffe
IntrRxE     : fffe
IntrTxE     : ffff
IntrUsbE    : f7
DevCtl      : 98
VControl    : 00000000
HWVers      : 0000
LinkInfo    : 5c
VPLen       : 3c
HS_EOF1     : 80
FS_EOF1     : 77
LS_EOF1     : 72
SOFT_RST    : 00
DMA_CNTLch0 : 0000
DMA_ADDRch0 : 00000000
DMA_COUNTch0: 00000000
DMA_CNTLch1 : 0000
DMA_ADDRch1 : 00000000
DMA_COUNTch1: 00000000
DMA_CNTLch2 : 0000
DMA_ADDRch2 : 00000000
DMA_COUNTch2: 00000000
DMA_CNTLch3 : 0000
DMA_ADDRch3 : 00000000
DMA_COUNTch3: 00000000
DMA_CNTLch4 : 0000
DMA_ADDRch4 : 00000000
DMA_COUNTch4: 00000000
DMA_CNTLch5 : 0000
DMA_ADDRch5 : 00000000
DMA_COUNTch5: 00000000
DMA_CNTLch6 : 0000
DMA_ADDRch6 : 00000000
DMA_COUNTch6: 00000000
DMA_CNTLch7 : 0000
DMA_ADDRch7 : 00000000
DMA_COUNTch7: 00000000
ConfigData  : 00
BabbleCtl   : 00
TxFIFOsz    : 00
RxFIFOsz    : 00
TxFIFOadd   : 0000
RxFIFOadd   : 0000
EPInfo      : ff
RAMInfo     : 8c
Nokia-N900:~# cat /sys/kernel/debug/musb-hdrc.0.auto/softconnect
-1
Nokia-N900:~# cat /sys/kernel/debug/musb-hdrc.0.auto/testmode
Nokia-N900:~# 
Nokia-N900:~# 
Nokia-N900:~# echo peripheral > /sys/bus/platform/devices/musb-hdrc.0.auto/mode
Nokia-N900:~# 
Nokia-N900:~# 
Nokia-N900:~# 
Nokia-N900:~# grep "" /sys/bus/platform/devices/musb-hdrc.0.auto/*
/sys/bus/platform/devices/musb-hdrc.0.auto/driver_override:(null)
/sys/bus/platform/devices/musb-hdrc.0.auto/modalias:platform:musb-hdrc
/sys/bus/platform/devices/musb-hdrc.0.auto/mode:b_peripheral
/sys/bus/platform/devices/musb-hdrc.0.auto/uevent:DRIVER=musb-hdrc
/sys/bus/platform/devices/musb-hdrc.0.auto/uevent:MODALIAS=platform:musb-hdrc
/sys/bus/platform/devices/musb-hdrc.0.auto/vbus:Vbus on, timeout 1100 msec
Nokia-N900:~# grep "" /sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/*
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/a_alt_hnp_support:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/a_hnp_support:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/b_hnp_enable:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/current_speed:high-speed
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/is_a_peripheral:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/is_otg:1
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/is_selfpowered:0
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/maximum_speed:high-speed
grep: /sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/soft_connect: Permission denied
grep: /sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/srp: Permission denied
/sys/bus/platform/devices/musb-hdrc.0.auto/musb-hdrc.0.auto/state:configured
Nokia-N900:~# cat /sys/kernel/debug/musb-hdrc.0.auto/regdump
MUSB (M)HDRC Register Dump
FAddr       : 1f
Power       : f0
Frame       : 02dd
Index       : 00
Testmode    : 00
TxMaxPp     : f01f
TxCSRp      : 0000
RxMaxPp     : 0000
RxCSR       : ffff
RxCount     : fffe
IntrRxE     : fffe
IntrTxE     : ffff
IntrUsbE    : f7
DevCtl      : 99
VControl    : 00000000
HWVers      : 0000
LinkInfo    : 5c
VPLen       : 3c
HS_EOF1     : 80
FS_EOF1     : 77
LS_EOF1     : 72
SOFT_RST    : 00
DMA_CNTLch0 : 0000
DMA_ADDRch0 : 00000000
DMA_COUNTch0: 00000000
DMA_CNTLch1 : 0000
DMA_ADDRch1 : 00000000
DMA_COUNTch1: 00000000
DMA_CNTLch2 : 0000
DMA_ADDRch2 : 00000000
DMA_COUNTch2: 00000000
DMA_CNTLch3 : 0000
DMA_ADDRch3 : 00000000
DMA_COUNTch3: 00000000
DMA_CNTLch4 : 0000
DMA_ADDRch4 : 00000000
DMA_COUNTch4: 00000000
DMA_CNTLch5 : 0000
DMA_ADDRch5 : 00000000
DMA_COUNTch5: 00000000
DMA_CNTLch6 : 0000
DMA_ADDRch6 : 00000000
DMA_COUNTch6: 00000000
DMA_CNTLch7 : 0000
DMA_ADDRch7 : 00000000
DMA_COUNTch7: 00000000
ConfigData  : 00
BabbleCtl   : 00
TxFIFOsz    : 00
RxFIFOsz    : 00
TxFIFOadd   : 0000
RxFIFOadd   : 0000
EPInfo      : ff
RAMInfo     : 8c
Nokia-N900:~# cat /sys/kernel/debug/musb-hdrc.0.auto/softconnect
-1
Nokia-N900:~# cat /sys/kernel/debug/musb-hdrc.0.auto/testmode
Nokia-N900:~# 

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2016-06-10 17:39 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-09 15:16 Nokia N900: musb is in wrong state after boot Pali Rohár
2016-01-19 20:33 ` Tony Lindgren
2016-01-21  8:40   ` Pali Rohár
2016-01-21  9:57     ` Ivaylo Dimitrov
2016-01-21 10:23       ` Pali Rohár
2016-01-21 10:27         ` Ivaylo Dimitrov
2016-01-21 10:29     ` joerg Reisenweber
2016-01-21 17:41       ` Tony Lindgren
2016-01-21 18:44         ` joerg Reisenweber
2016-01-21 19:21           ` Tony Lindgren
2016-01-21 19:34             ` joerg Reisenweber
2016-01-21 20:30               ` Tony Lindgren
2016-01-26 14:34                 ` Pali Rohár
2016-01-26 17:26                   ` Tony Lindgren
2016-02-21 11:12                     ` Pali Rohár
2016-02-22  7:31                       ` Felipe Balbi
2016-02-22  8:34                         ` Pali Rohár
2016-02-22  8:54                           ` Felipe Balbi
2016-02-22  8:54                           ` Felipe Balbi
2016-02-22 15:36                             ` Bin Liu
2016-02-22 15:49                               ` Adam Ford
2016-01-23 12:57             ` Pali Rohár
2016-05-29 10:38               ` Pali Rohár
2016-06-07 12:50                 ` Pali Rohár
2016-06-08  9:53                   ` Tony Lindgren
2016-06-08 10:02                     ` Felipe Balbi
2016-06-08 10:19                       ` Pali Rohár
2016-06-08 10:20                       ` joerg Reisenweber
2016-06-08 12:04                       ` Sergei Shtylyov
2016-06-08 12:18                         ` joerg Reisenweber
2016-06-08 12:32                           ` Sergei Shtylyov
2016-06-09 21:09                       ` Bin Liu
2016-06-09 20:58                 ` Bin Liu
2016-06-09 21:25                   ` joerg Reisenweber
2016-06-10 15:08                     ` Bin Liu
2016-06-10 15:23                       ` joerg Reisenweber
2016-06-10 15:59                         ` Bin Liu
2016-06-10 16:15                           ` joerg Reisenweber
2016-06-10 17:04                             ` Nishanth Menon
2016-06-10 17:21                               ` joerg Reisenweber
2016-06-10 17:37                             ` Bin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).