今天在u-boot对DM9000X网卡的支持的移植。最后通过tftp下载时候,遇到如下问题:
tf[u-boot@MINI2440]# tp 0x30000000 root_qtopia-128M.img
Filename 'root_qtopia-128M.img'.
Load address: 0x30000000
Loading: T ##########T T #####################################################T
##T T
Retry count exceeded; starting again
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 12:34:56:78:9a:bc
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 10.1.0.128; our IP address is 10.1.0.129
Filename 'root_qtopia-128M.img'.
Load address: 0x30000000
Loading: T ###T ###T T ########
一直无休止循环,经网上搜索得知Uboot 端 tftp 程序传过来的Timeout参数不符合服务器端定义引起的,Retry count exceeded; starting again
在uboot跟目录下,输入
gedit net/net.c
定位到104行附近,修改如下:
#if defined(CONFIG_CMD_NET)
DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_ARP_TIMEOUT
# define ARP_TIMEOUT
#else
# define ARP_TIMEOUT
#endif
定位到573行附近,修改如下:
#ifndef CONFIG_NET_MULTI
#else
定位到585行附近,修改如下:
eth_init (gd->bd);
定位到779行附近,修改如下:
#define CDP_SYSOBJECT_TLV
#define CDP_MANAGEMENT_ADDRESS_TLV 0x0016
#define CDP_TIMEOUT
static int CDPSeq;
static int CDPOK;
打开/net/tftp.c,
中端输入命令:gedit net/tftp.c
定位到16行,修改如下:
#define TIMEOUT
然后重新编译后下载测试:
[u-boot@MINI2440]# tftp 0x30000000 root_qtopia-128M.img
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 12:34:56:78:9a:bc
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 10.1.0.128; our IP address is 10.1.0.129
Filename 'root_qtopia-128M.img'.
Load address: 0x30000000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 12:34:56:78:9a:bc
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 10.1.0.128; our IP address is 10.1.0.129
Filename 'root_qtopia-128M.img'.
Load address: 0x30000000
Loading: #################################################################
done
Bytes transferred = 58487616 (37c7340 hex)
[u-boot@MINI2440]#
在yaffs2文件系统镜像下载到内存后:
[u-boot@MINI2440]# nand erase 0 0x40000
NAND erase: device 0 offset 0x0, size 0x40000
Erasing at 0x2000000000004 --
OK
[u-boot@MINI2440]# nand write 0x30000000 0 0x40000
NAND write: device 0 offset 0x0, size 0x40000
Writing at 0x2000000020000 -- 100% is complete. 262144 bytes written: OK
[u-boot@MINI2440]#