3.1 include/configs/micro2440.h
删除
#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 */
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 10.0.0.110
#define CONFIG_SERVERIP 10.0.0.1
添加
#define CONFIG_CMD_NET
#define CONFIG_DRIVER_DM9000 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)
#define CONFIG_CMD_PING
#define CONFIG_ETHADDR 08:00:3e:26:0a:5b //开发板MAC地址
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 192.168.10.126 //开发板IP地址
#define CONFIG_SERVERIP 192.168.10.124 //主机IP地址
【说明】
IP地址要根据实际情况自己设置, CONFIG_SERVERIP用于制定tftp等下载时的主机IP
3.2 board/samsung/micro2440/micro2440.c
int board_eth_init(bd_t *bis)
{
int rc = 0;
#ifdef CONFIG_CS8900
rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
#endif
#ifdef CONFIG_DRIVER_DM9000
rc = dm9000_initialize(bis);
#endif
return rc;
}
#endif
【说明】
到此,DM9000已经能初始化了,但是使用ping命令时,串口一直打印 "raise: Signal # 8 caught",下一步直接将该打印语句注释掉,经测试没有影响。
3.3 arch/arm/lib/eabi_compat.c
int raise (int signum)
{
#ifndef CONFIG_MICRO2440
printf("raise: Signal # %d caught/n", signum);
#endif
return 0;
}
【说明】
到这一步后可以ping通,但是总是出现了一个"could not establish link"的提示。按照下一步修改,这样修改的结果是第一次不能ping通,需使用Ctrl+C结束,以后即可ping通并使用tftp下载。
3.4 drivers/net/dm9000x.c
static int dm9000_init(struct eth_device *dev, bd_t *bd)
{
……
#ifndef CONFIG_MICRO2440
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
……
}
static void dm9000_halt(struct eth_device *netdev)
{
DM9000_DBG("%s/n", __func__);
#ifndef CONFIG_MICRO2440
/* 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
}