Platform: Mini2440
System: linux-2.6.32.2
Host: Windows
When configuring the USB gadget function in the usbnet, the main task is to load the G_ether.ko module, but tried several times to plug into the computer, are not responding, Windows can not identify the device, consult the data before you know is the USB interface pull-up problem, mini2440 via GPC5 to pull the USB interface, only so that the host can identify the device and prompt to install the device. After the integration of the information, the problem is resolved, the steps:
Open mach-mini2440.c Add code:
[HTML]View Plaincopy
- static void S3c2410_udc_pullup (enum s3c2410_udc_cmd_e cmd)
- {
- Switch (CMD) {
- Case S3c2410_udc_p_enable:
- S3c2410_gpio_cfgpin (S3C2410_GPC (5), s3c2410_gpio_output);
- S3c2410_gpio_setpin (S3C2410_GPC (5), 1);
- Break
- Case S3c2410_udc_p_disable:
- S3c2410_gpio_setpin (S3C2410_GPC (5), 0);
- Break
- Case S3c2410_udc_p_reset:
- Break
- Default
- Break
- }
- }
[HTML]View Plaincopy
- static struct S3c2410_udc_mach_info s3c2410_udc_cfg __initdata = {
- . Udc_command = S3c2410_udc_pullup,
- };
Add a sentence in the Mini2440_machine_init function:
[HTML]View Plaincopy
- static void __init mini2440_machine_init (void)
- {
- #if defined (lcd_width)
- S3c24xx_fb_set_platdata (&mini2440_fb_info);
- #endif
- S3c_i2c0_set_platdata (NULL);
- S3c2410_gpio_cfgpin (S3C2410_GPC (0), s3c2410_gpc0_lend);
- S3c_device_nand.dev.platform_data = &friendly_arm_nand_info;
- S3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg;
- S3c24xx_udc_set_platdata (&S3C2410_UDC_CFG); Add to
- Platform_add_devices (Mini2440_devices, Array_size (mini2440_devices));
- S3c_pm_init ();
Save close after adding # include <plat/udc.h> header files at the beginning of the program.
Make Menuconfig configuration kernel: Device drivers-usb support-usb Gadget Support
Configuration
Note the cursor configuration, easy to ignore, select s3c2410 USB Device Controller
Configuration complete save exit, make Zimage, start Linux with the new kernel.
Configuration command: Ifconfig usb0 172.20.21.88 up
Connect the D-type interface and the Windows host with USB to prompt for device installation:
Drive: http://download.csdn.net/detail/wu20093346/7914915
Install from a list or a specified location
After installation, a new local connection, modify IP, should be able to and mini2440 board Ping Pass:
Linux USB Gadget Network Experience