MINI2440 USB驱动移植问题
2012-05-21 12:04
302 查看
在移植USB鼠标驱动的时候发现了如下问题:
(1)开发板参数:
开发板 : MINI2440
内核: linux - 2.6.32
(2) 插入USB鼠标之后出现如下错误:
# usb 1-1: new low speed USB device using s3c2410-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 low speed USB device using s3c2410-ohci and address 3
usb 1-1: device descriptor read/64, error -62
usb 1-1: device descriptor read/64, error -62
usb 1-1: new low speed USB device using s3c2410-ohci and address 4
usb 1-1: device not accepting address 4, error -62
usb 1-1: new low speed USB device using s3c2410-ohci and address 5
usb 1-1: device not accepting address 5, error -62
hub 1-0:1.0: unable to enumerate USB device on port 1
解决方法:
(1)使用Linux - 2.6.29 内核即可
(2)如果要继续使用Linux - 2.6.32 内核可以做如下修改
修改drivers/usb/host/ohci-s3c2410.c
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <plat/usb-control.h>
#define valid_port(idx) ((idx) == 1 || (idx) == 2)
#if 1
#include <mach/regs-clock.h>
unsigned long upllvalue = (0x78 << 12)|(0x02 << 4) | (0x03);
#endif
/* clock device associated with the hcd */
static struct clk *clk;
static struct clk *usb_clk;
/* forward definitions */
static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc);
/* conversion functions */
static struct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd)
{
return hcd->self.controller->platform_data;
}
static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)
{
struct s3c2410_hcd_info *info = dev->dev.platform_data;
dev_dbg(&dev->dev, "s3c2410_start_hc:\n");
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);
}
}
while(upllvalue != __raw_readl(S3C2410_UPLLCON))
{
__raw_writel(upllvalue ,S3C2410_UPLLCON);
mdelay(1);
}
}
加上红色的那两行即可
运行结果
插上USB鼠标后:开发板串口输出如下:
[root@FriendlyARM input]# usb 1-1: new low speed USB device using s3c2410-ohci and address 7
usb 1-1: New USB device found, idVendor=15d9, idProduct=0a4c
usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-1: Product: USB OPTICAL MOUSE
usb 1-1: configuration #1 chosen from 1 choice
usb mouse founded!
拔出:
[root@FriendlyARM input]# usb 1-1: USB disconnect, address 9
usb mouse diconnected!
(1)开发板参数:
开发板 : MINI2440
内核: linux - 2.6.32
(2) 插入USB鼠标之后出现如下错误:
# usb 1-1: new low speed USB device using s3c2410-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 low speed USB device using s3c2410-ohci and address 3
usb 1-1: device descriptor read/64, error -62
usb 1-1: device descriptor read/64, error -62
usb 1-1: new low speed USB device using s3c2410-ohci and address 4
usb 1-1: device not accepting address 4, error -62
usb 1-1: new low speed USB device using s3c2410-ohci and address 5
usb 1-1: device not accepting address 5, error -62
hub 1-0:1.0: unable to enumerate USB device on port 1
解决方法:
(1)使用Linux - 2.6.29 内核即可
(2)如果要继续使用Linux - 2.6.32 内核可以做如下修改
修改drivers/usb/host/ohci-s3c2410.c
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <plat/usb-control.h>
#define valid_port(idx) ((idx) == 1 || (idx) == 2)
#if 1
#include <mach/regs-clock.h>
unsigned long upllvalue = (0x78 << 12)|(0x02 << 4) | (0x03);
#endif
/* clock device associated with the hcd */
static struct clk *clk;
static struct clk *usb_clk;
/* forward definitions */
static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc);
/* conversion functions */
static struct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd)
{
return hcd->self.controller->platform_data;
}
static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)
{
struct s3c2410_hcd_info *info = dev->dev.platform_data;
dev_dbg(&dev->dev, "s3c2410_start_hc:\n");
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);
}
}
while(upllvalue != __raw_readl(S3C2410_UPLLCON))
{
__raw_writel(upllvalue ,S3C2410_UPLLCON);
mdelay(1);
}
}
加上红色的那两行即可
运行结果
插上USB鼠标后:开发板串口输出如下:
[root@FriendlyARM input]# usb 1-1: new low speed USB device using s3c2410-ohci and address 7
usb 1-1: New USB device found, idVendor=15d9, idProduct=0a4c
usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-1: Product: USB OPTICAL MOUSE
usb 1-1: configuration #1 chosen from 1 choice
usb mouse founded!
拔出:
[root@FriendlyARM input]# usb 1-1: USB disconnect, address 9
usb mouse diconnected!
相关文章推荐
- S3C2440 KERNEL2.26.32 USB驱动移植遇到的问题
- mini2440 nand flash驱动移植--问题解决记录
- mini2440 HUAWEI E261 WCDMA 驱动,usbmodeswitch,ppp移植
- mini2440 nand flash驱动移植--问题解决记录
- Linux-2.6.32.2内核在mini2440上的移植(七)---添加ADC驱动
- linux-2.6.32在mini2440开发板上移植 ---W35型LCD驱动移植
- 【引用】Linux-2.6.32.2内核在mini2440上的移植(七)---LCD驱动移植
- 【引用】Linux-2.6.32.2内核在mini2440上的移植(十六)---基于中断的按键驱动移植
- Linux-2.6.32.2内核在mini2440上的移植----LCD驱动移植
- 【笔记】mini2440触摸屏驱动移植(二)
- linux2.6.32.2 mini2440平台移植--移植DM9000网卡驱动
- <十> USB 驱动的移植
- USB-Wifi驱动移植(FS_4412)
- usb驱动自动安装中遇到的问题
- 关于Windows8.1下TQ210开发板USB下载驱动安装问题的解决办法
- mini2440 ADC 驱动的开发、移植与分析
- linux-2.6.32在mini2440开发板上移植(11)之配置USB外设
- 嵌入式Linux 三星s5pv210 USB WIFI驱动的移植
- mini2440 SPI驱动移植 既自己总结的应用层的操作
- cxacru USB ADSL 在2.6.x内核下驱动的问题