网卡驱动的移植

1.平台代码修改:
vim arch/arm/mach-s5pv210/mach-smdkv210.c
修改结构体数组 smdkv210_dm9000_resources 为:
static struct resource smdkv210_dm9000_resources[] = {
[0] = {
.start = 0x88000000,
.end = 0x88000000 + 0x3,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 0x88000000 + 0x4,
.end = 0x88000000 + 0x4 + 0x3,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_EINT(10),
.end = IRQ_EINT(10),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
},
};
修改函数 smdkv210_dm9000_init 为:static void __init smdkv210_dm9000_init(void)
{
unsigned int tmp;
gpio_request(S5PV210_MP01(1), "nCS1");
s3c_gpio_cfgpin(S5PV210_MP01(1), S3C_GPIO_SFN(2));
gpio_free(S5PV210_MP01(1));
tmp = (5 << S5P_SROM_BCX__TACC__SHIFT);
__raw_writel(tmp, S5P_SROM_BC1);
tmp = __raw_readl(S5P_SROM_BW);
tmp &= (S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT);
tmp |= (1 << S5P_SROM_BW__NCS1__SHIFT);
__raw_writel(tmp, S5P_SROM_BW);
}


2.配置内核:

make menuconfig
[*] Networking support --->
Networking options --->
<*> Packet socket
<*> Unix domain sockets
[*] TCP/IP networking
[*] IP: kernel level autoconfiguration
Device Drivers --->
[*] Network device support --->
[*] Ethernet driver support (NEW) --->
<*> DM9000 support
File systems --->
[*] Network File Systems (NEW) --->
<*> NFS client support
[*] NFS client support for NFS version 3
[*] NFS client support for the NFSv3 ACL protocol extension
[*] Root file system on NFS


3.编译内核:

make zImage


4.测试:

拷贝内核到/tftpboot 下
$ cp arch/arm/boot/zImage /tftpboot
启动开发板,修改内核启动参数设置网络加载内核,通过 NFS 方式挂载根文件系统实验六 LED 驱动

你可能感兴趣的:(嵌入式内核开发,LINUX,系统移植)