[PATCH] serial: imx: add console polling routines for kgdboc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add console polling routines for the imx uart with kgdboc.

Signed-off-by Atsuo Igarashi <atsuo_igarashi@xxxxxxxxxxxxxx>


--- 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];

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux