eCos DM9000网卡在MINI2440 QEMU的测试

发布时间:2024-06-26  

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:


文章来源于:电子工程世界    原文链接
本站所有转载文章系出于传递更多信息之目的,且明确注明来源,不希望被转载的媒体或个人可与我们联系,我们将立即进行删除处理。

我们与500+贴片厂合作,完美满足客户的定制需求。为品牌提供定制化的推广方案、专属产品特色页,多渠道推广,SEM/SEO精准营销以及与公众号的联合推广...详细>>

利用葫芦芯平台的卓越技术服务和新产品推广能力,原厂代理能轻松打入消费物联网(IOT)、信息与通信(ICT)、汽车及新能源汽车、工业自动化及工业物联网、装备及功率电子...详细>>

充分利用其强大的电子元器件采购流量,创新性地为这些物料提供了一个全新的窗口。我们的高效数字营销技术,不仅可以助你轻松识别与连接到需求方,更能够极大地提高“闲置物料”的处理能力,通过葫芦芯平台...详细>>

我们的目标很明确:构建一个全方位的半导体产业生态系统。成为一家全球领先的半导体互联网生态公司。目前,我们已成功打造了智能汽车、智能家居、大健康医疗、机器人和材料等五大生态领域。更为重要的是...详细>>

我们深知加工与定制类服务商的价值和重要性,因此,我们倾力为您提供最顶尖的营销资源。在我们的平台上,您可以直接接触到100万的研发工程师和采购工程师,以及10万的活跃客户群体...详细>>

凭借我们强大的专业流量和尖端的互联网数字营销技术,我们承诺为原厂提供免费的产品资料推广服务。无论是最新的资讯、技术动态还是创新产品,都可以通过我们的平台迅速传达给目标客户...详细>>

我们不止于将线索转化为潜在客户。葫芦芯平台致力于形成业务闭环,从引流、宣传到最终销售,全程跟进,确保每一个potential lead都得到妥善处理,从而大幅提高转化率。不仅如此...详细>>