原创 CS8900驱动的移植

2009-3-21 16:18 3123 3 3 分类: MCU/ 嵌入式

https://static.assets-stash.eet-china.com/album/old-resources/2009/3/20/2e4fb664-8819-472a-9383-8a8defd149c8.rar


把cs8900.c,cs8900.h拷贝到drivers/net目录下
修改Drivers/net/Kconfig,增加以下内容:
  config ARM_CS8900
     tristate "CS8900 support"
   depends on NET_ETHERNET && ARM && ARCH_SMDK2410
   help
 修改Drivers/net/Makeflie,增加以下内容:
  obj-$(CONFIG_ARM_CS8900)    += cs8900.o
把smdk2410.h 拷贝到include/asm-arm/arch-s3c2410目录下
smdk2410.h的内容为 :
#ifndef _INCLUDE_SMDK2410_H_
#define _INCLUDE_SMDK2410_H_
#include <linux/config.h>
#define pSMDK2410_ETH_IO        0x19000000
#define vSMDK2410_ETH_IO  0xE0000000
#define SMDK2410_ETH_IRQ   IRQ_EINT9
#endif // _INCLUDE_SMDK2410_H_
修改arch/arm/machs3c2410/machsmdk2410.c
在static struct map_desc smdk2410_iodesc[] __initdata内增加以下部分(本来为空):
   {vSMDK2410_ETH_IO, pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE},
以及增加包含头文件asm/arch/smdk2410.h
在内核配置中选上:
    Device Drivers..>
          Network device support…>
                  Ethernet (10 or 100 Mbit)
                       [*] CS8900 support.


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^     Welcome to YAFFS root filesystem!   ^
^                    Qiu                  ^
^^^^^^^^^^^^^^^^09-3-18^^^^^^^^^^^^^^^^^^^^
# mount all...........
# Starting mdev.........
starting pid 22, tty '': '/bin/sh'
[root@Qiu /]# ping 192.168.0.4
PING 192.168.0.4 (192.168.0.4): 56 data bytes
64 bytes from 192.168.0.4: seq="0" ttl="64" time="2".186 ms
64 bytes from 192.168.0.4: seq="1" ttl="64" time="0".623 ms
64 bytes from 192.168.0.4: seq="2" ttl="64" time="0".629 ms
64 bytes from 192.168.0.4: seq="3" ttl="64" time="0".623 ms
64 bytes from 192.168.0.4: seq="4" ttl="64" time="0".611 ms
64 bytes from 192.168.0.4: seq="5" ttl="64" time="0".639 ms


来自:http://blog.hjenglish.com/bedford/articles/811128.html

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
3
关闭 站长推荐上一条 /3 下一条