插入USB设备,如U盘,读卡器等时出现:
[root@Nision=W]#usb 1-1: new full speed USB device usings3c2410-ohci and address 2
usb 1-1: device descriptor read/64, error -62
usb 1-1: device descriptor read/64, error -62
usb 1-1: new full speed USB device using s3c2410-ohci andaddress 3
usb 1-1: device descriptor read/64, error -62
usb 1-1: device descriptor read/64, error -62
usb 1-1: new full speed USB device using s3c2410-ohci andaddress 4
usb 1-1: device not accepting address 4, error -62
usb 1-1: new full speed USB device using s3c2410-ohci andaddress 5
usb 1-1: device not accepting address 5, error -62
hub 1-0:1.0: unable to enumerate USB device on port 1
最后一句的意思是,设备枚举失败,error -62的意思时超时错误。从这里可以看出,系统应该是识别到了USB设备,但是设备却无法工作,而且可以断定是USB主机控制器的错误。的确如此,百度一下,网上说这是时钟错误,也就是USB是时钟没有起来,对于2440,USB时钟需要工作在48M。修改内核源码:
无论如何配置内核都无法解决,后发现是UPLLCON的问题,找到的解决办法:
修改drivers/usb/host/ohci-s3c2410.c
添加头文件:
#include<mach/regs-clock.h>
在函数s3c2410_start_hc中添加:
unsigned long upllvalue = (0x78<< 12) | (0x02<< 4) | (0x03);
while (upllvalue != __raw_readl(S3C2410_UPLLCON)) {
__raw_writel(upllvalue, S3C2410_UPLLCON);
mdelay(1);
}
在这里,S3C2410_UPLLCON的值为0xF4100008。