日韩一区二区三区精品,欧美疯狂xxxxbbbb牲交,热99re久久免费视精品频,人妻互换 综合,欧美激情肉欲高潮视频

移植u-boot-2010.03問(wèn)題 --- 網(wǎng)卡DM9000

發(fā)布者:EnchantedMagic最新更新時(shí)間:2024-10-18 來(lái)源: cnblogs關(guān)鍵字:移植  u-boot 手機(jī)看文章 掃描二維碼
隨時(shí)隨地手機(jī)看文章

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網(wǎng)卡的宏定義---ip以及子網(wǎng)掩碼等根據(jù)自己的需要修改***/


#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,打開(kāi)u-boot-2010.03/net/eth.c,找到int eth_initialize(bd_t *bis)函數(shù):


#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,打開(kāi)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,打開(kāi)u-boot-2010.03/net/tftp.c,找到void TftpStart (void)函數(shù):


#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,測(cè)試網(wǎng)卡

開(kāi)發(fā)板上通過(guò)命令 printenv 查看網(wǎng)卡信息。


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 --- 設(shè)置主機(jī)ip,該命令只是把設(shè)置保存到ram中,如果重啟的話設(shè)置會(huì)重新回到原來(lái)的設(shè)置


saveenv --- 保存到flash中。


這時(shí),我主機(jī)的ip:192.168.1.127,通過(guò)ping命令測(cè)試是否能連通:


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         


這里成功連通,但也有時(shí)會(huì)出現(xiàn)開(kāi)發(fā)板能ping通主機(jī),但是主機(jī)卻ping不通開(kāi)發(fā)板的奇怪現(xiàn)象,但不影響開(kāi)發(fā)板通過(guò)tftp下載主機(jī)上的文件,暫時(shí)沒(méi)想通。


關(guān)鍵字:移植  u-boot 引用地址:移植u-boot-2010.03問(wèn)題 --- 網(wǎng)卡DM9000

上一篇:移植u-boot-2010.03問(wèn)題 --- 支持dnw
下一篇:移植u-boot-2010.03問(wèn)題 --- No oob scheme defined for oobsize 32

小廣播
設(shè)計(jì)資源 培訓(xùn) 開(kāi)發(fā)板 精華推薦

最新單片機(jī)文章

 
EEWorld訂閱號(hào)

 
EEWorld服務(wù)號(hào)

 
汽車(chē)開(kāi)發(fā)圈

 
機(jī)器人開(kāi)發(fā)圈

電子工程世界版權(quán)所有 京ICP證060456號(hào) 京ICP備10001474號(hào)-1 電信業(yè)務(wù)審批[2006]字第258號(hào)函 京公網(wǎng)安備 11010802033920號(hào) Copyright ? 2005-2025 EEWORLD.com.cn, Inc. All rights reserved