public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: imx: add console polling routines for kgdboc
@ 2008-08-13  8:27 Atsuo Igarashi
  2008-08-15  6:31 ` Sascha Hauer
  2008-08-15 15:10 ` Andrew Dyer
  0 siblings, 2 replies; 3+ messages in thread
From: Atsuo Igarashi @ 2008-08-13  8:27 UTC (permalink / raw)
  To: linux-serial; +Cc: linux-arm-kernel, kernel

[-- Attachment #1: Type: text/plain, Size: 123 bytes --]

Add console polling routines for the imx uart with kgdboc.

Signed-off-by Atsuo Igarashi <atsuo_igarashi@tripeaks.co.jp>



[-- Attachment #2: imx_serial_for_kgdb.diff --]
[-- Type: text/x-diff, Size: 1228 bytes --]

--- linux-2.6.orig/drivers/serial/imx.c	2008-08-13 15:06:45.000000000 +0900
+++ linux-2.6/drivers/serial/imx.c	2008-08-13 15:10:59.000000000 +0900
@@ -646,6 +646,29 @@ static void imx_shutdown(struct uart_por
 	writel(temp, sport->port.membase + UCR1);
 }
 
+#ifdef CONFIG_CONSOLE_POLL
+
+static int imx_get_poll_char(struct uart_port *port)
+{
+	struct imx_port *sport = (struct imx_port *)port;
+
+	while (!(readl(sport->port.membase + USR2) & USR2_RDR));
+
+	return readl(sport->port.membase + URXD0);
+}
+
+static void imx_put_poll_char(struct uart_port *port, unsigned char ch)
+{
+	struct imx_port *sport = (struct imx_port *)port;
+
+	while (readl(sport->port.membase + UTS) & UTS_TXFULL)
+		barrier();
+
+	writel(ch, sport->port.membase + URTX0);
+}
+
+#endif /* CONFIG_CONSOLE_POLL */
+
 static void
 imx_set_termios(struct uart_port *port, struct ktermios *termios,
 		   struct ktermios *old)
@@ -892,6 +915,10 @@ static struct uart_ops imx_pops = {
 	.request_port	= imx_request_port,
 	.config_port	= imx_config_port,
 	.verify_port	= imx_verify_port,
+#ifdef CONFIG_CONSOLE_POLL
+	.poll_get_char	= imx_get_poll_char,
+	.poll_put_char	= imx_put_poll_char,
+#endif
 };
 
 static struct imx_port *imx_ports[UART_NR];

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-15 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-13  8:27 [PATCH] serial: imx: add console polling routines for kgdboc Atsuo Igarashi
2008-08-15  6:31 ` Sascha Hauer
2008-08-15 15:10 ` Andrew Dyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox