bwscon=ioremap_nocache(BWSCON,0x0000004);
gpfcon=ioremap_nocache(GPFCON,0x0000004);
extint0=ioremap_nocache(EXTINT0,0x0000004);
intmsk=ioremap_nocache(INTMSK,0x0000004);
writel(readl(bwscon)|0xc0000,bwscon);
writel( (readl(gpfcon) & ~(0x3 << 14)) | (0x2 << 14), gpfcon);
writel( readl(gpfcon) | (0x1 << 7), gpfcon); // Disable pull-up
writel( (readl(extint0) & ~(0xf << 28)) | (0x4 << 28), extint0); //rising edge
writel( (readl(intmsk)) & ~0x80, intmsk);
在这个函数最后修改以下位置
if (!is_valid_ether_addr(ndev->dev_addr)) {
/* try reading from mac */
mac_src = "chip";
for (i = 0; i < 6; i++)
//ndev->dev_addr[i] = ior(db, i+DM9000_PAR);
ndev->dev_addr[i] = ne_def_eth_mac_addr[i];//修改这里
}
修改arch/arm/mach-s3c2440/mach-smdk2440.c,添加设备
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,
&s3c24xx_uda134x,
&s3c_device_dm9000,//此处添加
};
修改文件arch/arm/plat-s3c24xx/devs.c
[root@WEB188 linux-2.6.33]# vi arch/arm/plat-s3c24xx/devs.c
添加头文件:
#include <linux/dm9000.h>
以及以下信息:
static struct resource s3c_dm9000_resource[] = {
[0] = {
.start = S3C24XX_PA_DM9000,
.end = S3C24XX_PA_DM9000+ 0x3,
.flags = IORESOURCE_MEM
},
[1]={
.start = S3C24XX_PA_DM9000 + 0x4, //CMD pin is A2
.end = S3C24XX_PA_DM9000 + 0x4 + 0x7c,
.flags = IORESOURCE_MEM
},
[2] = {
.start = IRQ_EINT7,
.end = IRQ_EINT7,
.flags = IORESOURCE_IRQ
},
};
static struct dm9000_plat_data s3c_device_dm9000_platdata = {
.flags= DM9000_PLATF_16BITONLY,
};
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);
修改arch/arm/plat-s3c/include/plat/devs.h 45行附近,添加
[root@WEB188 linux-2.6.33]# vi arch/arm/plat-s3c/include/plat/devs.h
extern struct platform_device s3c_device_dm9000;
修改arch/arm/mach-s3c2410/include/mach/map.h
[root@WEB188 linux-2.6.33]# vi arch/arm/mach-s3c2410/include/mach/map.h
新增
/* DM9000 */
#define S3C24XX_PA_DM9000 0x20000300
#define S3C24XX_VA_DM9000 0xE0000000
(如果无法发现网卡,请进行操作:)修改arch/arm/mach-s3c2410/mach-smdk2410.c在smdk2410_devices增加以下行
&s3c_device_dm9000,
另外在static struct map_desc smdk2410_iodesc[] __initdata增加以下内容
[0] = {
.virtual = (unsigned long)S3C24XX_VA_DM9000,
.pfn = __phys_to_pfn(S3C24XX_PA_DM9000),
.length = SZ_1M,
.type = MT_DEVICE,
},
20、 移植LCD。打开文件arch/arm/mach-s3c2410/mach-smdk2410.c
[root@WEB188 linux-2.6.33]# vi arch/arm/mach-s3c2410/mach-smdk2410.c
在以下两个结构体中static struct s3c2410fb_display smdk2440_lcd_cfg[] __initdata,static struct s3c2410fb_mach_info smdk2440_fb_info __initdata,改成如下代码
static struct s3c2410fb_display smdk2440_lcd_cfg[] __initdata = {
{
/* Config for 320x240 LCD */
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
.type = S3C2410_LCDCON1_TFT,
.width = 320,
.height = 240,
.pixclock = 270000,
.xres = 320,
.yres = 240,
.bpp = 16,
.left_margin = 8,
.right_margin = 5,
.hsync_len = 63,
.upper_margin = 15,
.lower_margin = 3,
.vsync_len = 5,
},
};
static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
.displays = smdk2440_lcd_cfg,
.num_displays = ARRAY_SIZE(smdk2440_lcd_cfg),
.default_display = 0,
.lpcsel = 0,
}; |