使用sdk8.0,usb1配置为host接口,下边接hub芯片。遇到的问题是,在系统启动之前插U盘可以识别,启动后,拔掉U盘有打印信息,但是再插上就没有反应了。使用fdisk -l命令查看无U盘信息。
背景:同一块板子,使用之前的4.6的sdk一切正常。所以可以排除硬件问题。
能否给个调试思路??
linux启动部分log信息如下:
[2.374847] rtc-pcf8563 2-0051: setting system clock to 2015-03-20 11:18:33 UTC (1426850313) [2.386963] ALSA device list: [2.390099]No soundcards found. [2.572839] usb 2-1: new high-speed USB device number 2 using musb-hdrc [2.653262] kjournald starting. Commit interval 5 seconds [2.666801] EXT3-fs (mmcblk0p2): using internal journal [2.679779] EXT3-fs (mmcblk0p2): recovery complete [2.684925] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode [2.692327] VFS: Mounted root (ext3 filesystem) on device 179:2. [2.702766] devtmpfs: mounted [2.707038] Freeing unused kernel memory: 268K (c07ca000 - c080d000) [2.714160] usb 2-1: New USB device found, idVendor=0424, idProduct=2514 [2.721299] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [2.735521] hub 2-1:1.0: USB hub found [2.740565] hub 2-1:1.0: 4 ports detected INIT: version 2.88 booting [3.022684] usb 2-1.3: new high-speed USB device number 3 using musb-hdrc [3.143382] usb 2-1.3: New USB device found, idVendor=0781, idProduct=5567 [3.150715] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [3.158465] usb 2-1.3: Product: Cruzer Blade [3.162997] usb 2-1.3: Manufacturer: SanDisk [3.167496] usb 2-1.3: SerialNumber: 20044317430CE4D08886 [3.185146] usb-storage 2-1.3:1.0: USB Mass Storage device detected [3.203437] scsi0 : usb-storage 2-1.3:1.0 Starting udev [3.373951] udev[944]: starting version 164 [3.620705] remoteproc0: failed to load am335x-pm-firmware.elf [3.627025] remoteproc0: powering up wkup_m3 [3.631622] remoteproc0: Direct firmware load failed with error -2 [3.638183] remoteproc0: Falling back to user helper [4.204429] scsi 0:0:0:0: Direct-AccessSanDisk Cruzer Blade1.26 PQ: 0 ANSI: 6 [4.314675] sd 0:0:0:0: [sda] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB) [4.328993] sd 0:0:0:0: Attached scsi generic sg0 type 0 [4.389663] sd 0:0:0:0: [sda] Write Protect is off [4.446534] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [4.688173] remoteproc0: request_firmware failed: -2 [4.693608] wkup_m3 44d00000.wkup_m3: rproc_boot failed [4.753132] sda: sda1 [4.895792] sd 0:0:0:0: [sda] Attached SCSI disk [6.459825] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. [6.556499] random: nonblocking pool is initialized [6.668975] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Gary Wu:
重新测试插拔,并使用dmesg | grep USB,把log信息贴上来。
Jinfang Deng:
回复 Gary Wu:
首先感谢您的回复,下面是log信息,第二次dmesg | grep usb 已做过热插拔
root@am335x-evm:~# dmesg | grep usb [0.246882] usbcore: registered new interface driver usbfs [0.247081] usbcore: registered new interface driver hub [0.247283] usbcore: registered new device driver usb [1.204842] usbcore: registered new interface driver asix [1.210757] usbcore: registered new interface driver ax88179_178a [1.217351] usbcore: registered new interface driver cdc_ether [1.223698] usbcore: registered new interface driver smsc95xx [1.229915] usbcore: registered new interface driver net1080 [1.236025] usbcore: registered new interface driver cdc_subset [1.242422] usbcore: registered new interface driver zaurus [1.248501] usbcore: registered new interface driver cdc_ncm [1.295644] usbcore: registered new interface driver cdc_wdm [1.301802] usbcore: registered new interface driver usb-storage [1.310389] of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/usb@47400000/usb-phy@47401300[0]' [1.310459] 47401300.usb-phy supply vcc not found, using dummy regulator [1.320264] musb-hdrc musb-hdrc.0.auto: Failed to request rx1. [1.326590] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517 [1.334804] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral [1.343210] of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/usb@47400000/usb-phy@47401b00[0]' [1.343263] 47401b00.usb-phy supply vcc not found, using dummy regulator [1.352902] musb-hdrc musb-hdrc.1.auto: Failed to request rx1. [1.359199] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with status -517 [1.367397] platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferral [1.484349] usbcore: registered new interface driver usbhid [1.490216] usbhid: USB HID core driver [2.093981] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn) [2.093999] musb-hdrc: MHDRC RTL version 2.0[2.094008] musb-hdrc: setup fifo_mode 4 [2.094025] musb-hdrc: 28/31 max ep, 16384/16384 memory [2.094134] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver [2.100680] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1 [2.109207] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [2.116373] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [2.123981] usb usb1: Product: MUSB HDRC host driver [2.129200] usb usb1: Manufacturer: Linux 3.14.26 musb-hcd [2.134977] usb usb1: SerialNumber: musb-hdrc.0.auto [2.153815] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn) [2.153834] musb-hdrc: MHDRC RTL version 2.0[2.153842] musb-hdrc: setup fifo_mode 4 [2.153858] musb-hdrc: 28/31 max ep, 16384/16384 memory [2.153984] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver [2.160500] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2 [2.168995] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 [2.176161] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [2.183762] usb usb2: Product: MUSB HDRC host driver [2.188983] usb usb2: Manufacturer: Linux 3.14.26 musb-hcd [2.194757] usb usb2: SerialNumber: musb-hdrc.1.auto [2.623602] usb 2-1: new high-speed USB device number 2 using musb-hdrc [2.763701] usb 2-1: New USB device found, idVendor=0424, idProduct=2514 [2.770776] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [3.063598] usb 2-1.3: new high-speed USB device number 3 using musb-hdrc [3.184171] usb 2-1.3: New USB device found, idVendor=0781, idProduct=5567 [3.191429] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [3.199162] usb 2-1.3: Product: Cruzer Blade [3.203707] usb 2-1.3: Manufacturer: SanDisk [3.208215] usb 2-1.3: SerialNumber: 20044317430CE4D08886 [3.216514] usb-storage 2-1.3:1.0: USB Mass Storage device detected [3.224088] scsi0 : usb-storage 2-1.3:1.0 root@am335x-evm:~# df Filesystem1K-blocksUsed Available Use% Mounted on /dev/root737204465583663350689% / devtmpfs11212841121240% /dev tmpfs1245521881243640% /run tmpfs16384328160562% /var/volatile /dev/mmcblk0p1711334697664367% /run/media/mmcblk0p1 /dev/sda178003042143340565696427% /run/media/sda1 root@am335x-evm:~# [71.336305] usb 2-1.3: USB disconnect, device number 3root@am335x-evm:~# dmesg | grep usb [0.246882] usbcore: registered new interface driver usbfs [0.247081] usbcore: registered new interface driver hub [0.247283] usbcore: registered new device driver usb [1.204842] usbcore: registered new interface driver asix [1.210757] usbcore: registered new interface driver ax88179_178a [1.217351] usbcore: registered new interface driver cdc_ether [1.223698] usbcore: registered new interface driver smsc95xx [1.229915] usbcore: registered new interface driver net1080 [1.236025] usbcore: registered new interface driver cdc_subset [1.242422] usbcore: registered new interface driver zaurus [1.248501] usbcore: registered new interface driver cdc_ncm [1.295644] usbcore: registered new interface driver cdc_wdm [1.301802] usbcore: registered new interface driver usb-storage [1.310389] of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/usb@47400000/usb-phy@47401300[0]' [1.310459] 47401300.usb-phy supply vcc not found, using dummy regulator [1.320264] musb-hdrc musb-hdrc.0.auto: Failed to request rx1. [1.326590] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517 [1.334804] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral [1.343210] of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/usb@47400000/usb-phy@47401b00[0]' [1.343263] 47401b00.usb-phy supply vcc not found, using dummy regulator [1.352902] musb-hdrc musb-hdrc.1.auto: Failed to request rx1. [1.359199] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with status -517 [1.367397] platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferral [1.484349] usbcore: registered new interface driver usbhid [1.490216] usbhid: USB HID core driver [2.093981] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn) [2.093999] musb-hdrc: MHDRC RTL version 2.0[2.094008] musb-hdrc: setup fifo_mode 4 [2.094025] musb-hdrc: 28/31 max ep, 16384/16384 memory [2.094134] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver [2.100680] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1 [2.109207] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [2.116373] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [2.123981] usb usb1: Product: MUSB HDRC host driver [2.129200] usb usb1: Manufacturer: Linux 3.14.26 musb-hcd [2.134977] usb usb1: SerialNumber: musb-hdrc.0.auto [2.153815] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn) [2.153834] musb-hdrc: MHDRC RTL version 2.0[2.153842] musb-hdrc: setup fifo_mode 4 [2.153858] musb-hdrc: 28/31 max ep, 16384/16384 memory [2.153984] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver [2.160500] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2 [2.168995] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 [2.176161] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [2.183762] usb usb2: Product: MUSB HDRC host driver [2.188983] usb usb2: Manufacturer: Linux 3.14.26 musb-hcd [2.194757] usb usb2: SerialNumber: musb-hdrc.1.auto [2.623602] usb 2-1: new high-speed USB device number 2 using musb-hdrc [2.763701] usb 2-1: New USB device found, idVendor=0424, idProduct=2514 [2.770776] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [3.063598] usb 2-1.3: new high-speed USB device number 3 using musb-hdrc [3.184171] usb 2-1.3: New USB device found, idVendor=0781, idProduct=5567 [3.191429] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [3.199162] usb 2-1.3: Product: Cruzer Blade [3.203707] usb 2-1.3: Manufacturer: SanDisk [3.208215] usb 2-1.3: SerialNumber: 20044317430CE4D08886 [3.216514] usb-storage 2-1.3:1.0: USB Mass Storage device detected [3.224088] scsi0 : usb-storage 2-1.3:1.0 [71.336305] usb 2-1.3: USB disconnect, device number 3 root@am335x-evm:~#
Jinfang Deng:
回复 Gary Wu:
另外这是我使用的dts,usb相关:
&usb {status = "okay";control@44e10620 {status = "okay";};usb-phy@47401300 {status = "okay";};usb-phy@47401b00 {status = "okay";};usb@47401000 {status = "okay";};usb@47401800 {status = "okay";dr_mode = "host";};dma-controller@47402000{status = "okay";}; };盼复
Jinfang Deng:
回复 Gary Wu:
以下是板子的硬件电路原理图:
其中,DM与DP引脚连接到usbhub芯片端。另外未对usb驱动程序做任何改动。
Steven Liu1:
回复 Jinfang Deng:
这是USB的VBUS是直接连载系统5V供电上面,没有通过drvVBUS来做的吧,是的话有打过这个patch吗?
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c index 13bfef3..e41b224 100644 --- a/arch/arm/mach-omap2/omap_phy_internal.c +++ b/arch/arm/mach-omap2/omap_phy_internal.c @@ -288,8 +288,17 @@ void ti81xx_musb_phy_power(u8 id, u8 on , bool wkup)TI816X_USBPHY0_NORMAL_MODE;usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;} else if (cpu_is_am33xx()) { -usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN); -usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN); +usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN | USBPHY_OTGVDET_EN); + +/* HACK: If USB0 port is in host-only mode, clear its +* USBPHY_OTGVDET_EN bit to ignore first VBUS sensing. +* Change 0 to 1 if USB1 port is in host-only mode. +*/ +if (id == 0) +usbphycfg |= USBPHY_OTGSESSEND_EN; +else +usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN); +usbwkupctrl = AM33XX_USB_WKUP_CTRL_DISABLE;}来源:http://e2e.ti.com/support/arm/sitara_arm/f/791/p/333490/1163908
另外,这个帖子里面也有描述:http://www.deyisupport.com/question_answer/dsp_arm/sitara_arm/f/25/t/47199.aspx
Jinfang Deng:
回复 Steven Liu1:
您好,Steven Liu。sdk8.0中的/arch/arm/mach-omap2/omap_phy_internal.c 文件中与您给的patch包有些出入,具体 void ti81xx_musb_phy_power函数如下:
void ti81xx_musb_phy_power(u8 on) {void __iomem *scm_base = NULL;u32 usbphycfg;scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);if (!scm_base) {pr_err("system control module ioremap failed\n");return;}usbphycfg = __raw_readl(scm_base + USBCTRL0);if (on) {if (cpu_is_ti816x()) {usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;} else if (cpu_is_ti814x()) {usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN| USBPHY_DPINPUT | USBPHY_DMINPUT);usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN| USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);}} else {if (cpu_is_ti816x())usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE;else if (cpu_is_ti814x())usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;}__raw_writel(usbphycfg, scm_base + USBCTRL0);iounmap(scm_base); }想请教您一下有sdk8.0的patch包吗?万分感谢您的回复。
Jinfang Deng:
回复 Steven Liu1:
刚才在官网上找到一个Sitara_Linux_SDK_MUSB_Issues 但是链接打不开。。。也不知是不是这个,能否给往出贴一下。实在是打不开,尝试了好多次,好长时间了。谢谢了。
Jinfang Deng:
回复 Jinfang Deng:
在官网上找到了这个patch,但是我这边一直打不开,已经尝试了很多次,能否麻烦贴出来,万分感谢!!!
Jinfang Deng:
回复 Gary Wu:
万分感谢,我这就试下。好了再回复,再次感谢。