Chinaunix首页 | 论坛 | 博客
  • 博客访问: 102328
  • 博文数量: 23
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 300
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-27 21:59
文章分类
文章存档

2010年(6)

2009年(17)

我的朋友

分类: LINUX

2009-10-21 22:34:47

s3c2440开发板DM9000移植

# gedit arch/arm/mach-s3c2440/mach-smdk2440.c

static struct map_desc smdk2440_iodesc[] __initdata = {
        /* ISA IO Space map (memory space selected by A24) */
        {
            .virtual = (u32)S3C24XX_VA_ISA_WORD,
            .pfn = __phys_to_pfn(S3C2410_CS2),
            .length = 0x10000,
            .type = MT_DEVICE,
        }, {
            .virtual = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
            .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
            .length = SZ_4M,
            .type = MT_DEVICE,
        }, {
            .virtual = (u32)S3C24XX_VA_ISA_BYTE,
            .pfn = __phys_to_pfn(S3C2410_CS2),
            .length = 0x10000,
            .type = MT_DEVICE,
        }, {
            .virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
            .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
            .length = SZ_4M,
            .type = MT_DEVICE,
        }
        
//加入以下
        ,
        {
            .virtual = (u32)S3C2410_ADDR(0x02100300),
            .pfn = __phys_to_pfn(0x20000300),
            .length = SZ_1M,
            .type = MT_DEVICE,
        }

};

static struct platform_device *smdk2440_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_lcd,
        &s3c_device_wdt,
        &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_rtc,
        &s3c_device_dm9000,
//加入这句
};

    
    
2.

# gedit arch/arm/plat-s3c24xx/devs.c
加入以下:

/* DM9000 registrations */
#include <linux/dm9000.h>
#define DM9000_BASE 0x20000300
static struct resource s3c_dm9000_resource[] = {
        [0] = {
            .start = DM9000_BASE,
            .end = DM9000_BASE + 0x03,
            .flags = IORESOURCE_MEM,
        },
        [1] = {
            .start = DM9000_BASE + 0x04,
            .end = DM9000_BASE + 0x04 + 0x7c,
            .flags = IORESOURCE_MEM,
        },
          [2] = {
            .start = IRQ_EINT7,
            .end = IRQ_EINT7,
            .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        }
};

static struct dm9000_plat_data s3c_device_dm9000_platdata = {
       .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM,
};

struct platform_device s3c_device_dm9000 = {
        .name = "dm9000",
        .id = 0,
        .num_resources = ARRAY_SIZE(s3c_dm9000_resource),
        .resource = s3c_dm9000_resource,
        .dev = {
        .platform_data = &s3c_device_dm9000_platdata, 
        } 
};

EXPORT_SYMBOL(s3c_device_dm9000);


3.
# gedit  arch/arm/plat-s3c/include/plat/devs.h
加入下面一句:

extern struct platform_device s3c_device_dm9000;


阅读(1406) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~