手机版
你好,游客 登录 注册
背景:
阅读新闻

FL2440的U-boot-2010.09移植(三)DM9000网卡及开发板相关配置

[日期:2012-07-01] 来源:Linux社区  作者:yanghao23 [字体:大 中 小]

二、添加DM9000网卡的支持

(5)在board/fl2440/fl2440.c 中board_eth_init函数添加对dm9000的支持

  1. #ifdef CONFIG_CMD_NET   
  2. int board_eth_init(bd_t *bis)  
  3. {  
  4.     int rc = 0;  
  5. #ifdef CONFIG_CS8900   
  6.     rc = cs8900_initialize(0, CONFIG_CS8900_BASE);  
  7. #endif   
  8.   
  9. #ifdef CONFIG_DRIVER_DM9000   
  10.     rc = dm9000_initialize(bis);  
  11. #endif   
  12.     return rc;  
  13. }  
  14. #endif  

(6)然后修改include/configs/fl2440.h文件中关于网卡的宏定义,将原来的:

  1. #define CONFIG_NET_MULTI   
  2. #define CONFIG_CS8900       /* we have a CS8900 on-board */   
  3. #define CONFIG_CS8900_BASE  0x19000300   
  4. #define CONFIG_CS8900_BUS16 /* the Linux driver does accesses as shorts */  

修改为:

  1. #define CONFIG_NET_MULTI                 1   
  2. #define CONFIG_DRIVER_DM9000             1   
  3. #define CONFIG_DM9000_USE_16BIT          1   
  4. #define CONFIG_DM9000_BASE               0x20000300   
  5. #define DM9000_IO                        CONFIG_DM9000_BASE   
  6. #define DM9000_DATA                      (CONFIG_DM9000_BASE + 4)   
  7. #define CONFIG_DM9000_NO_SROM            1 //防止dm9000去从srom中读取物理地址信息  

并在98行附近添加

  1. #define CONFIG_CMD_DHCP   
  2. #define CONFIG_CMD_PING   /*****add by yanghao*****/   
  3. #define CONFIG_CMD_NET    /*add by yanghao*/  

并将104行附近

  1. /*#define CONFIG_ETHADDR    08:00:3e:26:0a:5b */  
  2. #define CONFIG_NETMASK          255.255.255.0   
  3. #define CONFIG_IPADDR       10.0.0.110   
  4. #define CONFIG_SERVERIP     10.0.0.1  

修改为:

  1. #define CONFIG_ETHADDR  08:00:3e:26:0a:5b    
  2. #define CONFIG_NETMASK          255.255.255.0   
  3. #define CONFIG_IPADDR       192.168.1.4   
  4. #define CONFIG_SERVERIP     192.168.1.1  

这里是修改开发板的IP地址和主机地址,需要将主机地址修改成“192.168.1.1”

 (7)打开driver/net/dm9000x.c文件,修改函数dm9000_halt,防止uboot在ping通主机后又马上断开连接的问题

  1. static void dm9000_halt(struct eth_device *netdev)  
  2. {  
  3.     DM9000_DBG("%s\n", __func__);  
  4. #if 0    //为了防止dm9000建立连接后又马上断开的情况   
  5.     /* RESET devie */  
  6.     phy_write(0, 0x8000);   /* PHY RESET */  
  7.     DM9000_iow(DM9000_GPR, 0x01);   /* Power-Down PHY */  
  8.     DM9000_iow(DM9000_IMR, 0x80);   /* Disable all interrupt */  
  9.     DM9000_iow(DM9000_RCR, 0x00);   /* Disable RX */  
  10. #endif   
  11. }  
linux
相关资讯       U-boot  FL2440 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款