打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
mini2440内核编译的USB问题,出现usb 1-1: device descriptor read/64的解决方法
插入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

无论如何配置内核都无法解决,后发现是UPLLCON的问题,找到的解决办法:
方法一:已验证

经过搜索得知,是UPLLCON没有设置好。根本问题在uboot。但是可以修改内核来弥补。

在drivers/usb/host/ohci-s3c2410.c 的函数 s3c2410_start_hc修改如下:

添加头文件:
#include <mach/regs-clock.h>

drivers/usb/host/ohci-s3c2410.cstatic void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)
{
	struct s3c2410_hcd_info *info = dev->dev.platform_data;
	unsigned long upllvalue  = (0x38<< 12) | (0x02 << 4) | (0x01); // 添加的代码
	unsigned long upllvalue1 = (0x38<< 12) | (0x02 << 4) | (0x02); // 添加的代码	
	dev_dbg(&dev->dev, "s3c2410_start_hc:\n");
	__raw_writel(upllvalue, S3C2410_UPLLCON);  // 添加的代码
	mdelay(20);				// 添加的代码
	__raw_writel(upllvalue1, S3C2410_UPLLCON);// 添加的代码
	mdelay(20);				// 添加的代码
	clk_enable(usb_clk);
	mdelay(2);			/* let the bus clock stabilise */
	clk_enable(clk);
	if (info != NULL) {
		info->hcd	= hcd;
		info->report_oc = s3c2410_hcd_oc;
		if (info->enable_oc != NULL) {			(info->enable_oc)(info, 1);		}	}}

重新编译内核,然后在uboot中用新内核启动即可:

#nfs 30000000 192.168.1.131:/nfs/busybox/fs_mini2440/uImage_XXX 

#bootm 30000000

参考:http://download.csdn.net/detail/wenxiaohua_113/4313893#comment


方法二:
修改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。


方法三:

在网上查了下说是UPLLCON赋值的问题。

 

试了些办法,最终延长了MPLLCON寄存器赋值和UPLLCON寄存器赋值之间延迟后解决了错误。

 

具体修改了以下代码:
vi uboot1.1.4/board/fl2440/fl2440.c


修改board_init函数以下语句:
        clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);

        /* some delay between MPLL and UPLL */
        delay (4000);
        
        /* configure UPLL */
       clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);
将其改为:
        clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);

        /* some delay between MPLL and UPLL */
        delay (4000);

 

        delay (4000);
        
        /* configure UPLL */
        clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);

 

也就是多加一个delay (4000);

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
s3c6410的 usb host问题
USB设备主机侧驱动
USB子系统学习之基础篇三(host controller)
linux usb hub驱动-steven
读linux2.6驱动的一点收获
USB摄像头(中星微ZC301)驱动程序的移植
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服