Linux 内核下的 drivers/net/dm9000.c 实现了与体系结构无关的 DM9000 网卡驱动,只需要在 BSP 的板文件(arch/arm/mach-s3c6410/smdk-6410.c)中定义相关的 platform 设备和数据: 1、 添加引脚宏定义 在arch/arm/mach-s3c6400/include/mach/map.h文件中添加宏定义 #define S3C64XX_PA_DM9000 (0x18000000) 2、 添加platform数据 在arch/arm/mach-s3c6410/smdk-6410.c文件中定义platform 设备和数据 static struct resource s3c_dm9000_resources[] = { [0] = { .start = S3C64XX_PA_DM9000, .end = S3C64XX_PA_DM9000 + 0x3, .flags = IORESOURCE_MEM, }, [1] = { .start = S3C64XX_PA_DM9000 + 0x4, .end = S3C64XX_PA_DM9000 + 0x7, .flags = IORESOURCE_MEM, }, [2] = { .start = IRQ_EINT(7), .end = IRQ_EINT(7), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, }, }; static struct dm9000_plat_data s3c_dm9000_platdata = { .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM, .dev_addr = { 0x0, 0x16, 0xd4, 0x9f , 0xed, 0xa4 }, }; static struct platform_device s3c_device_dm9000 = { .name = "dm9000", .id = 0, .num_resources = ARRAY_SIZE(s3c_dm9000_resources), .resource = s3c_dm9000_resources, .dev = { .platform_data = &s3c_dm9000_platdata, } }; 3、 修改smdk6410_devices[]数组 在arch/arm/mach-s3c6410/smdk-6410.c文件中的struct platform_device *smdk6410_devices[]数组填入如下语句: & s3c_device_dm9000, |