1,找到u-boot-2010.03/include/configs/smdk6410.h
//#define CONFIG_NET_MULTI
//#define CONFIG_CS8900 /*we have aCS8900on-board*/
//#define CONFIG_CS8900_BASE 0x18800300
//#define CONFIG_CS8900_BUS16 /*follow the Linux driver*/
/**然后添加DM9000网卡的宏定义---ip以及子网掩码等根据自己的需要修改***/
#defineCONFIG_NET_MULTI 1
#defineCONFIG_DM9000_NO_SROM 1
#defineCONFIG_dm9000
#defineCONFIG_DRIVER_DM9000 1
#defineCONFIG_DM9000_BASE 0x18800300
#defineDM9000_IO CONFIG_DM9000_BASE
#defineDM9000_DATA (CONFIG_DM9000_BASE+4)
#defineCONFIG_DM9000_USE_16BIT
#defineCONFIG_ETHADDR 00:40:5c:26:0a:5b
#defineCONFIG_NETMASK 255.255.255.0
#defineCONFIG_IPADDR 192.168.1.20
#defineCONFIG_SERVERIP 192.168.1.10
#defineCONFIG_GATEWAYIP 192.168.1.1
//#define CONFIG_DM9000_DEBUG
2,打开u-boot-2010.03/net/eth.c,找到int eth_initialize(bd_t *bis)函数:
#if defined(CONFIG_DB64460) || defined(CONFIG_P3Mx)
mv6446x_eth_initialize(bis);
#endif
/**
add here
*/
#if defined(CONFIG_DRIVER_DM9000)
dm9000_initialize(bis);
#endif
/**
add over
*/
3,打开u-boot-2010.03/net/net.c:
第一处:
//# define ARP_TIMEOUT 5000UL /* Milliseconds before trying ARP again */
# define ARP_TIMEOUT 5 /* Milliseconds before trying ARP again */
第二处:
// if ((t - NetArpWaitTimerStart) > ARP_TIMEOUT) {
if ((t - NetArpWaitTimerStart) > ARP_TIMEOUT*CONFIG_SYS_HZ) {
第三处:
// NetSetTimeout (10000UL, PingTimeout);
NetSetTimeout (10*CONFIG_SYS_HZ, PingTimeout);
4,打开u-boot-2010.03/net/tftp.c,找到void TftpStart (void)函数:
#if 0
/*
* Allow the user to choose TFTP blocksize and timeout.
* TFTP protocol has a minimal timeout of 1 second.
*/
if ((ep = getenv('tftpblocksize')) != NULL)
TftpBlkSizeOption = simple_strtol(ep, NULL, 10);
if ((ep = getenv('tftptimeout')) != NULL)
TftpTimeoutMSecs = simple_strtol(ep, NULL, 10);
if (TftpTimeoutMSecs < 1000) {
printf('TFTP timeout (%ld ms) too low, '
'set minimum = 1000 msn',
TftpTimeoutMSecs);
TftpTimeoutMSecs = 1000;
}
debug('TFTP blocksize = %i, timeout = %ld msn',
TftpBlkSizeOption, TftpTimeoutMSecs);
#endif
完成后重新编译。
5,测试网卡
在开发板上通过命令 printenv 查看网卡信息。
WU_SMDK6410 # printenv
bootargs=console=ttySAC,115200
bootcmd=nand read 0x50018000 0x60000 0x1c0000;bootm 0x50018000
bootdelay=10
baudrate=115200
ethaddr=00:40:5c:26:0a:5b
ipaddr=192.168.1.123
serverip=192.168.1.127
gatewayip=192.168.1.1
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial
ethact=dm9000
setenv serverip 192.168.X.XX --- 设置主机ip,该命令只是把设置保存到ram中,如果重启的话设置会重新回到原来的设置
saveenv --- 保存到flash中。
这时,我主机的ip:192.168.1.127,通过ping命令测试是否能连通:
WU_SMDK6410 # ping 192.168.1.127
dm9000 i/o: 0x18800300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 00:40:5c:26:0a:5b
operating at 100M full duplex mode
Using dm9000 device
host 192.168.1.127 is alive
这里成功连通,但也有时会出现开发板能ping通主机,但是主机却ping不通开发板的奇怪现象,但不影响开发板通过tftp下载主机上的文件,暂时没想通。
上一篇:移植u-boot-2010.03问题 --- 支持dnw
下一篇:移植u-boot-2010.03问题 --- No oob scheme defined for oobsize 32
推荐阅读最新更新时间:2026-03-23 11:10
- LDK120M12R 1.2V低压降稳压器典型应用(可调版)电路
- EVB-UTC2000-DFP、EVK-UTC2000 评估套件基于 UTC2000 USB 3.0/2.0 Type-A,即插即用 Type-C DFP
- LTC3219 演示板、250mA 通用九通道 LED 驱动器
- DC919A-D,LTC2204 CMOS 输出演示板,直流输入,40Msps 16 位 ADC,DC
- AD8618ARZ-REEL 二阶低通滤波器运算放大器的典型应用电路
- 使用 NXP Semiconductors 的 PCA9511A 的参考设计
- LT3091MPDE 恒流恒压实验室电源的典型应用
- ADR392B 4.096 Vout 微功率、低噪声精密电压基准的典型应用
- LT3470HDDB 5V 降压转换器的典型应用电路
- 使用 Diodes Incorporated 的 AZ7042ZTR-E1 的参考设计

dm9000cep网卡通信
CANopen移植工程(源代码)
uCOS-II移植到STM32的详细步骤
现代雷达系统的信号设计
BFR340T






京公网安备 11010802033920号