summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-10-07 20:19:16 -0700
committerSimon Glass <sjg@chromium.org>2015-10-21 07:46:26 -0600
commita4092dbd81ad8bcd7d405304f579b0b5b0c402ce (patch)
tree48f16c02f03aa9950e2d032a6deb7eecf266173f /common
parent7f0c3c51c2d455b7e12196ed91aa461cf86b9790 (diff)
downloadtalos-obmc-uboot-a4092dbd81ad8bcd7d405304f579b0b5b0c402ce.tar.gz
talos-obmc-uboot-a4092dbd81ad8bcd7d405304f579b0b5b0c402ce.zip
cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline
There are fields in VxWorks bootline for netmask and gatewayip. We can get these from U-Boot environment variables and pass them to VxWorks, just like ipaddr and serverip. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_elf.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 6c95851642..6a0937823f 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -288,13 +288,26 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
CONFIG_SYS_VXWORKS_SERVERNAME);
tmp = getenv("ipaddr");
- if (tmp)
- ptr += sprintf(build_buf + ptr, "e=%s ", tmp);
+ if (tmp) {
+ ptr += sprintf(build_buf + ptr, "e=%s", tmp);
+ tmp = getenv("netmask");
+ if (tmp) {
+ __be32 addr = getenv_ip("netmask").s_addr;
+ ptr += sprintf(build_buf + ptr, ":%08x ",
+ ntohl(addr));
+ } else {
+ ptr += sprintf(build_buf + ptr, " ");
+ }
+ }
tmp = getenv("serverip");
if (tmp)
ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
+ tmp = getenv("gatewayip");
+ if (tmp)
+ ptr += sprintf(build_buf + ptr, "g=%s ", tmp);
+
tmp = getenv("hostname");
if (tmp)
ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
OpenPOWER on IntegriCloud