1.修改内核目录下/arch/arm/mach-s3c2440/mach-smdk2440.c的内容linux
添加关于ax88180资源分配的内容spa
static struct resource ax88180_resource[] = {orm
[0] = {ip
.start = 0x28000000, /* Start of AX88180 base address 芯片接在片选5上,因此地址是0x28000000*/ci
.end = 0x28000000 + 0xFFFFF, /* End of AX88180 base address */资源
.flags = IORESOURCE_MEM,it
},ast
[1] = {form
.start = IRQ_EINT9, /* Interrupt line number 看电路图,得知ax88180中断接在中断9上,因此是IRQ_EINT9*/module
.end = IRQ_EINT9,
.flags = IORESOURCE_IRQ,
}
};
struct platform_device net_device_ax88180 = {
.name = "ax88180",
.id = -1,
.num_resources = ARRAY_SIZE(ax88180_resource),
.resource = ax88180_resource,
};
以后在static struct platform_device *smdk2440_devices[] __initdata中添加ax88180的驱动
static struct platform_device *smdk2440_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c0,
&s3c_device_iis,
&net_device_ax88180,
};
2.修改目录下的Makefile文件中的内核路径:
KDIR = /home/hu/development/linux-2.6.32.26
3.在目录地下执行make,即能生成驱动模块module.ko
4.将module.ko拷贝至2442文件系统中
5.加载模块:insmod module.ko
6.设ip地址:ifconfig eth0 192.168.1.15