通过使用uboot的网络功能可以更新ubook,烧写内核,文件系统,如果网络功能不可能,那还不如同变砖了一样.当然如果支持sd卡启动,可能通过sd卡完成这些功能,但是也太过麻烦了.飞凌的6410开发板提供的uboot的网络驱动是cs8900,但是实际上网卡是dm9000ae.
烧入后发无法ping通,tftp不可用,输出:
CS8900 Ethernet chip not found?!
下面,提供简单的修改方法,把驱动改为dm9000,让网络功能用起来.
1.修改include/configs/smdk6410.h
#ifdef CONFIG_DRIVER_SMC911X
#undef CONFIG_DRIVER_CS8900
#define CONFIG_DRIVER_SMC911X_BASE 0x18800300
#else
//注释掉下面3行
//#define CONFIG_DRIVER_CS8900 0 /* we have a CS8900 on-board */
//#define CS8900_BASE 0x18800300
//#define CS8900_BUS16 1 /* the Linux driver does accesses as shorts */
//增加下面4行
#define CONFIG_DRIVER_DM9000 1
#define CONFIG_DM9000_BASE 0x18000000
#define DM9000_IO CONFIG_DM9000_BASE
#define DM9000_DATA (CONFIG_DM9000_BASE+4)
#define CONFIG_DM9000_USE_16BIT
//#define CONFIG_DM9000_DEBUG
#endif
2.303行
从环境变量中读取MAC地址
把((u16 *) bd->bi_enetaddr)[i] = read_srom_word(i);替换为:
char *s, *e;
s = getenv ("ethaddr");
for (i = 0; i < 6; ++i)
{
bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0;
if (s)
s = (*e) ? e + 1 : e;
}
3.修改318行,修改0x00为0xff
修改MAR寄存器(Multicast Address Register)的值,修正第一次收不到数据的错误
for (i = 0, oft = 0x16; i < 8; i++, oft++)
DM9000_iow(oft,0x00);
//DM9000_iow(oft, 0xff);
4.413行
注释掉下面2行
修正一直无法收到数据的错误,不要每次调用halt的时候都对PHY进行复位操作,否则会引起无法接受到数据的情况
void
eth_halt(void)
{
DM9000_DBG("eth_haltn");
/* 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 */
}
这里只是根据别人的文章进行实现,的确可行,但是具体为什么这么做还有些问题需要自己去弄明白.
相关文章









