二 、 加载dm9000 驱动。
4、加载dm9000驱动, 我自己更加喜欢NFS 挂载根文件系统 所以内核要移植dm9000 网卡的驱动。
copy drivers/net/dm9000 //copy 飞凌源码 到目标内核, 其实这一步可以不做,因为 dm9000 驱动为通用驱动,这里copy 也是没有必要。
4.1) 修改arch/arm/mach-s3c6410/mach-smdk6410.c
添加头文件 #incude <linux/dm9000.h>
添加dm9000 结构体。
//add by acanoe dm9000 /* Ethernet */ #define S3C64XX_PA_DM9000 (0x18000000) #define S3C64XX_SZ_DM9000 SZ_1M #define S3C64XX_VA_DM9000 S3C_ADDR(0x03b00300) static struct resource dm9000_resources[] = { [0] = { .start = S3C64XX_PA_DM9000, .end = S3C64XX_PA_DM9000 + 3, .flags = IORESOURCE_MEM, }, [1] = { .start = S3C64XX_PA_DM9000 + 4, .end = S3C64XX_PA_DM9000 + S3C64XX_SZ_DM9000 - 1, .flags = IORESOURCE_MEM, }, [2] = { .start = IRQ_EINT(7), .end = IRQ_EINT(7), .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH, }, }; static struct dm9000_plat_data dm9000_setup = { .flags = DM9000_PLATF_16BITONLY, .dev_addr = { 0x08, 0x90, 0x00, 0xa0, 0x90, 0x90 }, }; static struct platform_device s3c_device_dm9000 = { .name = "dm9000", .id = 0, .num_resources = ARRAY_SIZE(dm9000_resources), .resource = dm9000_resources, .dev = { .platform_data = &dm9000_setup, } }; //#ifdef CONFIG_DM9000 //add by acanoe dm9000在
static struct platform_device *smdk6410_devices[] __initdata = {
#ifdef CONFIG_DM9000 &s3c_device_dm9000, // dm9000 driver add by acanoe #endif // add by acanoe 2
// &smdk6410_smsc911x, // Canceled by acanoe 对于OK6410 的网卡实验来说,这一项一定要注视掉。
};