板子CPU:s3c2416
linux:2.6.21
目前正在调板子的USB DEVICE驱动,现在板子加载驱动模块g_file_storage.ko成功,在加载驱动后PC也可检测到设备,但是无法识别,请问有没有同学调过这方面的,
加一个stall=0试试?
就要看下面udc的驱动有没有正常工作了?能加一些debug信息检查一下。
以下为使用抓包软件bus hound在PC上抓取到的插入板子时的数据交互过程:
21.0 URB 50 00 08 00 00 00 00 00 CONTROL TRANSFER 5us 3.3.0 2013-07-17 14:52:16.004
21 IRP 06 00 90 01 00 00 00 00 10us 3.4.0 2013-07-17 14:52:16.004
21.0 CTL 23 01 10 00 03 00 00 00 CLEAR FEATURE 13us 4.1.0 2013-07-17 14:52:16.004 usbhub
21.0 URB 50 00 08 00 00 00 00 00 CONTROL TRANSFER 228us 4.2.0 2013-07-17 14:52:16.004
21 IRP 06 00 90 01 00 00 00 00 3us 4.3.0 2013-07-17 14:52:16.004
21.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 58us 5.1.0 2013-07-17 14:52:16.004 usbhub
21.0 4 IN 00 01 00 00 .... 304us 5.2.0 2013-07-17 14:52:16.004
21.0 URB 50 00 08 00 00 00 00 00 CONTROL TRANSFER 3us 5.3.0 2013-07-17 14:52:16.004
21 IRP 06 00 90 01 00 00 00 00 1us 5.4.0 2013-07-17 14:52:16.004
21.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 35us 6.1.0 2013-07-17 14:52:16.004 usbhub
21.0 4 IN 00 01 00 00 .... 237us 6.2.0 2013-07-17 14:52:16.004
21.0 URB 50 00 08 00 00 00 00 00 CONTROL TRANSFER 11us 6.3.0 2013-07-17 14:52:16.004
21 IRP 06 00 90 01 00 00 00 00 1us 6.4.0 2013-07-17 14:52:16.004
21.0 CTL a3 00 00 00 03 00 04 00 GET STATUS 35us 7.1.0(2) 2013-07-17 14:52:16.004 usbhub
21.0 4 IN 01 01 00 00 .... 172us 7.2.0 2013-07-17 14:52:16.004
21.0 URB 50 00 08 00 00 00 00 00 CONTROL TRANSFER 4us 7.3.0 2013-07-17 14:52:16.004
21 IRP 06 00 90 01 00 00 00 00 9us 7.4.0 2013-07-17 14:52:16.004
21.0 CTL 23 03 04 00 03 00 00 00 SET FEATURE 115ms 9.1.0 2013-07-17 14:52:16.128 usbhub
21.0 URB 50 00 08 00 00 00 00 00 CONTROL TRANSFER 204us 9.2.0 2013-07-17 14:52:16.128
21 IRP 06 00 90 01 00 00 00 00 3us 9.3.0 2013-07-17 14:52:16.128
21.1 1 IN 08 . 14ms 10.1.0 2013-07-17 14:52:16.144 usbhub
21.1 URB 48 00 09 00 00 00 00 00 BULK/INT XFER 5us 10.2.0 2013-07-17 14:52:16.144
21 IRP 06 00 00 01 00 00 00 00 1us 10.3.0 2013-07-17 14:52:16.144
麻烦高手帮忙分析下。
看是总线问题还是设备问题
目前排查到在/driver/usb/gadget/s3c-udc-hs.c中函数reconfig_usbd.c中有问题,该函数主要完成USB寄存器配置,原函数中使用__raw_writel完成寄存器配置,但加载驱动时会报段错误,将该函数置为空就可加载。排查发现时对寄存器操作应使用虚拟地址,原来使用物理地址,因此我使用ioremap结合iowrite32进行配置,或者ioremap结合__raw_writel操作,但仍然报段错误,无论对哪个寄存器操作,请问这怎么回事.
我的操作如下:
volatile unsigned long phys;
volatile unsigned long virt;
phys=0x49800000;
virt=(unsigned long)ioremap(phys,0x10);
//__raw_writel(0x04,*(unsigned long *)(virt+0x14));
iowrite32(0x04,*(unsigned long *)(virt+0x14));
iowrite32(0x07,*(unsigned long *)(virt+0x08));
是驱动中udc设置问题。