添加选项:
make menuconfig
│ │ <*> IP: IPsec BEET mode
<*> Large Receive Offload (ipv4/tcp) │ │
│ │ <*> INET: socket monitoring interface
Device Drivers --->
[*] Network device support --->
[*] Ethernet driver support --->
<*> DM9000 support
2.添加dm9000的代码,在arch/arm/mach-s3c64xx/mach-s3c6410.c
添加头文件
#include <linux/dm9000.h>
添加初始化代码。分配资源
/*
dm9000
add by fatfish
*/
/* DM9000AEP 10/100 ethernet controller */
#define SMDK6410_PA_DM9000 (0x18000000)
#define SMDK6410_VA_EXTDEV S3C_ADDR(0x02000000)
#define SMDK6410_PA_EXTDEV (0x30000000)
#define SMDK6410_EN_DM9000 (1<<14)
static __u32 smdk6410_extdev_status;
static void __init smdk6410_dm9000_enable(void)
{
smdk6410_extdev_status |= (SMDK6410_EN_DM9000 << 16);
__raw_writel(smdk6410_extdev_status, SMDK6410_VA_EXTDEV);
}
static struct resource smdk6410_dm9000_resource[] = {
[0] = {
.start = SMDK6410_PA_DM9000,
.end = SMDK6410_PA_DM9000 + 3,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = SMDK6410_PA_DM9000 + 4,
.end = SMDK6410_PA_DM9000 + 4 + 500,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_EINT(7), /*根据电路图来的*/
.end = IRQ_EINT(7),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
},
};
static struct dm9000_plat_data smdk6410_dm9000_pdata = {
.flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),
.dev_addr = { 0x08, 0x90, 0x90, 0x90, 0x90, 0x90 }, /* MAC addr*/
/* dev_addr can be set to provide hwaddr. */
};
static struct platform_device smdk6410_device_eth = {
.name = "dm9000",
.id = -1,
.num_resources = ARRAY_SIZE(smdk6410_dm9000_resource),
.resource = smdk6410_dm9000_resource,
.dev = {
.platform_data = &smdk6410_dm9000_pdata,
},
};
static struct map_desc smdk6410_iodesc[] __initdata = {
{
.virtual = (unsigned long)SMDK6410_VA_EXTDEV,
.pfn = __phys_to_pfn(SMDK6410_PA_EXTDEV),
.length = SZ_64K,
.type = MT_DEVICE,
},
};
static struct platform_device *smdk6410_devices[] __initdata中添加
&smdk6410_device_eth,
static void __init smdk6410_machine_init(void)中添加
smdk6410_dm9000_enable();