mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
net: Export auto_load, use it in rarp
The rarp code includes another instance of the auto_load logic, so call what is now net_auto_load() instead. This also fixes an incorrect call to TftpStart() which was never seen since apparently no boards enable rarp. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
ed1ada712a
commit
e4a3d57dc7
4 changed files with 39 additions and 49 deletions
30
net/net.c
30
net/net.c
|
@ -309,6 +309,36 @@ void ArpTimeoutCheck(void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if autoload is enabled. If so, use either NFS or TFTP to download
|
||||
* the boot file.
|
||||
*/
|
||||
void net_auto_load(void)
|
||||
{
|
||||
const char *s = getenv("autoload");
|
||||
|
||||
if (s != NULL) {
|
||||
if (*s == 'n') {
|
||||
/*
|
||||
* Just use BOOTP/RARP to configure system;
|
||||
* Do not use TFTP to load the bootfile.
|
||||
*/
|
||||
NetState = NETLOOP_SUCCESS;
|
||||
return;
|
||||
}
|
||||
#if defined(CONFIG_CMD_NFS)
|
||||
if (strcmp(s, "NFS") == 0) {
|
||||
/*
|
||||
* Use NFS to load the bootfile.
|
||||
*/
|
||||
NfsStart();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
TftpStart(TFTPGET);
|
||||
}
|
||||
|
||||
static void NetInitLoop(enum proto_t protocol)
|
||||
{
|
||||
static int env_changed_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue