summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-02-27 13:26:22 -0700
committerSimon Glass <sjg@chromium.org>2014-03-17 20:05:49 -0600
commitffb87905cb3883c84598b87ca05384c17d59dee1 (patch)
tree34a10775e3d35c5ebf5432222443094025cb14bb /drivers/serial
parent20f86a0aeaad5dfa0b4f50bf5d04dd7bf1f7c3e9 (diff)
downloadu-boot-imx-ffb87905cb3883c84598b87ca05384c17d59dee1.zip
u-boot-imx-ffb87905cb3883c84598b87ca05384c17d59dee1.tar.gz
u-boot-imx-ffb87905cb3883c84598b87ca05384c17d59dee1.tar.bz2
sandbox: Allow Ctrl-C to work in sandbox
It is useful for Cltl-C to be handled by U-Boot as it is on other boards. But it is also useful to be able to terminate U-Boot with Ctrl-C. Add an option to enable signals while in raw mode, and make this the default. Add an option to leave the terminal cooked, which is useful for redirecting output. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/sandbox.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
index c27b5b8..51fd871 100644
--- a/drivers/serial/sandbox.c
+++ b/drivers/serial/sandbox.c
@@ -15,6 +15,7 @@
#include <os.h>
#include <serial.h>
#include <linux/compiler.h>
+#include <asm/state.h>
/*
*
@@ -31,7 +32,10 @@ static unsigned int serial_buf_read;
static int sandbox_serial_init(void)
{
- os_tty_raw(0);
+ struct sandbox_state *state = state_get_current();
+
+ if (state->term_raw != STATE_TERM_COOKED)
+ os_tty_raw(0, state->term_raw == STATE_TERM_RAW_WITH_SIGS);
return 0;
}