天嵌 ARM开发社区

 找回密码
 注册
查看: 2966|回复: 3

u-boot-2010.06移植到TQ2440-网络DM9000移植问题

[复制链接]
奋斗澜颜 发表于 2012-10-27 09:54:31 | 显示全部楼层 |阅读模式
移植参考:http://blog.csdn.net/it_114/article/details/6264970
 楼主| 奋斗澜颜 发表于 2012-10-27 09:55:29 | 显示全部楼层
问题就是怎么也ping不通呀!!!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

 楼主| 奋斗澜颜 发表于 2012-10-27 09:59:17 | 显示全部楼层
参考的移植步骤:
1、u-boot-2011.03默认的网卡是CS8900,所以要先把它屏蔽掉
/*
#define CONFIG_NET_MULTI
#define CONFIG_CS8900  /* we have a CS8900 on-board */
#define CONFIG_CS8900_BASE 0x19000300
#define CONFIG_CS8900_BUS16 /* the Linux driver does accesses as shorts */
*/
//添加u-boot对DM9000X网卡的支持
#define CONFIG_DRIVER_DM9000  1
#define CONFIG_NET_MULTI      1
#define CONFIG_DM9000_NO_SROM 1
#define CONFIG_DM9000_BASE 0x20000300 //网卡片选地址
#define DM9000_IO CONFIG_DM9000_BASE
#define DM9000_DATA (CONFIG_DM9000_BASE + 4) //网卡数据地址

//在102行处添加命令,下面红色部分
#define CONFIG_CMD_CACHE
#define CONFIG_CMD_DATE
#define CONFIG_CMD_ELF
//给uboot加上ping命令,用来测试网络通不通
#define CONFIG_CMD_PING
//添加网卡支持命令
#define CONFIG_CMD_NET
//恢复被注释掉的网卡MAC地址
#define CONFIG_ETHADDR     08:00:3e:26:0a:5b//TQ2440dm9000xmac地址
#define CONFIG_NETMASK      255.255.255.0//子网掩码
#define CONFIG_IPADDR  192.168.0.9//TQ2440IP地址
#define CONFIG_SERVERIP  192.168.0.15//主机(PC)IP地址

2、修改板载DM9000网卡初始化代码
#ifdef CONFIG_CMD_NET
int board_eth_init(bd_t *bis)
{
int rc = 0;
#ifdef CONFIG_DRIVER_DM9000
rc = dm9000_initialize(bis);
#endif
return rc;
}
3、修改网卡驱动bug
<1>//屏蔽掉dm9000_init函数中的这一部分,不然使用网卡的时候会报“could not establish link”的错误
#if 0
i = 0;
while (!(phy_read(1) & 0x20))
{ /* autonegation complete bit */
  udelay(1000);
  i++;
  if (i == 10000)
  {
   printf("could not establish link/n");
   return 0;
  }
}
#endif
<2>//屏蔽掉dm9000_halt函数中的内容
static void dm9000_halt(struct eth_device *netdev)
{
#if 0
DM9000_DBG("%s/n", __func__);
/* RESET devie */
phy_write(0, 0x8000); /* PHY RESET */
DM9000_iow(DM9000_GPR, 0x01); /* Power-Down PHY */
DM9000_iow(DM9000_IMR, 0x80); /* Disable all interrupt */
DM9000_iow(DM9000_RCR, 0x00); /* Disable RX */
#endif
}

回复

使用道具 举报

 楼主| 奋斗澜颜 发表于 2012-10-30 19:29:00 | 显示全部楼层
原来得用有线网!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2025-6-18 07:19 , Processed in 2.040389 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表