aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2008-02-20 14:33:39 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-17 14:05:39 -0400
commit84b5ae15216aa3ea0314f395536ef9829af21e14 (patch)
tree10ebd7ce14730148772bbb000caeaffe80802c9a
parentb4b8ac524d9b6ed7229017145afa1d7afbea4a48 (diff)
kgdb: kgdboc pl011 I/O module
Implement the serial polling hooks for the pl011 uart for use with kgdboc. This patch was specifically tested on the ARM Versatile AB reference platform. [ mingo@elte.hu: minor cleanups. ] Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--drivers/serial/amba-pl011.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 40604a092921..08adc1de4a79 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -314,6 +314,32 @@ static void pl011_break_ctl(struct uart_port *port, int break_state)
314 spin_unlock_irqrestore(&uap->port.lock, flags); 314 spin_unlock_irqrestore(&uap->port.lock, flags);
315} 315}
316 316
317#ifdef CONFIG_CONSOLE_POLL
318static int pl010_get_poll_char(struct uart_port *port)
319{
320 struct uart_amba_port *uap = (struct uart_amba_port *)port;
321 unsigned int status;
322
323 do {
324 status = readw(uap->port.membase + UART01x_FR);
325 } while (status & UART01x_FR_RXFE);
326
327 return readw(uap->port.membase + UART01x_DR);
328}
329
330static void pl010_put_poll_char(struct uart_port *port,
331 unsigned char ch)
332{
333 struct uart_amba_port *uap = (struct uart_amba_port *)port;
334
335 while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_TXFF)
336 barrier();
337
338 writew(ch, uap->port.membase + UART01x_DR);
339}
340
341#endif /* CONFIG_CONSOLE_POLL */
342
317static int pl011_startup(struct uart_port *port) 343static int pl011_startup(struct uart_port *port)
318{ 344{
319 struct uart_amba_port *uap = (struct uart_amba_port *)port; 345 struct uart_amba_port *uap = (struct uart_amba_port *)port;
@@ -572,6 +598,10 @@ static struct uart_ops amba_pl011_pops = {
572 .request_port = pl010_request_port, 598 .request_port = pl010_request_port,
573 .config_port = pl010_config_port, 599 .config_port = pl010_config_port,
574 .verify_port = pl010_verify_port, 600 .verify_port = pl010_verify_port,
601#ifdef CONFIG_CONSOLE_POLL
602 .poll_get_char = pl010_get_poll_char,
603 .poll_put_char = pl010_put_poll_char,
604#endif
575}; 605};
576 606
577static struct uart_amba_port *amba_ports[UART_NR]; 607static struct uart_amba_port *amba_ports[UART_NR];