linux 内核支持u盘,配置内核支持U盘 [转]

转载地址:http://hi.baidu.com/zengzhaonong/blog/item/978fc6f9e820555a252df2ea.html

内核支持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

=========================================================================

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值