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)) {
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];
}
b、修改arch/arm/mach-s3c2440/mach-smdk2440.c ,添加设备
static struct platform_device *smdk2440_devices[] __initdata = {
&s3c_device_ohci,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c0,
&s3c_device_iis,
&s3c_device_rtc,
&s3c24xx_uda134x,
&s3c_device_dm9000,
};
c、修改 arch/arm/plat-s3c24xx/devs.c
添加头文件
#include
添加以下代码
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);
d、修改 arch/arm/plat-sumsung/include/plat/devs.h 45行附近,添加
extern struct platform_device s3c_device_dm9000;
e、修改arch/arm/mach-s3c2410/include/mach/map.h 文件
#define S3C24XX_PA_DM9000 0x20000300
#define S3C24XX_VA_DM9000 0xE0000000
13、启动画面显示小企鹅的方法
配置内核 ,下面是必选项
Device Drivers--->
Graphics support --->
<*> Support for frame buffer devices
<*> S3C2410 LCD framebuffer support ,multi support!
Console display driver support --->
<*> Framebuffer Console support
Logo configuration --->
[*] Bootup logo
[*] Standard 224-color Linux logo
14、3.5寸LCD显示的移植
2.6.34内核中已经支持
15、修改uart2为普通串口以及测试程序
修改arch/arm/mach-s3c2440/mach-smdk2440.c 中的uart2的配置,修改后如下:
static struct s3c2410_uartcfg smdk2440_uartcfgs[] __initdata = {
[0] = {
.hwport = 0,
.flags = 0,
.ucon = 0x3c5,
.ulcon = 0x03,
.ufcon = 0x51,
},
[1] = {
.hwport = 1,
.flags = 0,
.ucon = 0x3c5,
.ulcon = 0x03,
.ufcon = 0x51,
},
[2] = {
.hwport = 2,
.flags = 0,
.ucon = 0x3c5,
.ulcon = 0x03,
.ufcon = 0x51,
}
};
在drivers/serial/samsung.c 中添加对uart2控制器的配置,配置为普通串口。
添加头文件:
#include
#include
在static int s3c24xx_serial_startup(struct uart_port *port)函数中,添加
if (port->line == 2) {
s3c2410_gpio_cfgpin(S3C2410_GPH(6), S3C2410_GPH6_TXD2);
s3c2410_gpio_pullup(S3C2410_GPH(6), 1);
s3c2410_gpio_cfgpin(S3C2410_GPH(7), S3C2410_GPH7_RXD2);
s3c2410_gpio_pullup(S3C2410_GPH(7), 1);
}
16、移植看门狗
修改配置
Device Drivers --->
[*] Watchdog Timer Support --->
<*> S3C2410 Watchdog
最后:make zImage
最后编译出来的zImage就2.1M左右。
烧写内核,启动成功
不过,此时,显示屏显示还有点问题,出现上下两栏。解决方法如下:
修改mach-smdk2440.