linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Uartlite - poll support
@ 2010-08-17  8:42 Michal Simek
  2010-08-17  8:42 ` [PATCH] serial: Add CONSOLE_POLL support for uartlite Michal Simek
  2010-08-17 14:34 ` Uartlite - poll support Greg KH
  0 siblings, 2 replies; 8+ messages in thread
From: Michal Simek @ 2010-08-17  8:42 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-serial

Hi Greg,

I am not sure who is responsible for drivers/serial but I see
that your tty tree contains a lot of serial patches. 
Could you please add the uartlite poll patch to your tree?

Thanks,
Michal



^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] serial: Add CONSOLE_POLL support for uartlite
@ 2010-08-09 10:07 Michal Simek
  2010-08-10 11:48 ` Jason Wessel
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Simek @ 2010-08-09 10:07 UTC (permalink / raw)
  To: jacmet; +Cc: grant.likely, linux-serial, linux-kernel, Michal Simek

CONSOLE_POLL support for uartlite enables
KGDB debugging over serial line.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 drivers/serial/uartlite.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index caf085d..ce1f3e0 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -322,6 +322,26 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
 	return -EINVAL;
 }
 
+#ifdef CONFIG_CONSOLE_POLL
+static int ulite_get_poll_char(struct uart_port *port)
+{
+	while (!(ioread32be(port->membase + ULITE_STATUS)
+						& ULITE_STATUS_RXVALID))
+		cpu_relax();
+
+	return ioread32be(port->membase + ULITE_RX);
+}
+
+static void ulite_put_poll_char(struct uart_port *port, unsigned char ch)
+{
+	while (ioread32be(port->membase + ULITE_STATUS) & ULITE_STATUS_TXFULL)
+		cpu_relax();
+
+	/* write char to device */
+	iowrite32be(ch, port->membase + ULITE_TX);
+}
+#endif
+
 static struct uart_ops ulite_ops = {
 	.tx_empty	= ulite_tx_empty,
 	.set_mctrl	= ulite_set_mctrl,
@@ -338,7 +358,11 @@ static struct uart_ops ulite_ops = {
 	.release_port	= ulite_release_port,
 	.request_port	= ulite_request_port,
 	.config_port	= ulite_config_port,
-	.verify_port	= ulite_verify_port
+	.verify_port	= ulite_verify_port,
+#ifdef CONFIG_CONSOLE_POLL
+	.poll_get_char	= ulite_get_poll_char,
+	.poll_put_char	= ulite_put_poll_char,
+#endif
 };
 
 /* ---------------------------------------------------------------------
-- 
1.5.5.6


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

end of thread, other threads:[~2010-08-23  8:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-17  8:42 Uartlite - poll support Michal Simek
2010-08-17  8:42 ` [PATCH] serial: Add CONSOLE_POLL support for uartlite Michal Simek
2010-08-22 19:04   ` Peter Korsgaard
2010-08-23  8:47     ` Michal Simek
2010-08-17 14:34 ` Uartlite - poll support Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2010-08-09 10:07 [PATCH] serial: Add CONSOLE_POLL support for uartlite Michal Simek
2010-08-10 11:48 ` Jason Wessel
2010-08-10 11:50   ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).