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