内核支持U盘 -- zImage for sbc-2410x
# cd linux-2.6.19
# vi arch/arm/mach-s3c2410/mach-smdk2410.c
--------------------------------------------------
(1) 添加头文件
//zxl for usb start
#include
#include
#include
#include
//zxl for usb end
(2) 以下内容加在static void __init smdk2410_map_io(void)前面
/***************** zxl add start *****************/
static struct s3c2410_hcd_info usb_sbc2410_info = {
.port[0] = {
.flags = S3C_HCDFLG_USED
}
};
int usb_sbc2410_init(void)
{
unsigned long upllvalue = (0x78<<12)|(0x02<<4)|(0x03);
printk("USB Control, (c) 2006 sbc2410\n");
s3c_device_usb.dev.platform_data = &usb_sbc2410_info;
while(upllvalue!=__raw_readl(S3C2410_UPLLCON)) {
__raw_writel(upllvalue,S3C2410_UPLLCON);
mdelay(1);
}
return 0;
}
/***************** zxl add end *****************/
(3) 在MACHINE_START与MACHINE_END 之间加上.init_machine= &usb_sbc2410_init,结果变成了
MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
* to SMDK2410 */
/* Maintainer: Jonas Dietsche */
.phys_ram = S3C2410_SDRAM_PA,
.phys_io = S3C2410_PA_UART,
.io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = smdk2410_map_io,
.init_irq = smdk2410_init_irq,
.timer = &s3c24xx_timer,
//zxl add
.init_machine= &usb_sbc2410_init,
MACHINE_END
(4) 在smdk2410_map_io()函数里面添加usb_sbc2410_init()函数调用:
static void __init smdk2410_map_io(void)
{
s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
s3c24xx_set_board(&smdk2410_board);
//zxl add
usb_sbc2410_init();
}
内核配置(For USB)
--------------------------------------------------
让内核支持热插拔
General setup --->
[*] Configure standard kernel features (for small systems) --->
[*] Support for hot-pluggable devices (NEW)
Device Drivers --->
Generic Driver Options --->
<*> Userspace firmware loading support //(1)
Block devices --->
<*> Low Performance USB Block driver
SCSI device support --->
<*> SCSI device support
<*> SCSI disk support
<*> SCSI generic support
USB support --->
<*> Support for Host-side USB
[*] USB device filesystem
<*> OHCI HCD support
--- NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
--- may also be needed; see USB_STORAGE Help for more information
<*> USB Mass Storage support
[*] USB Monitor
File systems --->
DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows-95) fs support
(936) Default codepage for FAT
(cp936) Default iocharset for FAT
< > NTFS file system support
Partition Types --->
[*] PC BIOS (MSDOS partition tables) support
Native Language Support --->
<*> Simplified Chinese charset (CP936, GB2312)
<*> NLS UTF8
# make zImage
注: 系统正真支持U盘,busybox中还需要有udev应用程序(用户工具)
将zImage下载到开发板上,然后挂载U盘
# mount /dev/sda1 /mnt
=========================================================================
转载地址:http://blog.chinaunix.net/u3/104564/showart_2092008.html
配置USB for mini2440 & Linux2.6.30.4
U盘与鼠标的配置:
配置:
# make menuconfig
选上以下:
Device Drivers ---> |
编译:
# make zImage
U盘和USB鼠标均可以使用!
摄象头的配置:
配置:
# make menuconfig
选上以下:
Device Drivers ---> |
编译:
# make zImage
友善之臂公司提供的基于Qt的USB摄像头测试程序可以使用!