这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » USB驱动移植

共3条 1/1 1 跳转至

USB驱动移植

专家
2009-03-24 16:49:18     打赏

USB驱动移植
1   在arch/arm/mach-s3c2410/mach-smdk2410.c中紧接着LCD的部分添加
//usb
#include <asm/arch/usb-control.h>
#include <asm/arch/regs-clock.h>
#include <linux/device.h>
#include <linux/delay.h>
//-------------------usb两个USBHOST支持---------------
struct s3c2410_hcd_info usb_s3c2410_info = {
 .port[0] = {
  .flags = S3C_HCDFLG_USED
 }
};

int smdk2410_usb_init(void)
{
 unsigned long upllvalue = (0x78 << 12) | (0x02 <<4) |(0x03);
 printk("USB Control, (c) 2006 s3c2410\n");
 s3c_device_usb.dev.platform_data = &usb_s3c2410_info;
 while(upllvalue!=__raw_readl(S3C2410_UPLLCON))
 {
  __raw_writel(upllvalue,S3C2410_UPLLCON);
  mdelay(1);
 }
 return 0;
}
2   在smdk2410_map_io函数最后添加
 //usb
 smdk2410_usb_init();
------------配置USB鼠标键盘----------
Device Drivers >
       USB support  ---> 
            <*> Support for Host-side USB
            <*> OHCI HCD support
--- USB Input Devices
<*> USB Human Interface Devices (full HID) support
[*] HID input layer support
------------配置U盘支持------------------------
因为要优盘用到了SCSI 命令,所以我们先增加SCSI 支持。
Device Drivers >
       SCSI device support  ---> 
            [*] legacy /proc/scsi support
   <*> SCSI disk support
   [*]   SCSI generic support
Device Drivers >
        USB support  --->
    [*] Support for Host-side USB 
    <*> USB Mass Storage support
                [*]     USB Mass Storage verbose debug
  Block devices --->
    <*> Low Performance USB Block driver
    
-------------让内核支持热插拔 -----------
│ General setup --->
│ │ Support for hot-pluggable devices  
│ Device Drivers --->
│   Generic Driver Options --->
│   <*> Hotplug firmware loading support  
-----------MSDOS fs和VFAT fs--------------
│ │ File systems --->
│ │ DOS/FAT/NT Filesystems --->
│ │    <*> MSDOS fs support │ │
│ │    <*> VFAT (Windows-95) fs support │ │
│ │    (936) Default codepage for FAT │ │
│ │    (cp936) Default iocharset for FAT │ │
│ │    < > NTFS file system support
│ │Partition Types --->
│ │    PC BIOS (MSDOS partition tables) support
没有加上这个就出现下面这个提示了...
[root@Qiu /]# mount -t vfat /dev/scsi/host0/bus0/target0/lun0/disc /mnt
mount: mounting /dev/scsi/host0/bus0/target0/lun0/disc on /mnt failed: No such device
还有下面这个提示... 
[root@Qiu /]# mount -t vfat /dev/scsi/host0/bus0/target0/lun0/disc /mnt
FAT: codepage cp936 not found
mount: mounting /dev/scsi/host0/bus0/target0/lun0/disc on /mnt failed: Invalid argument
-----------加入中文字体库---------------------
│ │ Native Language Support --->
│ │   <*> Simplified Chinese charset (CP936, GB2312)
│ │   <*> NLS UTF8
最后加载提示:
[root@Qiu /]# usb 1-1: new full speed USB device using s3c2410-ohci and address 3
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor:           Model:                   Rev:    
  Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sdb: 483041 512-byte hdwr sectors (247 MB)
sdb: Write Protect is off
sdb: assuming drive cache: write through
SCSI device sdb: 483041 512-byte hdwr sectors (247 MB)
sdb: Write Protect is off
sdb: assuming drive cache: write through
 /dev/scsi/host1/bus0/target0/lun0:<7>usb-storage: queuecommand called
 unknown partition table
Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi1, channel 0, id 0, lun 0,  type 0
挂载上后:(刚插上拔下一次变成host1)
[root@Qiu /]# mount -t vfat /dev/scsi/host1/bus0/target0/lun0/disc /mnt
[root@Qiu /]# cd mnt
[root@Qiu /mnt]# ls
9600gso.jpg                Linux命令大全(修改版).chm


queuecommand called unknown partition table这个提示没搞定...能挂上就先用着了 ....
哪位高手知道帮忙下哦,谢谢。

点击看大图




关键词: 驱动     移植     support    

菜鸟
2009-04-11 16:09:47     打赏
2楼
国产IGBT批量供货
----------------
比亚迪功率模块1单元和2单元的1200V的:50A、75A、100A、150A、200A现已接受批量订货。
需要技术参数的可以联系我一以下资料。
-------------------------------
〓〓〓利玛电子---授权代理商〓〓〓
联系人:罗 先生
手机:137-1457-2551
Tel:0755-8250 8350
QQ:107521149
MSN:luoziqiang@hotmail.com
E-mail:lima168@21cn.com
Website :www.limaworld.com
Add:深圳市福田區南光捷佳大廈6楼
-------------------------------

工程师
2009-04-25 23:29:52     打赏
3楼

禁止广告


共3条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]