如题
离线
https://e2e.ti.com/support/processors/f/791/t/405374?OTG-Host-mode-with-AM3352
http://processors.wiki.ti.com/index.php/UsbSoftwareInterface
mount -t debugfs none /sys/kernel/debug
echo "force host" > /sys/kernel/debug/musb-hdrc.0/testmode
echo "force otg" > /sys/kernel/debug/musb-hdrc.0/testmode
虽然同为musb, 然而, 并没有什么卵用
最近编辑记录 cityf (2019-09-16 11:57:15)
离线
找错路径了,是在/sys下的musb-hdrc.0/mode下,写个host就是主口了
离线
请问是这个文件吗: /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
离线
echo "peripheral" > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
echo "host" > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
然而, 一点反应都没有。
无论写什么, 里面都是:
# cat /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
b_idle
最近编辑记录 cityf (2019-09-16 14:30:34)
离线
是这个文件,我记得写为主口应该是wait_a_raise这个状态才对阿,是不是你配置少了什么东西
离线
我的可以哟:
# echo "host" > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
[ 1065.974559] phy phy-1c19400.phy.0: Changing dr_mode to 1
#
# cat /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
a_wait_vrise
#
#
# echo "peripheral" > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
[ 1082.470768] phy phy-1c19400.phy.0: Changing dr_mode to 2
[ 1083.525617] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in b_idle (98, VALID), retry #0, port1 00000100
#
# cat /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
b_idle
#
#
插入USB线后:
# cat /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
b_peripheral
离线
试了一下, 如果执行 echo "peripheral" > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
那么插入/拔出U盘也不会输出以下log:
[ 249.795725] usb 1-1: new high-speed USB device number 3 using ehci-platform
[ 249.988291] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 250.016377] scsi host0: usb-storage 1-1:1.0
[ 251.046803] scsi 0:0:0:0: Direct-Access Mass Storage Device 1.00 PQ: 0 ANSI: 0 CCS
[ 251.182148] sd 0:0:0:0: [sda] 3842048 512-byte logical blocks: (1.97 GB/1.83 GiB)
[ 251.190488] sd 0:0:0:0: [sda] Write Protect is off
[ 251.196730] sd 0:0:0:0: [sda] No Caching mode page found
[ 251.202060] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 251.215272] sda: sda1
[ 251.228960] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 254.229815] usb 1-1: USB disconnect, device number 3
离线
比较了一下, 发现左边的可以, 右边的模块编译不行.
离线
试了一下, 如果执行 echo "peripheral" > /sys/devices/platform/soc/1c19000.usb/musb-hdrc.1.auto/mode
测试可以用,感谢!
离线
收藏,谢谢!
离线