分类: LINUX
2009-02-27 22:11:27
由于linux-
1.首先修改arch/arm/mach-s3c2410/devs.c
添加如下内容
static struct resource s3c_dm9000_resource[] = {
[0] = {
.start = S3C2410_CS4 + 0x300,
.end = S3C2410_CS4 + 0x300 + 0x03,
.flags = IORESOURCE_MEM
},
[1] = {
.start = S3C2410_CS4 + 0x300 + 0x04,
.end = S3C2410_CS4 + 0x300 + 0x04 + 0x3, // 0x3f
.flags = IORESOURCE_MEM
},
[2] = {
.start = IRQ_EINT7,
.end = IRQ_EINT7,
.flags = IORESOURCE_IRQ
}
};
片选值S3C2410_CS4,中断线IRQ_EINT7,这些值要根据你的板子电路图来设置。
static struct dm9000_plat_data s3c_device_dm9000_platdata = {
.flags= DM9000_PLATF_16BITONLY
};
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_device_dm9000_platdata,
}
};
EXPORT_SYMBOL(s3c_device_dm9000);
2.在arch/arm/mach-s3c2410/devs.h
添加如下内容
extern struct platform_device s3c_device_dm9000;
在arch/arm/mach-s3c2410/mach-2440.c
3.添加如下红色内容
static struct platform_device *smdk2440_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_dm9000,
&s3c_device_iis,
};
然后cp arch/arm/configs/s3c2410_defconf .config
Make menuconfig
Make zImage
下载zImage到开发板即可。