添加网卡驱动和USB支持 以及一些问题的集中处理

之前内核移植时没有添加网卡驱动和USB支持,添加如下:

1.以太网卡驱动安装:

1.1第一步、修改内核代码

[luxibao@centos ~]$ cd fl2440

[luxibao@centos fl2440]$ cd kernel

[luxibao@centos kernel]$ cd linux-3.0

[luxibao@centos linux-3.0]$ cd arch/arm/cd mach-s3c2440

[luxibao@centos mach-s3c2440]$ vim mach-smdk2440.c

#include <linux/dm9000.h>  //添加DM9000网卡的头文件

并添加如下代码

/* add DM9000 ethernet drivers ,whitch is modify by luxibao */
#define DM9000_BASE    (S3C2410_CS4 + 0x300)
static struct resource s3c_dm9000_resource[] = {
     [0] = {
        .start = DM9000_BASE,
        .end   = DM9000_BASE + 3,
        .flags = IORESOURCE_MEM
    },
    [1] = {
        .start = DM9000_BASE + 4,
        .end   = DM9000_BASE + 7,
        .flags = IORESOURCE_MEM
    },
    [2] = {
        .start = IRQ_EINT7,
        .end   = IRQ_EINT7,
        .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
    }
};

/*        
 * The DM9000 has no eeprom, and it's MAC address is set by
 * the bootloader before starting the kernel.
 */
static struct dm9000_plat_data s3c_dm9000_pdata = {
    .flags      = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),
};

static struct platform_device s3c_device_dm9000 = {
    .name       = "dm9000",
    .id     = -1,
    .num_resources  = ARRAY_SIZE(s3c_dm9000_resource),
    .resource   = s3c_dm9000_resource,
    .dev        = {
        .platform_data  = &s3c_dm9000_pdata,
    },
};

1.2.修改platform_device *smdk2440_devices[] __initdata结构体为如下,在其中添加启动DM9000

static struct platform_device *smdk2440_devices[] __initdata = {
    &s3c_device_ohci,
    &s3c_device_lcd,
    &s3c_device_wdt,
    &s3c_device_i2c0,
    &s3c_device_iis,

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值