分类: LINUX
2009-07-28 20:31:17
|
添加如下代码:
#ifndef _INCLUDE_SMDK2410_H_
#define _INCLUDE_SMDK2410_H_
#define pSMDK2410_ETH_IO __phys_to_pfn(0x19000000)
#define vSMDK2410_ETH_IO 0xE0000000
#define SMDK2410_EHT_IRQ IRQ_EINT9
这些宏在cs8900.c中要用到。
3. 修改mach-smdk2410.c.
#vi linux-2.6.26/arch/arm/mach-s3c2410/mach-smdk2410.c
添加刚才建立的头文件smdk2410.h
#include “asm/arch/smdk2410.h”
在map_desc smdk2410_iodesc[]结构数组中添加cs8900的对于的io空间的映射,添加内容如下:
{vSMDK2410_ETH_IO,pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE}
修改后内容如下:
static struct map_desc smdk2410_iodesc[] __initdata = {
/* nothing here yet */
{ vSMDK2410_ETH_IO , pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE },
};
4. 修改drivers/net/arm/目录下的Kconfig文件,增加menuconfig中CS8900的编译选项,
#vi linux-2.6.26/drivers/net/arm/Kconfig
添加:
Config ARM_CS8900
tristate "CS8900 support"
depends on NET_ETHERNET && ARM && ARCH_SMDK2410
help
Support for CS8900A chipset based Ethernet cards. If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from as well as . To compile this driver as a module, choose M here and read
. The module will be
called cs8900.o.
这样,在编译配置菜单”Menuconfig”中的Ethernet网络设备中就可以找到”CS8900 support”的选项了。
5. 在/drivers/net/arm/Makefile中添加
obj-$(CONFIG_ARM_CS8900) += cs8900.o
6. 执行make menuconfig。
Device drivers
->network device support
->Ethernet中选择(*)CS8900 support.
7.编译内核,
$make
出现
drivers/net/arm/cs8900.c:558: error: implicit declaration of function `unregister_chrdev',
在cs8900.c的文件中,写入 extern void unregister_chrdev(unsigned int,const char *);即可。
8.将新生成的uImage,下载到开发板,可以看到启动信息如下:
Cirrus Logic CS
eth0: CS
设置好nfs启动参数之后,linux系统就起来了。