|  | 
 
| s3c2410的usb host不稳定的解决方法 h_falls 所做的工作,表示感谢!
 
 今天花了一些时间研究, 觉得可能是s3c2410芯片本身的问题, 导致启动时无法正确初始化UPLLCON寄存器,使之给USB输出48.00MHz的时钟频率, 于是我修改了下driver/usb/usb.c的代码:
 /*************************/
 --- drivers/usb/usb.c 2004-07-27 16:59:28.000000000 +0800
 +++ ../kerne-1version/drivers/usb/usb.c 2004-07-03 15:15:32.000000000 +0800
 @@ -38,13 +38,6 @@
 #endif
 #include <linux/usb.h>
 
 -#include <asm/hardware.h>
 -#include <asm/irq.h>
 -#include <asm/io.h>
 -#include <asm/pci.h>
 -#define OHCI_HW_DRIVER 1
 -#include "usb-ohci.h"
 -
 static const int usb_bandwidth_option =
 #ifdef CONFIG_USB_BANDWIDTH
 1;
 @@ -2268,15 +2261,6 @@
 dev->epmaxpacketout[0] = 8;
 
 err = usb_set_address(dev);
 - if( err < 0 )
 - {
 - CLKCON &= ~CLKCON_USBH;
 - UPLLCON = FInsrt(0x78, fPLL_MDIV) | FInsrt(0x02, fPLL_PDIV) | FInsrt(0x03, fPLL_SDIV);
 - CLKCON |= CLKCON_USBH;
 - err = usb_set_address(dev);
 - printk("first usb_set_address error\n");
 -
 - }
 if (err < 0) {
 err("USB device not accepting new address=%d (error=%d)",
 dev->devnum, err);
 
 
 /************************/
 使得再usb_set_address失败的时候,再设置一次UPLLCON,这样就不会有问题了, 另外我的driver/usb/usb-ohci-s3c2410.c用的是mizi.com上的2.4.19版本.
 
 dmesg内容如下:
 hub.c: 2 ports detected
 hub.c: USB new device connect on bus1/1, assigned device number 2
 first usb_set_address error ---- 这句话表明重新设置UPLLCON了
 usb.c: USB device 2 (vend/prod 0xdd8/0x3) is not claimed by any active driver.
 Initializing USB Mass Storage driver...
 usb.c: registered new driver usb-storage
 scsi0 : SCSI emulation for USB Mass Storage devices
 Vendor: Model: Rev:
 Type: Direct-Access ANSI SCSI revision: 02
 Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
 
 可以看见, u盘被正确地找到了. 如果有人有更好的方法请指出,谢谢.
 | 
 |