summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-12-11 22:16:30 -0600
committerTom Rini <trini@ti.com>2012-12-13 11:46:56 -0700
commite080d545f8ffb104a13b07deddf92ecb498b3a94 (patch)
tree47c557775a04438777165ffbfc752888bcf3f805 /common
parent849d5d9cda0e7c94797874d842e9b132ec45a565 (diff)
downloadu-boot-imx-e080d545f8ffb104a13b07deddf92ecb498b3a94.zip
u-boot-imx-e080d545f8ffb104a13b07deddf92ecb498b3a94.tar.gz
u-boot-imx-e080d545f8ffb104a13b07deddf92ecb498b3a94.tar.bz2
env: Add a silent env handler
The silent variable now updates the global data flag anytime it is changed as well as after the env relocation (in case its value is different from the default env in such cases as NAND env) Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'common')
-rw-r--r--common/console.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index 270170b..bf73178 100644
--- a/common/console.c
+++ b/common/console.c
@@ -73,6 +73,29 @@ static int on_console(const char *name, const char *value, enum env_op op,
}
U_BOOT_ENV_CALLBACK(console, on_console);
+#ifdef CONFIG_SILENT_CONSOLE
+static int on_silent(const char *name, const char *value, enum env_op op,
+ int flags)
+{
+#ifndef CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
+ if (flags & H_INTERACTIVE)
+ return 0;
+#endif
+#ifndef CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC
+ if ((flags & H_INTERACTIVE) == 0)
+ return 0;
+#endif
+
+ if (value != NULL)
+ gd->flags |= GD_FLG_SILENT;
+ else
+ gd->flags &= ~GD_FLG_SILENT;
+
+ return 0;
+}
+U_BOOT_ENV_CALLBACK(silent, on_silent);
+#endif
+
#ifdef CONFIG_SYS_CONSOLE_IS_IN_ENV
/*
* if overwrite_console returns 1, the stdin, stderr and stdout