linux2.6.37.4内核在XC2440开发板上移植(八)USB HOST驱动移植

时间:2023-01-20 16:15:39
内核里已经做好了很完善的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

原创地址:http://blog.chinaunix.net/uid-22030783-id-3028206.html