Chinaunix首页 | 论坛 | 博客
  • 博客访问: 686320
  • 博文数量: 152
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1793
  • 用 户 组: 普通用户
  • 注册时间: 2013-09-12 12:26
个人简介

相信自己,只有不想做的,没有做不到的。

文章分类

全部博文(152)

文章存档

2021年(1)

2015年(2)

2014年(74)

2013年(75)

分类: LINUX

2013-11-07 22:49:25

【实验目的】

       通过上面的实验我们能够获得一个内核,但是这个内核只是一个最基本的配置,很多的功能并没有包含。

       网卡是嵌入式产品最常用的设备,这里我们需要完成网卡驱动的移植。FS_S5PC100使用的是DM9000网卡,我们通过这个实验能够了解如何在内核中添加网卡驱动及网络功能的基本配置。

【实验环境】

?          主机:ubuntu 10.10发行版

?          目标机:FS_S5PC100平台

?          交叉编译工具:arm-cortex_a8-linux-gnueabi-gcc

【实验步骤】

?          平台代码修改

vim  arch/arm/mach-s5pc100/mach-smdkc100.c

 

?         添加需要的头文件

#if defined (CONFIG_DM9000)

#include

#include

#endif

 

?         平台设备的添加

/* DM9000 Support */

#if  defined(CONFIG_DM9000)

static struct resource 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 | IRQ_TYPE_LEVEL_HIGH,

},

};

 

static struct dm9000_plat_data s5pc100_dm9000_platdata = {

.flags        =   DM9000_PLATF_16BITONLY,

.dev_addr[0]  = 0x00,

.dev_addr[1]  = 0x00,

.dev_addr[2]  = 0x3e,

.dev_addr[3]  = 0x26,

.dev_addr[4]  = 0x0a,

.dev_addr[5]  = 0x00,

};

 

static struct platform_device s5pc100_device_dm9000 = {

.name        = "dm9000",

.id        = -1,

.num_resources        = ARRAY_SIZE(dm9000_resources),

.resource        = dm9000_resources,

.dev = {

.platform_data  = & s5pc100_dm9000_platdata,

}

};

#endif

 

?         平台设备列表的添加:

在smdkc100_devices[]结构体数组中添加如下内容:

   #if  defined(CONFIG_DM9000)

   &s5pc100_device_dm9000,

   #endif

 

?          配置内核

$ make menuconfig

 

?         网络配置:

[*] Networking support (NEW)  --->

Networking options  --->

<*> Packet socket

<*> Unix domain sockets

[*] TCP/IP networking

[*]   IP: multicasting

[*]   IP: kernel level autoconfiguration

[*]     IP: BOOTP support

 

?         网卡驱动配置

Device Drivers  ---> 

[*] Network device support  --->

[*]   Ethernet (10 or 100Mbit)  --->

<*>   DM9000 support

 

?         网络文件系统的配置

File systems  ---> 

[*] Network File Systems  --->

<*>   NFS client suppor

[*]     NFS client support for NFS version 3 

[*]       NFS client support for the NFSv3 ACL protocol extension

[*]     Root file system on NFS

 

?          编译内核,并拷贝到tftpboot目录下

$ make  zImage

$ cp arch/arm/boot/zImage  /tftpboot

 

?          启动开发板,修改内核启动参数,通过NFS方式挂载根文件系统

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