USB主控制器,芯片里面自带了得。为了让USB主控制器运行,所有有USB主控制器驱动。
USB核心,内核提供好的USB协议之类的。USB设备驱动是针对插到接口的设备去工作的软件。
主机插得是HOST接口
开发板插的是SLAVE接口
Gadget驱动:让USB设备工作成特殊的状态(网卡,串口等)
2.USB-MassStorage驱动体验
在tq2440-kernel中选择Device Drivers -> USB support ->support for host…->OSCI HCD support(usb1.0的协议)
加载上U盘的驱动->USB Mass Storage support(USB设备驱动)
因为U盘比较特殊,我们还需要配置一些其他信息:General setup --->[*] Configure standard kernel features (for small systems) --->[*] Support for hot-pluggable devices (NEW)
hot-pluggable热插拔
U盘属于块设备、磁盘设备,选择支持块设备选项:Device Drivers --->Block devices ---><*> Low Performance USB Block driver
同时选择SCCI选项:Device Drivers --->SCSI device support ---><*> SCSI device support<*> SCSI disk support<*> SCSI generic support
U盘必须还要有文件系统的支持:File systems --->DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows-95) fs support
(936) Default codepage for FAT
(cp936) Default iocharset for FAT
U盘必须还要有文件系统的支持:File systems --->DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows-95) fs support
(936) Default codepage for FAT
(cp936) Default iocharset for FAT
Partition Types --->
[*] PC BIOS (MSDOS partition tables) support
Native Language Support --->
<*> Simplified Chinese charset (CP936, GB2312)
<*> NLS UTF8
重新编译后,可以把U盘插到开发板中去。
出错了,暂时找不到原因。估计和yaffs文件系统有关系:
3.RNDIS驱动体验
把USB口模拟成网口重新编译后,可以把U盘插到开发板中去。
- mount /dev/uba /mnt/
点击(此处)折叠或打开
- yaffs: dev is 188743680 name is "uba"
- yaffs: passed flags ""
- yaffs: Attempting MTD mount on 180.0, "uba"
- yaffs: dev is 188743680 name is "uba"
- yaffs: passed flags ""
- yaffs: Attempting MTD mount on 180.0, "uba"
- mount: mounting /dev/uba on /mnt failed: Invalid argument
3.RNDIS驱动体验
Device Drivers ->USB support ->USB gadget support(设备控制器驱动)
USB Gadget Drivers
Ethernet Gadget (with CDC Ethernet support)
这只好后需要重新编译内核的模块
- make ARCH=arm CROSS_COMPILE=arm-linux-
- make uImage ARCH=arm CROSS_COMPILE=arm-linux-
- ifconfig usb0 192.168.1.30