(Just add the USB driver, there is no detailed description of it)
For related knowledge, you can see this related blog: http://blog.csdn.net/u012507643/article/details/52932578
1. Modify the code
vi arch/arm/mach-s3c2440/mach-smdk2440.c
#include <mach/regs-clock.h> //add by anzhihong #include <linux/delay.h>
Add the USB init function, the function definition here must be in front of the smdk_map_io call, otherwise an error will be reported: as follows
int usb_s3c2440_init(void) { /* Input Frequency is 12.0000MHz, and MDEV=0x38 PDIV=2 SDIV=2, so output frequency 48.00MHz */ unsigned long upllvalue = (0x38<<12)|(0x02<<4)|(0x02); while (upllvalue != __raw_readl(S3C2410_UPLLCON)) { __raw_writel(upllvalue, S3C2410_UPLLCON); mdelay (1); } return 0; }
In smdk2440_map_io add:
static void __init smdk2440_map_io(void) { s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc)); s3c24xx_init_clocks(12000000); s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs)); usb_s3c2440_init(); /* Add by anzhihong */
Kernel add support:
The make menuconfig options are as follows:
Device Drivers ---> [*] USB support ---> {*} Support for Host-side USB [*] USB device filesystem (DEPRECATED) [*] USB device class-devices (DEPRECATED) <*> OHCI HCD support <*> USB Mass Storage support [*] HID Devices ---> -*- Generic HID support <*> USB Human Interface Device (full HID) support SCSI device support ---> <*> SCSI device support [*] legacy /proc/scsi/ support <*> SCSI disk support The usb storage driver uses the scsi intermediate layer to virtualize the usb storage device into a scsi logical device. In this way, it is convenient to use the device IO interface driven by scsi, as well as mechanisms such as plugin/plugout File systems ---> DOS/FAT/NT Filesystems ---> <*> MSDOS fs support <*> VFAT (Windows-95) fs support (437) Default codepage for FAT (iso8859-1) Default iocharset for FAT <*> NTFS file system support [*] NTFS write support Partition Types ---> [*] PC BIOS (MSDOS partition tables) support [*] Windows Logical Disk Manager (Dynamic Disk) support -*- Native language support ---> <*> Codepage 437 (United States, Canada) <*> Simplified Chinese charset (CP936, GB2312) <*> ASCII (United States) <*> NLS ISO 8859-1 (Latin 1; Western European Languages) <*> NLS UTF-8
Recompile and load into the kernel:
Inserting the usb into the above shows the following display (I inserted all four usbs and tried it):