From: Atsuo Igarashi <atsuo_igarashi@tripeaks.co.jp>
To: linux-serial@vger.kernel.org
Cc: linux-arm-kernel@lists.arm.linux.org.uk, kernel@pengutronix.de
Subject: [PATCH] serial: imx: add console polling routines for kgdboc
Date: Wed, 13 Aug 2008 17:27:39 +0900 [thread overview]
Message-ID: <48A29AFB.9070502@tripeaks.co.jp> (raw)
[-- 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];
next reply other threads:[~2008-08-13 8:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 8:27 Atsuo Igarashi [this message]
2008-08-15 6:31 ` [PATCH] serial: imx: add console polling routines for kgdboc Sascha Hauer
2008-08-15 15:10 ` Andrew Dyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48A29AFB.9070502@tripeaks.co.jp \
--to=atsuo_igarashi@tripeaks.co.jp \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox