$ vim arch/arm/mach-s5pc100/mach-smdkc100.c
添加需要的头文件:
1 // vim arch/arm/mach-s5pc100/mach-smdkc100.c
2
3 #if defined (CONFIG_DM9000)
4 #include
5 #include
6 #endif
平台设备的添加:
01 /* DM9000 Support */
02
03 #if defined(CONFIG_DM9000)
04 static struct resource dm9000_resources[] = {
05 [0] = {
06 .start = 0x88000000,
07 .end = 0x88000000 +0x3,
08 .flags = IORESOURCE_MEM,
09 },
10 [1] = {
11 .start = 0x88000000 + 0x4,
12 .end = 0x88000000 + 0x4 +0x3,
13 .flags = IORESOURCE_MEM,
14 },
15 [2] = {
16 .start = IRQ_EINT(10),
17 .end = IRQ_EINT(10),
18 .flags = IORESOURCE_IRQ | IRQ_TYPE_LEVEL_HIGH,
19 },
20 };
21
22 static struct dm9000_plat_data s5pc100_dm9000_platdata = {
23 .flags = DM9000_PLATF_16BITONLY,
24 .dev_addr[0] = 0x00,
25 .dev_addr[1] = 0x00,
26 .dev_addr[2] = 0x3e,
27 .dev_addr[3] = 0x26,
28 .dev_addr[4] = 0x0a,
29 .dev_addr[5] = 0x00,
30 };
31
32 static struct platform_device s5pc100_device_dm9000 = {
33 .name = "dm9000",
34 .id = -1,
35 .num_resources = ARRAY_SIZE(dm9000_resources),
36 .resource = dm9000_resources,
37 .dev = {
38 .platform_data = & s5pc100_dm9000_platdata,
39 }
40 };
41 #endif
平台设备列表的添加:
在smdkc100_devices[]结构体数组中添加如下内容:
1 // vim arch/arm/mach-s5pc100/mach-smdkc100.c
2
3 #ifdefined(CONFIG_DM9000)
4 &s5pc100_device_dm9000,
5 #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
<> The ipv6 protocol
网卡驱动配置:
Device Drivers --->
[*] Network device support --->
[*] Ethernet driver support --->
DM9000 support
网络文件系统的配置:
File systems --->
[*] Network File Systems --->
&nbsnbsp; 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方式挂载根文件系统。