//----------------------------------------------------------------------------------------------------------------------------
// 作者:Eleven(eleven@urbetter.com)
// 论坛ID:Sturtle
// 版权:Eleven
// 平台:友坚UT-S3C2416开发板+Linux2.6.21 OS
// 发布日期:2011-10-17
// 最后修改:2011-10-19
// 注意事项:未经作者同意,商业网站不能转载,更不得在转载的时候擅自修改、删除**的任何部分
// 摘自:http://blog.csdn.net/anthone_ligang/article/details/6607643
//------------------------------------------------------------------------------------------------------------------------------
一、硬件连接:
1、16bit模式
2、INT接到S3C2416的IRQ_LAV/EINT4,INT脚为低时为有效中断信号,中断线为EINT4;
3、CS接到S5PV210的CSn1,CMD连接到S3C2416的地址总线ADDR[1],故INDEX和DATA[15:0]的端口地址分别为0x80000000和0x80000004。
二、软件设定
1、在\kernel2416\arch\arm\plat-s3c24xx\devs.c中添加如下:
view plaincopy to clipboardprint?
01.#include <linux/dm9000.h>
02.#define S3C24XX_VA_DM9000 (0xe0000000)
03.#define S3C24XX_PA_DM9000 (0x08000000)
04.#define S3C24XX_SZ_DM9000 SZ_1M
05.
06.static struct resource dm9000_resources[] = {
07. [0] = {
08. .start = S3C24XX_PA_DM9000,
09. .end = S3C24XX_PA_DM9000+0x3,
10. .flags = IORESOURCE_MEM,
11. },
12. [1] = {
13. .start = S3C24XX_PA_DM9000+0x4,
14. .end = S3C24XX_PA_DM9000+S3C24XX_SZ_DM9000-1,
15. .flags = IORESOURCE_MEM,
16. },
17. [2] = {
18. .start = IRQ_EINT4,
19. .end = IRQ_EINT4,
20.// .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
21. .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
22. },
23.};
24.
25.static struct dm9000_plat_data dm9000_setup = {
26. .flags = DM9000_PLATF_16BITONLY
27.};
28.
29.struct platform_device s3c_device_dm9000 = {
30. .name = "dm9000",
31. .id = 0,
32. .num_resources = ARRAY_SIZE(dm9000_resources),
33. .resource = dm9000_resources,
34. .dev =
35. {
36. .platform_data = &dm9000_setup,
37. }
38.};
39.EXPORT_SYMBOL(s3c_device_dm9000);
#include <linux/dm9000.h>
#define S3C24XX_VA_DM9000 (0xe0000000)
#define S3C24XX_PA_DM9000 (0x08000000)
#define S3C24XX_SZ_DM9000 SZ_1M
static struct resource dm9000_resources[] = {
[0] = {
.start = S3C24XX_PA_DM9000,
.end = S3C24XX_PA_DM9000+0x3,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = S3C24XX_PA_DM9000+0x4,
.end = S3C24XX_PA_DM9000+S3C24XX_SZ_DM9000-1,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_EINT4,
.end = IRQ_EINT4,
// .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
},
};
static struct dm9000_plat_data dm9000_setup = {
.flags = DM9000_PLATF_16BITONLY
};
struct platform_device s3c_device_dm9000 = {
.name = "dm9000",
.id = 0,
.num_resources = ARRAY_SIZE(dm9000_resources),
.resource = dm9000_resources,
.dev =
{
.platform_data = &dm9000_setup,
}
};
EXPORT_SYMBOL(s3c_device_dm9000);
2、在\kernel2416\arch\arm\mach-s3c2416\mach-smdk2416.c修改成:
view plaincopy to clipboardprint?
01.static struct platform_device *smdk2416_devices[] __initdata = {
02.
03. //&s3c_device_wdt,
04. &s3c_device_i2c,
05. &s3c_device_lcd,
06. &s3c_device_rtc,
07. &s3c_device_adc,
08. &s3c_device_iis,
09. &s3c_device_usbgadget,
10. &s3c_device_usb,
11. &s3c_device_hsmmc0,
12. &s3c_device_hsmmc1,
13. //&s3c_device_smc911x
14. &s3c_device_dm9000,
15.};
static struct platform_device *smdk2416_devices[] __initdata = {
//&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_lcd,
&s3c_device_rtc,
&s3c_device_adc,
&s3c_device_iis,
&s3c_device_usbgadget,
&s3c_device_usb,
&s3c_device_hsmmc0,
&s3c_device_hsmmc1,
//&s3c_device_smc911x
&s3c_device_dm9000,
};
3、修改\include\asm-arm\plat-s3c24xx\devs.h ,添加:
view plaincopy to clipboardprint?
01.#if defined(CONFIG_CPU_S3C6410) || defined(CONFIG_CPU_S3C2450)|| defined(CONFIG_CPU_S3C2416)
02. extern struct platform_device s3c_device_smc911x;
03. extern struct platform_device s3c_device_dm9000;
04.#endif
#if defined(CONFIG_CPU_S3C6410) || defined(CONFIG_CPU_S3C2450)|| defined(CONFIG_CPU_S3C2416)
extern struct platform_device s3c_device_smc911x;
extern struct platform_device s3c_device_dm9000;
#endif
4、修改\include\linux\dm9000.h ,添加:
view plaincopy to clipboardprint?
01.#define S3C24XX_VA_DM9000 (0xe0000000)
02.#define S3C24XX_PA_DM9000 (0x08000000)
03.#define S3C24XX_SZ_DM9000 SZ_1M
#define S3C24XX_VA_DM9000 (0xe0000000)
#define S3C24XX_PA_DM9000 (0x08000000)
#define S3C24XX_SZ_DM9000 SZ_1M
|