U_boot中DM9000的驱动调试总结

来源:互联网 发布:业余网络兼职 编辑:程序博客网 时间:2024/04/29 13:14

开发环境:

开发板:S5PV210   PC操作系统:Ubuntu 14.04

U_boot采用的是TQ210提供的U_boot 1.3.4

下载工具:dnw

终端调试:minicom

拿到TQ210快一个月了,现在的系统还没有完全跑起来,最近在进行nfs挂载时总是挂载不上,确认nfs服务参数正确并开启后 ( /etc/init.d/nfs-kernel-service restart ),在PC机上进行本机挂载点测试成功。连接开发板至PC机,打开minicom启动U_boot 显示如下信息

#####    Boot for TQ210 Main Menu       #####
#####     EmbedSky USB download mode     #####


[1] Download bootloader (u-boot or bootimage) to Nand Flash
[2] Download WinCE NK image (NK.bin) to Nand Flash
[3] Download Linux Kernel (zImage.bin) to Nand Flash
[4] Download LOGO Picture (logo.bin) to Nand  Flash
[5] Download UBIFS image (root.ubi) to Nand Flash
[6] Download YAFFS image (root.bin) to Nand Flash
[7] Download Program to SDRAM and Run it
[8] Boot the system
[9] Format the Nand Flash
[0] Set the boot parameters
[a] Download User Program
[n] Enter TFTP download mode menu
[r] Reboot u-boot
[t] Test Linux Image (zImage)
[u] Download bootloader to SD Card
Enter your selection:

注意:此处没有任何提示进入控制台界面,点击q按键即可进入命令模式(搞了整整一个星期,用户手册未涉及)

打印环境变量如下printenv

TQ210 # printenv 
bootcmd=nand read.jffs2 0xc0008000 kernel;bootm 0xc0008000
bootdelay=0
baudrate=115200
ethaddr=00:40:5c:26:0a:5b
ipaddr=192.168.1.6
gatewayip=192.168.1.2
netmask=255.255.255.0
lcdtype=X800Y480
bootargs_defaults=setenv bootargs ${bootargs} lcd=${lcdtype}
bootloaderimgname=u-boot.bin
logoimgname=logo.bin
nkimgname=NK.bin
kernelimgname=zImage.bin
rootimgname=root.bin
mtdids=nand0=s5pv210-nand
mtdparts=mtdparts=s5pv210-nand:1m@0(bios),1m(params),3m(logo),5m(kernel),-(root)
nfsipaddr=192.168.1.8
nfsnetmask=255.255.255.0
nfs_dir=/nfs/rootfs_core_b
bootargs=noinitrd init=/init console=ttySAC0 root=/dev/nfs rootwait=1 nfsroot=192.168.1.106f
nfsserverip=192.168.1.106
stdin=serial
stdout=serial
stderr=serial
partition=nand0,0
mtddevnum=0
mtddevname=bios
serverip=192.168.1.106

随后ping PC主机IP, 显示如下信息:

TQ210 # ping 192.168.1.106                                                                  
ERROR: resetting DM9000 -> not responding                                                   
dm9000 i/o: 0x88000000, id: 0x90000a46                                                      
DM9000: running in 16 bit mode                                                              
MAC: 00:40:5c:26:0a:5b                                                                      
operating at 100M full duplex mode                                                          
ping failed; host 192.168.1.106 is not alive                                                

结合提示信息并查阅drivers/net/dm9000.c源码知道:网卡的ID号被正确读出,初始化工作也已经完成,在进行复位时发生失败。

然后进行nfs测试,显示结果如下:TQ210 # nfs                                                                                 
ERROR: resetting DM9000 -> not responding                                                   
dm9000 i/o: 0x88000000, id: 0x90000a46                                                      
DM9000: running in 16 bit mode                                                              
MAC: 00:40:5c:26:0a:5b                                                                      
operating at 100M full duplex mode                                                          
*** Warning: no boot file name; using '/nfsroot/C0A80106.img'                               
File transfer via NFS from server 192.168.1.106; our IP address is 192.168.1.6              
Filename '/nfsroot/C0A80106.img'.                                                           
Load address: 0x20000000       

U_boot中关于dm9000部分显示如下

/* Check whether the ethernet controller is present */
if ((DM9000_ior(DM9000_PIDL) != 0x0) ||
   (DM9000_ior(DM9000_PIDH) != 0x90))
{
printf("DM9000_PIDL = %x\n", DM9000_PIDL); 
printf("DM9000_PIDH = %x\n", DM9000_PIDH);
printf("ERROR: resetting DM9000 -> not responding\n");
}

下一步正在进行中。。。。                 


0 0