The execution process of Nic dm9000 (U-boot version: u-boot-1.1.6):
Inside the BOARD.C there are eth_initialize (GD->BD);
The implementation of Eth_initialize is in eth.c, but there is no dm9000 initialization in the Eth_initialize function eth_init
It is common to have nfs,tftp,ping command to use the network equipment, can start from here.
U_boot_cmd (
Ping, 2, 1, do_ping,
"Ping\t-send ICMP echo_request to Network host\n",
"Pingaddress\n"
);
and its processing function do_ping as follows:
int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
if (ARGC < 2)
return-1;
NETPINGIP = String_to_ip (argv[1]);
if (Netpingip = = 0) {
printf ("usage:\n%s\n", cmdtp->usage);
return-1;
}
if (Netloop (PING) < 0) {
printf ("Ping failed; Host%s is not alive\n ", argv[1]);
return 1;
}
printf ("Host%s is alive\n", argv[1]);
return 0;
}
Look at the red mark above the Netloop, in the net.c inside the realization
Eth_halt (); Stop the interface.
#ifdef Config_net_multi
Eth_set_current ();
#endif
if (Eth_init (BD) < 0) {//Call initialization function, if cs8900 is defined, use cs8900 eth_init function, here dm9000
Eth_halt ();
Return (-1);
}
Netloop the prototype of the function, the parameter is the proto_t struct pointer
int Netloop (proto_t protocol)
and proto_t has:
typedef enum {BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, Netcons, SNTP} proto_t;
The above shows that when using commands such as Bootp,tftp,ping,nfs, the Netloop is called, which corresponds to the configuration initialization of the various network cards.
Above, is the top layer of the dm9000 call process, the following see DM9000X.C execution process
Entrance Eth_init
1. Reset device resets to detect network connection type
2. Nic Type:fastether, Homerun, LongRun NIC type
3. GPIO0 on pre-activate PHY set Gpio
4. Set PHY setting operation mode
5, program operating register set registers
dm9000 of u-boot-1.1.6 transplantation