summaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-12-11 22:16:26 -0600
committerTom Rini <trini@ti.com>2012-12-13 11:46:55 -0700
commita9f51c9b4315f699e7185c85d1d09d2d7819a4eb (patch)
treea4ed6c3085eea661f229595001ce6c3d710fbf68 /net/net.c
parent5e2b3e0c59df3313254941b453ffeadba9e673ae (diff)
downloadu-boot-imx-a9f51c9b4315f699e7185c85d1d09d2d7819a4eb.zip
u-boot-imx-a9f51c9b4315f699e7185c85d1d09d2d7819a4eb.tar.gz
u-boot-imx-a9f51c9b4315f699e7185c85d1d09d2d7819a4eb.tar.bz2
env: Add a bootfile env handler
Remove the hard-coded bootfile handler and use a callback instead Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index da68a61..a40cde1 100644
--- a/net/net.c
+++ b/net/net.c
@@ -82,6 +82,7 @@
#include <common.h>
#include <command.h>
+#include <environment.h>
#include <net.h>
#if defined(CONFIG_STATUS_LED)
#include <miiphy.h>
@@ -208,6 +209,22 @@ static int NetTryCount;
/**********************************************************************/
+static int on_bootfile(const char *name, const char *value, enum env_op op,
+ int flags)
+{
+ switch (op) {
+ case env_op_create:
+ case env_op_overwrite:
+ copy_filename(BootFile, value, sizeof(BootFile));
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+U_BOOT_ENV_CALLBACK(bootfile, on_bootfile);
+
/*
* Check if autoload is enabled. If so, use either NFS or TFTP to download
* the boot file.