linux3.0内核usb驱动,linux下USB驱动移植

一、代码修改

在这里把include前面的#给删了,希望有帮助

/*add by lfc*/

#include

#include

#include

#include

/*end add*/

/**********************add by lfc*************************************/

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 ");

s3c_device_usb.dev.platform_data = &usb_sbc2410_info;

while(upllvalue!=__raw_readl(S3C2410_UPLLCON))

{

__raw_writel(upllvalue,S3C2410_UPLLCON);

mdelay(1);

}

return 0;

}

/***************************end add**********************/

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);

/*************************add by lfc****************************/

usb_sbc2410_init();

/*************************end add*******************************/

}

其实到了这里,要修改的代码已经修改完了,比添加Nand flash的支持修改的地方还要少^_^,不过我一直以为还没修改好,最后发现原来是没配置好~_~

二、内核配置

下面说一下郁闷了我好一阵子的内核配置(支持USB)问题,这个就比Nand flash的配置要复杂多了。

1、让内核支持热插拔

│                General setup  --->

│ │[*] Support for hot-pluggable devices

2、USB驱动设置,可能有些不选也行,不过没时间去试,至于为什么要选这些选项的话可以看一下这个贴(Linux下的硬件驱动——USB设备):

│ │                Device Drivers  --->

│ │              Generic Driver OpTIons  --->

│ Hotplug firmware loading support

│ │              Block devices  --->

│ │              Low Performance USB Block driver

│ │              SCSI device support  --->

│ │     SCSI generic support

│ │  [*]   Probe all LUNs on each SCSI device

│ │              USB support  --->

│ │ Support for Host-side USB

│ │[*]   USB device filesystem

│ │   OHCI HCD support

│ │   USB Mass Storage support

│ │[*]   USB Monitor

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值