summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Felice <tony.felice@timesys.com>2013-04-26 13:30:24 -0400
committerAnthony Felice <tony.felice@timesys.com>2013-04-26 13:30:24 -0400
commit5fd6b7285c33ab549db3277afe637dfdda5232a0 (patch)
treec585e2bb89c6036bb99d51f5442aa965af02e84b
parentf9ca3cb28917cd3e60eb45882fc9320d8424e4f3 (diff)
Add initial KGDB support.3.0-vybrid-ts2.2
-rw-r--r--drivers/tty/serial/mvf.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/tty/serial/mvf.c b/drivers/tty/serial/mvf.c
index 66dba76081e8..cb0e98ffb527 100644
--- a/drivers/tty/serial/mvf.c
+++ b/drivers/tty/serial/mvf.c
@@ -1023,6 +1023,29 @@ static int imx_uart_ioctl(struct uart_port *uport, unsigned int cmd,
}
+#if defined(CONFIG_CONSOLE_POLL)
+static int imx_poll_get_char(struct uart_port *port)
+{
+ struct imx_port *sport = (struct imx_port *)port;
+ int ch;
+
+ while (!(readb(sport->port.membase + MXC_UARTSR1) & MXC_UARTSR1_RDRF));
+
+ ch = readb(sport->port.membase + MXC_UARTDR);
+ return(ch & 0xff);
+}
+
+static void imx_poll_put_char(struct uart_port *port, unsigned char c)
+{
+ struct imx_port *sport = (struct imx_port *)port;
+
+ while (!(readb(sport->port.membase + MXC_UARTSR1) & MXC_UARTSR1_TDRE))
+ barrier();
+
+ writeb(c, sport->port.membase + MXC_UARTDR);
+}
+#endif
+
static struct uart_ops imx_pops = {
.tx_empty = imx_tx_empty,
.set_mctrl = imx_set_mctrl,
@@ -1041,6 +1064,10 @@ static struct uart_ops imx_pops = {
.config_port = imx_config_port,
.verify_port = imx_verify_port,
.ioctl = imx_uart_ioctl,
+#if defined(CONFIG_CONSOLE_POLL)
+ .poll_get_char = imx_poll_get_char,
+ .poll_put_char = imx_poll_put_char,
+#endif
};
static struct imx_port *imx_ports[UART_NR];