主题 : 有人跑通了光盘里面的uboot的tftp功能吗? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 447
精华: 0
发帖: 3
金钱: 40 两
威望: 40 点
贡献值: 0 点
综合积分: 6 分
注册时间: 2008-04-03
最后登录: 2010-04-16
楼主  发表于: 2009-05-11 17:34

 有人跑通了光盘里面的uboot的tftp功能吗?

管理提醒: 本帖被 arm9home 从 Linux技术交流专区 移动到本区(2010-02-08)
我跑了一下,发现出这个错误:
receiving packet
rx status: 0x0001 rx len: 1
rx status check: 35
receiving packet
rx status: 0x0923 rx len: 392
rx fifo error
rx status check: 255
receiving packet
rx status: 0xffff rx len: 7423
rx fifo error
rx crc error
rx length error
rx length too big
resetting
rx status check: 255
receiving packet
rx status: 0xffff rx len: 65535

dm9000x.c的驱动也没看出什么异常。
不知道,各位是怎么解决的?
级别: 新手上路
UID: 8071
精华: 0
发帖: 16
金钱: 90 两
威望: 24 点
贡献值: 0 点
综合积分: 32 分
注册时间: 2009-08-08
最后登录: 2015-03-26
1楼  发表于: 2009-08-31 12:06
顶一下,版主有空关注一下吧,我折腾了两天了,很多人都发现了这个问题,但我在网上找了很多人修改dm9000x驱动的例子,我都照做了,但没有一个能做成功的。
友善之臂的工程师门为什么把USB下载做出来了,最常用的tftp功能却要避开呢?
或者有高人已经做成功的,可否分享一下经验啊,谢谢!
我现在有几个比较关键的问题需要问
1. #define CONFIG_DM9000_BASE            0x20000000
这个地址到底是怎么定义,按我的理解因为是nGCS4控制,因该是0x20000000,但网上很多人说是0x20000300,这个0x300是如何来的,至今没一个人能够清楚的说明

2. 在eth_init(bd_t * bd)函数中
    /* Set Node address */
    for (i = 0; i < 6; i++)
        ((u16 *) bd->bi_enetaddr) = read_srom_word(i);
每次设的MAC地址跟环境变量中的不一至,现在按网上有人提供的方法改为
    for (i=0; i<6; i++) {
        bd->bi_enetaddr = tmp ? simple_strtoul(tmp, &end, 16) : 0;
        if (tmp)
            tmp = (*end) ? end+1 : end;
    }
后,MAC地址基本上初始化正确了,但是还是会出现"could not establish link"错误提示,说明前面对各个寄存器的配置没有成功。是否硬件上还有一些应该特别注意的地方?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2009-08-31 15:17
1. #define CONFIG_DM9000_BASE            0x20000000
这个地址到底是怎么定义,按我的理解因为是nGCS4控制,因该是0x20000000,但网上很多人说是0x20000300,这个0x300是如何来的,至今没一个人能够清楚的说明

如果你看过DM9000的datasheet(http://pdfdata.datasheetsite.com/web/29472/DM9000.pdf)就会知道,是0x20000000还是0x20000300或者别的什么, 取决于DM9000的PIN#92 CMD的连接。
92 CMD I Command Type
When high, the access of this command cycle is DATA port
When low, the access of this command cycle is ADDRESS port

也就是说,可以认为DM9000只有两个地址,一个用来写address,一个用来写data, 两个地址的区别只有一个bit(CMD PIN连接的那个地址PIN)。
在Mini2440上,DM9000的片选接的是CS4,CMDpin接的是ADDR2,所以address地址是0x20000000 (ADDR2 = 0), data地址是0x20000004 (ADDR2 = 1)。
至于网络上流传的0x20000300, 应该是某块开发板上,DM9000的CMD PIN接到了ADDR9或者ADDR8上。
很有趣的一点是,DM9000只受这一根地址PIN的影响,因此0x20000304和0x20000004对它来说是没有区别的。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 8071
精华: 0
发帖: 16
金钱: 90 两
威望: 24 点
贡献值: 0 点
综合积分: 32 分
注册时间: 2009-08-08
最后登录: 2015-03-26
3楼  发表于: 2009-08-31 21:13
多谢版主的回复,我现在的u-boot跑的情况如下:
U-Boot 1.1.6 (Aug 31 2009 - 21:03:10)

DRAM:  64 MB
Flash:  1 MB
NAND:  64 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Use these steps to program the image to flash:
1. In OpenOCD
   Run the 'halt' command to halt u-boot
   Run the 'load_image <file> <address>' command to load file to SDRAM
   Run the 'resume' command to resume u-boot
2. In u-boot, use the flash commands to program the image to flash
Or, use the tftp or nfs command to download file, and then program the flash.
FA24x0> tftp 30000000 u-boot.bin
eth_halt
phy_write(reg:0, value:32768)
eth_init()
resetting
dm9000 i/o: 0x20000300, id: 0x90000a46
phy_read(3): 32768
MAC: 08:00:3e:26:0a:5b
08:00:3e:26:0a:5b:
TFTP from server 192.168.1.100; our IP address is 192.168.1.70
Filename 'u-boot.bin'.
Load address: 0x30000000
Loading: eth_send: length: 42

Send: 02x: ff ff ff ff ff ff 08 00
Send: 02x: 3e 26 0a 5b 08 06 00 01
Send: 02x: 08 00 06 04 00 01 08 00
Send: 02x: 3e 26 0a 5b c0 a8 01 46
Send: 02x: 00 00 00 00 00 00 c0 a8
Send: 02x: 01 64
transmit done

T eth_send: length: 42

Send: 02x: ff ff ff ff ff ff 08 00
Send: 02x: 3e 26 0a 5b 08 06 00 01
Send: 02x: 08 00 06 04 00 01 08 00
Send: 02x: 3e 26 0a 5b c0 a8 01 46
Send: 02x: 00 00 00 00 00 00 c0 a8
Send: 02x: 01 64
transmit done

发送是没有什么问题,但就是收不到回应,我没有打开防火墙,环境变是设置如下:
bootargs=noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
bootcmd=nand read.jffs2 0x32000000 kernel; bootm 0x32000000
bootdelay=3
baudrate=115200
ethaddr=08:00:3e:26:0a:5b
ipaddr=192.168.1.70
serverip=192.168.1.100
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial
mtdids=nand0=nandflash0
mtdparts=mtdparts=nandflash0:2m@0(kernel),8m(jffs2),-(yaffs)
partition=nand0,0
mtddevnum=0
mtddevname=kernel
我就在这里腾了很久,还望版主帮忙分析分析!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2009-08-31 22:44
确保192.168.1.100上的tftp server已经开启,并且可以从另一台电脑上通过tftp下载文件
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."