Linux-2.6.32.2 kernel porting on mini2440 (10)-configuring USB peripherals

Source: Internet
Author: User

Port Environment (Bold font in redIs the modified content,Blue bold ChineseFor special attention)

1. host environment: centos 5.5 and 1 GB memory in vmare.

2. Integrated Development Environment: Elipse ide

3. compiling environment: Arm-Linux-GCC v4.4.3 and arm-None-Linux-gnueabi-GCC v4.5.1.

4. Development Board: mini2440, 2 m nor flash, 128 m nand Flash.

5, U-boot version: u-boot-2009.08

6, Linux: linux-2.6.32.2

7. References:

Complete embedded Linux application development manual, edited by Wei Dongshan.

Mini2440 Linux porting Development Practice Guide

[1] configure HCI device drivers such as USB keyboard and mouse in the kernel

Linux-2.6.32.2 Kernel support for USB peripherals is quite rich, and has included the S3C2440 USB host driver support, so we just need to configure the kernel can be, the following describes the kernel configurations of various USB peripherals.

Execute make menuconfig in the linux-2.6.32.2 root directory and confirm that the following options are selected

Device Drivers --->

[*] Hid devices --->

<*> USB Human Interface Device (full hid) Support // supports HCI devices such as USB keyboard and mouse

Tip: here the configuration option corresponds to the kernel source code directory is: linux-2.6.32.2/Drivers/HID/usbhid, where the USB keyboard and bar code scanner is the same principle, therefore, their code is the same.

[*]/Dev/hiddev raw HID device support // access the HID device in RAW mode.

After the preceding information is selected, you can view the following startup information on the console:

......

Usbcore: registered new interface driver hiddev
Usbcore: registered new interface driver usbhid
Usbhid: v2.6: USB hid Core Driver

......

Use LCD and USB keyboard as the terminal

Now the kernel has supported LCD and USB keyboard can be used as a console terminal, make sure that according to the previous article Linux-2.6.32.2 Kernel on the mini2440 port (7) --- add "console = tty1" and modify the inittab file in the command line after the LCD driver is transplanted. After the USB keyboard and LCD are connected, you can see the following information on the LCD: "Please
Press enter to activate this console .".

Note that after using a USB keyboard and LCD as an independent input and output device, the serial port control terminal will no longer work. In the development and debugging phase, it will not work well.

[2] configuring the USB flash drive in the kernel

Because the SCSI command is used for the USB flash drive, we first increase the SCSI support.

Device Drivers --->

SCSI device support --->

<*> SCSI Device Support// Select this option to support USB disks.

[*] Legacy/proc/SCSI/support // provide some information in the/proc/SCSI directory.

<*> SCSI disk support // SCSI hard disk. To support USB flash drives, select this option.
[*] USB support --->

<*> Support for host-side USB // USB Host Controller

[*] USB device filesystem (Deprecated) // provides debugging information in the/proc file system

<*> Ohci hcd support // OHCI Host Control driver

<*> USB Mass Storage support // USB storage device

Currently, mobile memory such as USB flash drives are mostly in the fat/FAT32 format. Therefore, we need to add support for the FAT32 File System. Select the following menu items from the main menu of Kernel configuration:

File systems --->

DOS/fat/NT filesystems --->

<*> Msdos FS Support // Add FAT32 File System Support

-*-Native language support ---> // the following code is supported in Chinese and English.

<*> CodePage 437 (United States, Canada)

<*> Simplified Chinese charset (cp936, gb2312)

<*> Traditional Chinese charset (big5)

<*> Nls iso 8859-1 (Latin 1; Western European ages)

NLS UTF-8

After the configuration is complete, exit and save the preceding configuration and re-compile make uimage. Copy the generated uimage to/nfsboot/kernel and restart the Development Board. The following information is displayed:

......

Eth0: dm9000e at c4872300, cda-6304 IRQ 51 Mac: 08: 90: 90: 90: 90: 90 (CHIP)
Ohci_hcd: USB 1.1 'open' host controller (OHCI) Driver
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: configuration #1 chosen from 1 choice
Hub 1-. 0: USB hub found
Hub 1-0: 1. 0: 2 ports Detected
Initializing USB Mass Storage driver...
Usbcore: registered new interface driver USB-storage
USB Mass Storage support registered.
Usbcore: registered new interface driver libusual
Mice: PS/2 mouse device common for all mice
Mini2440_touchscreen successfully loaded
Input: mini2440_touchscreen as/devices/virtual/input/input0
S3c24xx RTC, (c) maid Electronics
S3c2410-rtc s3c2410-rtc: RTC disabled, re-enabling
S3c2410-rtc s3c2410-rtc: RTC core: Registered s3c as rtc0
I2C/dev entries driver
S3C2410 watchdog timer, (c) 2004 simtec Electronics
S3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, IRQ Enabled
Cpuidle: Using Governor ladder
......

Test USB flash drive

To see the printed information when a USB flash drive is inserted, do not insert a USB flash drive when the system is started. After the system is started, go to the command line console and insert the USB flash drive. The following information is displayed:

[Root @ mini2440/] # USB 1-1: new full speed USB device using s3c2410-ohci and ADDR
ESS 2
USB 1-1: configuration #1 chosen from 1 choice
Scsi0: SCSI emulation for USB Mass Storage Devices
SCSI 0: 0: 0: 0: Direct-access USB 2.0 flash drive 5.00 PQ: 0 ANSI: 2
SD 0: 0: 0: 0: [SDA] 2073600 512-byte logical blocks: (1.06 GB/1012 MIB)
SD 0: 0: 0: 0: [SDA] write protect is off
SD 0: 0: 0: 0: [SDA] Assuming drive cache: Write Through
SD 0: 0: 0: 0: [SDA] Assuming drive cache: Write Through
SDA: sda1
SD 0: 0: 0: 0: [SDA] Assuming drive cache: Write Through
SD 0: 0: 0: 0: [SDA] Attached SCSI removable disk

[Root @ mini2440/] #

According to the above prompt, the USB flash drive corresponds to/dev/sda1, And now it can be mounted.

[Root @ mini2440/] # Mount-T vfat/dev/sda1/mnt/udisk
[Root @ mini2440/] # cd/mnt/udisk
[Root @ mini2440 udisk] # ls
100mlt29 20x15 8x6 ???. JPG filerecv20100328
18x8 ??????. JPG 24x18 ???? Photo
2.4x3.5 24x36 ??. JPG ?????,????? Picall
20x24 ??. JPG 6x8 ??. JPG ????????. PDF uimage_t35
[Root @ mini2440 udisk] #

You can see the content of the USB flash drive listed above.

[4] configure and test the USB camera driver

(To be continued)

[5] configure and test the USB wireless Nic

(To be continued)

Next, port the SD card driver.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.