Chinaunix首页 | 论坛 | 博客
  • 博客访问: 203384
  • 博文数量: 18
  • 博客积分: 276
  • 博客等级: 二等列兵
  • 技术积分: 298
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-24 19:55
个人简介

我们必须了解自己的渺小,如果我们不学习,科技的发展速度会让我们所有的一切在五年后被清空。所以,我们必须用初学者谦虚的自觉,饥饿者渴望的求知态度来拥抱未来的知识。

文章分类

全部博文(18)

文章存档

2014年(3)

2013年(4)

2012年(11)

分类: LINUX

2014-08-07 16:47:00

内核里已经做好了很完善的USB Host驱动了,可以支持大多数USB设备(如U盘,USB键盘鼠标等),同时也支持USB HUB。

在mach-xc2440.c中添加USB Host驱动的支持:

xc2440_devices[ ]结构体中加入:
&s3c_device_ohci,

s3c_device_ohci结构体的实现文件为/arch/arm/plat-samsung/dev-usb.c,系统默认没有对它的编译支持,修改同目录下的Kconfig文件:
  1. config S3C_DEV_USB_HOST
  2.     bool
  3.     default y
  4.     help
  5.         Compile in platform device definition for USB host.
或修改arch/arm/mach-s3c2440/Kconfig文件:
  1. config MACH_XC2440
  2.     bool "XC2440 development board with S3C2440 CPU module"
  3.     select CPU_S3C2440
  4.     select S3C_DEV_NAND
  5.     select S3C_DEV_USB_HOST
  6.     help
  7.         Say Y here if you are using the XC2440 development board.

配置内核,支持USB Host:
  1. Device drivers --->
  2.     SCSI Device support --->
  3.         <*> SCSI device support
  4. <*> SCSI disk support
  5.     [*] HID Devices --->
  6. -*- Generic HID support
  7. <*> USB Human Interface Device (full HID) support
  8.     [*] USB support --->
  9. {*} Support for Host-side USB
  10. [*] USB announce new devices
  11. [*] USB device filesystem
  12. <*> OHCI HCD support
  13. <*> USB Mass Storage support

USB Human Interface Device (full HID) support 是对USB鼠标键盘的支持
SCSI disk support 和USB Mass Storage support 是对U盘的支持

系统启动时的调试信息:
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: S3C24XX OHCI
usb usb1: Manufacturer: Linux 2.6.37.4 ohci_hcd
阅读(1335) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~