u-boot-2016.03 in the DM9000 of mini2440 transplant

Source: Internet
Author: User

U-boot The default network chip is CS8900, but the network chip on the Development Board is DM9000, so in order to use the network function, it must be ported. Fortunately U-boot has DM9000 driver, we just need to change the part about CS8900 to DM9000 part.

First, comment The following statement in Include/configs/smdk2410.h

#define CONFIG_CS8900 We have a CS8900 on-board
#define Config_cs8900_base 0x19000300
#define CONFIG_CS8900_BUS16 The Linux driver does accesses as shorts

Add the following statement:

#define CONFIG_DRIVER_DM9000
#define CONFIG_DM9000_NO_SROM//not Use the dm9000 eeprom
#define CONFIG_NET_RANDOM_ETHADDR//set the ethaddr
#define Config_lib_rand//random_ethadd need RAND function
#define Config_dm9000_base 0x20000300
#define DM9000_IO Config_dm9000_base
#define DM9000_DATA (config_dm9000_base + 4)//data address*/

Then define the default environment variables, add the MAC address first, then modify the board and the host's IP address:

#define Config_netmask 255.255.255.0
#define CONFIG_IPADDR 192.168.1.8//arm Board IP
#define CONFIG_SERVERIP 192.168.1.120//PC IP

Opening the Board_eth_init function in the board/samsung/smdk2410/smdk2410.c file adds the following in line 133:

#ifdef config_driver_dm9000
Rc= dm9000_initialize (bis);
#endif

To complete the above steps, the Development Board will be able to use the network function normally.

Operation Result:

When you see the last line "host192.168.1.120 is Alive", the network functionality is already working. If you want to get rid of the word "could not establish link" and speed up the operation, you can comment out the following statement within the Dm9000_init function in the drivers/net/dm9000x.c file:

i= 0;

while (!) ( Dm9000_phy_read (1) & 0x20) {/*autonegation complete bit */

Udelay (1000);

i++;

if (i = = 10000) {

printf ("Couldnot establish link\n");

Return0;

}

}

/*see what we ' ve got */

lnk= Dm9000_phy_read (+) >> 12;

printf ("Operatingat");

Switch (LNK) {

CASE1:

printf ("10M half Duplex");

Break

CASE2:

printf ("10M full Duplex");

Break

CASE4:

printf ("100M half Duplex");

Break

Case8:

printf ("100M full Duplex");

Break

Default

printf ("unknown:%d", LNK);

Break

}

u-boot-2016.03 in the DM9000 of mini2440 transplant

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.