知之者不如好之,好之者不如乐之
分类: LINUX
2008-08-19 15:46:43
|
根据移植的经验,先移植网卡,可以通过nfs挂载文件系统;如果有开发板的文件系统或可用的文件系统,也可以把这部分放在后面做,先把系统移植后,通过cramfs等文件系统启动,其前提是uboot的网卡驱动已经移植好,这样下载、调试会很方便。
1. 有关2.6内核的cs8900源码:
LINUX2.6.14下CS8900的移植(For 2410),带源码
[2410]移植CS8900到linux2.6
http://hi.baidu.com/aokikyon/blog/item/5ac125380661bdf4b211c7a2.html
cs8900a驱动移植 附cs8900.c和cs8900.h文件
http://blog.hjenglish.com/bedford/articles/811128.html
CS8900网卡移植
CS8900网卡移植
http://blog.chinaunix.net/u/27204/showart_373981.html
2.把cs8900.c,cs8900.h拷贝到drivers/net目录下
3.修改Drivers/net/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.
4.修改Drivers/net/Makeflie,增加以下内容:
obj-$(CONFIG_ARM_CS8900) += cs8900.o
5.把smdk2410.h 拷贝到include/asm-arm/arch-s3c2410目录下
smdk2410.h的内容为 :
#ifndef _INCLUDE_SMDK2410_H_
#define _INCLUDE_SMDK2410_H_
#include
#define pSMDK2410_ETH_IO 0x19000000
#define vSMDK2410_ETH_IO 0xE0000000
#define SMDK2410_ETH_IRQ IRQ_EINT9
#endif // _INCLUDE_SMDK2410_H_
写为下面的方式更好:
#define pSMDK2410_ETH_IO __phys_to_pfn(0x19000000)
#define vSMDK2410_ETH_IO 0xE0000000
#define SMDK2410_EHT_IRQ IRQ_EINT9
6.修改arch/arm/mach-s3c2410/mach-smdk2410.c
在static struct map_desc smdk2410_iodesc[] __initdata内增加以下部分(本来为空):
{vSMDK2410_ETH_IO, pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE},
以及增加包含头文件asm/arch/smdk2410.h
7.在内核配置中选上:
Device Drivers..>
Network device support…>
Ethernet (10 or 100 Mbit)
[*] CS8900 support.
8.根据有些网上介绍:在linux-2.6.16以后的版本好像要修改cs8900.c文件,但没验证,不知不修改是否有问题,具体修改如下:
并在cs8900_probe()函数中,memset (&priv,0,sizeof (cs8900_t));函数之后添加如下
两条语句:
__raw_writel(0x2211d110,S3C2410_BWSCON);
__raw_writel(0x1f7c,S3C2410_BANKCON3);
其他有关网卡移植的文章可参考:
移植cs8900网卡驱动
http://hi.baidu.com/428501/blog/item/9d399cfbf97e4061034f56ab.html
LINUX2.6.14下CS8900的移植(Fs2410)
http://hi.baidu.com/study_hard16/blog/item/6e2243def513665195ee3772.html
cs8900在2.6.14上的移植
http://blog.csdn.net/wu7104/archive/2007/05/08/1600190.aspx
CS8900A驱动在linux-2.6.16上的变化
cs8900在Linux-2.6.14.1内核上的移植
常见相思/blog/item/bbfc03d9b7428e2911df9ba1.html
基于s3c2410 2.6.25内核cs8900网卡驱动的移植
http://www.cppblog.com/040410615/archive/2008/05/24/50929.html
为方便修改我做如下备份:
config ARM_CS8900
tristate "CS8900 support"
depends on NET_ETHERNET && ARM && ARCH_SMDK2410
help
obj-$(CONFIG_ARM_CS8900) +=cs8900.o
#ifndef _INCLUDE_SMDK2410_H_
#define _INCLUDE_SMDK2410_H_
#include
#define pSMDK2410_ETH_IO 0x19000000
#define vSMDK2410_ETH_IO 0xE0000000
#define SMDK2410_ETH_IRQ IRQ_EINT9
#endif // _INCLUDE_REGS_CS8900_H
#include
{vSMDK2410_ETH_IO, pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE},