eCos DM9000网卡在MINI2440 QEMU的测试

发布者:chunying最新更新时间:2024-06-26 来源: elecfans关键字:eCos  DM9000网卡  MINI2440  QEMU 手机看文章 扫描二维码
随时随地手机看文章

1. 中断部分的修改  

加入中断配置,严格按照原来的架构。

相关阅读: Redboot 的DM9000 网卡驱动在 MINI2440平台的移植  http://www.linuxidc.com/Linux/2011-03/33439.htm

ricky@ricky-laptop:/opt/ecos/ecos-hg$ hg diff
diff -r 62c4efcc7b5b packages/devs/eth/arm/mini2440/current/include/mini2440_eth_driver.inl
--- a/packages/devs/eth/arm/mini2440/current/include/mini2440_eth_driver.inl    Mon Mar 14 23:13:43 2011 +0800
+++ b/packages/devs/eth/arm/mini2440/current/include/mini2440_eth_driver.inl    Tue Mar 15 17:17:37 2011 +0800
@@ -63,7 +63,8 @@
     mac_address: CYGDAT_DEVS_ETH_ARM_MINI2440_ETH0_ESA,
 #endif
     io_addr: (volatile unsigned char *)0x20000300,
-    io_data: (volatile unsigned char *)0x20000304
+    io_data: (volatile unsigned char *)0x20000304,
+    interrupt: CYGNUM_HAL_INTERRUPT_EINT4_7
 };
 
 ETH_DRV_SC(dm9000_sc0,
diff -r 62c4efcc7b5b packages/hal/arm/arch/current/src/vectors.S
--- a/packages/hal/arm/arch/current/src/vectors.S    Mon Mar 14 23:13:43 2011 +0800
+++ b/packages/hal/arm/arch/current/src/vectors.S    Tue Mar 15 17:17:37 2011 +0800
@@ -393,7 +393,7 @@
 
         LED 4
 
-#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
+#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM) ||defined(CYG_HAL_STARTUP_QEMU)
         // Set up reset vector
         ldr     r0,=CYGHWR_HAL_VECTOR_TABLE_BASE
         ldr     r1,.__exception_handlers
@@ -405,6 +405,8 @@
         str     r2,[r0,#HAL_ARM_RESET_VECTOR_ADDR]
 #  endif
 # endif
+#endif
+#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
         // Relocate [copy] data from ROM to RAM
         ldr     r3,.__rom_data_start
         ldr     r4,.__ram_data_start
diff -r 62c4efcc7b5b packages/hal/arm/arm9/mini2440/current/src/mini2440_misc.c
--- a/packages/hal/arm/arm9/mini2440/current/src/mini2440_misc.c    Mon Mar 14 23:13:43 2011 +0800
+++ b/packages/hal/arm/arm9/mini2440/current/src/mini2440_misc.c    Tue Mar 15 17:17:37 2011 +0800
@@ -307,6 +307,13 @@
     HAL_WRITE_UINT32(EXTINT0, 0x12222222);    // EINT[7:0]
     HAL_WRITE_UINT32(EXTINT1, 0x22222222);    // EINT[15:8]
     HAL_WRITE_UINT32(EXTINT2, 0x22222222);    // EINT[23:16]
+
+
+    //ENABLE EXTERN INT
+    //EINT DM9000 INT UNMASK
+    HAL_READ_UINT32(EINTMASK, reg);
+    reg &= (~(1<<7));
+    HAL_WRITE_UINT32(EINTMASK, reg);
 }

2. 网络测试  

ecosconfig new mini2440 net

ecosconfig tree

make

 

make tests 

在install目录里面的tests有网络部分的测试,但是ping_lo_test失败,感觉不太像我移植的错误。

我把ping_lo_test拉了出来重新编译,发现可以用了。 

[cyg_net_init] Init: loopattach(0x00000000)
[cyg_net_init] Init: ifinit(0x00000000)
[cyg_net_init] Init: domaininit(0x00000000)
[cyg_net_init] Init: cyg_net_add_domain(0x000465c8)
New domain internet at 0x00000000
[cyg_net_init] Init: cyg_net_add_domain(0x00046038)
New domain route at 0x00000000
[cyg_net_init] Init: call_route_init(0x00000000)
[cyg_net_init] Done
Start PING test
BOOTP[eth0] op: REPLY
       htype: Ethernet
        hlen: 6
        hops: 0
         xid: 0x0
        secs: 0
       flags: 0x0
       hw_addr: 00:31:2d:78:81:01
     client IP: 192.168.1.2
         my IP: 192.168.1.2
     server IP: 192.168.1.101
    gateway IP: 192.168.1.1
  options:
        subnet mask: 255.255.255.0
       IP broadcast: 192.168.1.255
            gateway: 192.168.1.1
[eth_drv_ioctl] Warning: Driver can't set multi-cast mode
[eth_drv_ioctl] Warning: Driver can't set multi-cast mode
[eth_drv_ioctl] Warning: Driver can't set multi-cast mode
PING server 127.0.0.1
NIC collision bug detected!
64 bytes from 127.0.0.1: icmp_seq=0, time=10ms
64 bytes from 127.0.0.1: icmp_seq=1, time=0ms
64 bytes from 127.0.0.1: icmp_seq=2, time=0ms
64 bytes from 127.0.0.1: icmp_seq=3, time=0ms
64 bytes from 127.0.0.1: icmp_seq=4, time=0ms
64 bytes from 127.0.0.1: icmp_seq=5, time=0ms
64 bytes from 127.0.0.1: icmp_seq=6, time=0ms
64 bytes from 127.0.0.1: icmp_seq=7, time=0ms
64 bytes from 127.0.0.1: icmp_seq=8, time=0ms
64 bytes from 127.0.0.1: icmp_seq=9, time=0ms
64 bytes from 127.0.0.1: icmp_seq=10, time=0ms
64 bytes from 127.0.0.1: icmp_seq=11, time=0ms
64 bytes from 127.0.0.1: icmp_seq=12, time=0ms
64 bytes from 127.0.0.1: icmp_seq=13, time=0ms
64 bytes from 127.0.0.1: icmp_seq=14, time=0ms
64 bytes from 127.0.0.1: icmp_seq=15, time=0ms
Sent 16 packets, received 16 OK, 0 bad
PING server 127.0.0.33
NIC collision bug detected!
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
Sent 16 packets, received 0 OK, 0 bad
PING server 127.0.0.1
64 bytes from 127.0.0.1: icmp_seq=0, time=0ms
64 bytes from 127.0.0.1: icmp_seq=1, time=0ms
64 bytes from 127.0.0.1: icmp_seq=2, time=0ms
64 bytes from 127.0.0.1: icmp_seq=3, time=0ms
64 bytes from 127.0.0.1: icmp_seq=4, time=0ms
64 bytes from 127.0.0.1: icmp_seq=5, time=0ms
64 bytes from 127.0.0.1: icmp_seq=6, time=0ms
64 bytes from 127.0.0.1: icmp_seq=7, time=0ms
64 bytes from 127.0.0.1: icmp_seq=8, time=0ms
64 bytes from 127.0.0.1: icmp_seq=9, time=0ms
64 bytes from 127.0.0.1: icmp_seq=10, time=0ms
64 bytes from 127.0.0.1: icmp_seq=11, time=0ms
64 bytes from 127.0.0.1: icmp_seq=12, time=0ms
64 bytes from 127.0.0.1: icmp_seq=13, time=0ms
64 bytes from 127.0.0.1: icmp_seq=14, time=0ms
64 bytes from 127.0.0.1: icmp_seq=15, time=0ms
Sent 16 packets, received 16 OK, 0 bad
PING server 127.0.0.33
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
Sent 16 packets, received 0 OK, 0 bad
PASS:
EXIT:


关键字:eCos  DM9000网卡  MINI2440  QEMU 引用地址:eCos DM9000网卡在MINI2440 QEMU的测试

上一篇:eCos在mini2440 Qemu的网络功能测试
下一篇:eCos Configuration Tool build on ubuntu 10.04 AMD64

推荐阅读最新更新时间:2026-03-21 20:24

eCosmini2440 Qemu的网络功能测试
终于可以方便的用mini2440 qemu的网络功能了, 大家参考一下雪松的这篇帖子《QEMU MINI2440 的 Linux Fedora 8 下网络配置 》http://www.linuxidc.com/Linux/2011-09/42195.htm 既然可以这样用了,我重新整理了mini2440的redboot 1. 根据qemu对dm9000模拟的限制,对dm9000驱动程序做了新的修改 2. ecos的看家绝技,gdb调试应用程序 根据雪松的修改,现在可以用arm-eabi-gdb 的target remote来做ecos 应用程序的单步调试了 3. ecos的httpd 在mini2440 qemu的测试
[单片机]
<font color='red'>eCos</font>在<font color='red'>mini2440</font> <font color='red'>Qemu</font>的网络功能测试
u-boot-2009.08在mini2440上的移植 增加DM9000网卡驱动
移植环境 1,主机环境:VMare下CentOS 5.5 ,1G内存。 2,集成开发环境:Elipse IDE 3,编译编译环境:arm-linux-gcc v4.4.3,arm-none-eabi-gcc v4.5.1。 4,开发板:mini2440,2M nor flash,128M nand flash。 5,u-boot版本:u-boot-2009.08 u-boot-2009.08版本已经对CS8900、RTL8019和DM9000X等网卡有比较完善的代码支持(代码在drivers/net/目录下),而且在S3C24XX系列中默认对CS8900网卡进行配置使用。而mini2440开发板使用的则是DM9000网卡芯片
[单片机]
U-Boot在FL2440上移植(四)----支持网卡DM9000和烧写yaffs文件系统
一 支持网卡芯片DM9000 在driver下,有网卡驱动DM9000x.c 和 DM9000x.h DM9000接在BANK4,位宽16 在include/configs/TX2440.h中设置网卡基地址: 在56行处,将CS8900的定义改成: #define CONFIG_DRIVER_DM9000 1 #define CONFIG_DM9000_BASE 0x20000300 #define DM9000_IO CONFIG_DM9000_BASE #define DM9000_DATA (CONFIG_DM9000_BASE + 4) #define CONFIG_DM9000_USE_16BIT
[单片机]
cortex-a8 uboot系列:第十七章 uboot移植-网卡DM9000移植
一、网卡基础知识 1.网卡芯片与开发板的连接方式 总线式连接方式,使用SROM总线接口。 开发板核心板,使用SROM控制器的bank1。因此有效地址是0x8800_0000 – 0xffff_ffff。 开发板上DM9000的连接。使用16-bit数据连接方式 网卡芯片有CS引脚,(CS就是chip_select,选线信号,主机向CS发送有效信号则从机芯片工作,主机向CS发送无效信号则从机芯片不工作)。这个引脚要接soc的srom控制器的片选引脚。 主机s5pv210的srom控制器每一个bank都有一个片选信号CSn(n=0-5),这里接CSn1,说明DM9000接的是srom的bank1。 所以,可以
[单片机]
cortex-a8 uboot系列:第十七章 uboot移植-<font color='red'>网卡</font><font color='red'>DM9000</font>移植
ARM-Linux驱动--DM9000网卡驱动分析(三)
ARM-Linux驱动--DM9000网卡驱动分析(二)硬件平台:FL2440(s3c2440) 内核版本:2.6.35 主机平台:Ubuntu11.04 内核版本:2.6.39 交叉编译器:arm-linuc-gcc4.3.2 原创作品,转载请标明出处http://blog.csdn.net/yming0221/article/details/6615027 本文接上文 ARM-Linux驱动--DM9000网卡驱动分析(一) ARM-Linux驱动--DM9000网卡驱动分析(二) 下面开始看网卡设备的打开、关闭函数和操作函数 view plainprint? static const struct net_
[单片机]
ARM-Linux驱动--<font color='red'>DM9000</font><font color='red'>网卡</font>驱动分析(三)
单片机驱动DM9000网卡芯片
4、验证初始化中的各个函数。 下面我们来看一下,上面所写的初始化函数是否可用。以上我们写好了三个函数,分别为 DM9000_init(),sendpacket()和receivepacket(),保存并命名为dm9000.c。既然我们要进行调试,当 然要有结果输出,根据自己的处理器的情况写一个串口程序,这些函数是学某个单片机的基础,这里不 做详细介绍,用到是时候会在函数里注释一下。 接下来我们来写个主函数,新建C文件,命名为mian.c,填写如下函数: void main(void) { unsigned int i; unsigned char c; uart0_init(
[单片机]
单片机驱动<font color='red'>DM9000</font><font color='red'>网卡</font>芯片
ubuntu下使用qemu模拟ARM(六)------驱动程序
驱动程序分为在ubuntu上运行和在ARM开发板上运行两种,我们分别来进行测试 1.源码 empty#include linux init.h= #include linux module.h= static int hello_init(void) { printk(KERN_EMERG Enter Hello abc World!n ); return 0; } static void hello_exit(void) { printk(KERN_EMERG Exit hello world!n ); } module_init(hello
[单片机]
Qemu运行/调试arm linux
用Qemu运行/调试arm linux,这事情干过好几次了,久了就忘记了,每次都要重新去查资料,浪费不少时间。这次把整个过程弄成个脚本,放到github上,需要是拿下来运行一下即可,方便自己也方便有需要的朋友。这里解释一下脚本的内容(运行系统Ubuntu 16.04 LTS): 1. 设置一些环境变量,可以根据自己需要修改。 export ARCH=arm export MACHINE=vexpress export TARGET=arm-linux export GDB_VERSION=8.0 export KERNEL_VERSION=4.4.1 export BUSYBOX_VERSION=1.25.1 export C
[单片机]
小广播
最新单片机文章
何立民专栏 单片机及嵌入式宝典

北京航空航天大学教授,20余年来致力于单片机与嵌入式系统推广工作。

厂商技术中心

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

电子工程世界版权所有 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2026 EEWORLD.com.cn, Inc. All rights reserved