Hi, I'm not sure what Dave would say, but the code cleanups, (see below) whilst minor, should probably live in a separate patch. Thanks, Julian Calaby On Fri, Sep 30, 2011 at 21:22, Konrad Eisele <konrad@xxxxxxxxxxx> wrote: > Add support for a virtual GRMON<->KGDB channel that > is created using share memory polling by GRMON. Start > GRMON with the option "-vchannel" to enable polling. This > feature enables connecting to KGDB without having an hardware > serial connection, but using GRMON as an tunnel. > Reorder Makefile addition so that apbuart.o gets inserted > before kgdboc.o. > Add Kconfig option SERIAL_GRLIB_GAISLER_APBUART_GRMON_VIRTUAL to enable > the feature. > > Signed-off-by: Konrad Eisele <konrad@xxxxxxxxxxx> > --- > drivers/tty/serial/Kconfig | 12 ++++ > drivers/tty/serial/Makefile | 2 +- > drivers/tty/serial/apbuart.c | 133 ++++++++++++++++++++++++++++++++++++------ > 3 files changed, 128 insertions(+), 19 deletions(-) > > diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c > index 5f40f42..38eb8cc 100644 > --- a/drivers/tty/serial/apbuart.c > +++ b/drivers/tty/serial/apbuart.c > @@ -124,7 +124,6 @@ static void apbuart_rx_chars(struct uart_port *port) > > uart_insert_char(port, rsr, UART_STATUS_OE, ch, flag); > > - > ignore_char: > status = UART_GET_STATUS(port); > } > @@ -350,11 +349,88 @@ static struct uart_ops grlib_apbuart_ops = { > .config_port = apbuart_config_port, > .verify_port = apbuart_verify_port, > #ifdef CONFIG_CONSOLE_POLL > - .poll_get_char = apbuart_poll_get_char, > - .poll_put_char = apbuart_poll_put_char, > -#endif > + .poll_get_char = apbuart_poll_get_char, > + .poll_put_char = apbuart_poll_put_char, > +#endif > @@ -423,7 +499,6 @@ static void apbuart_flush_fifo(struct uart_port *port) > UART_GET_CHAR(port); > } > > - > /* ======================================================================== */ > /* Console driver, if enabled */ > /* ======================================================================== */ > @@ -551,7 +626,6 @@ static struct console grlib_apbuart_console = { > .data = &grlib_apbuart_driver, > }; > > - > static int grlib_apbuart_configure(void); > > static int __init apbuart_console_init(void) > @@ -579,7 +653,6 @@ static struct uart_driver grlib_apbuart_driver = { > .cons = APBUART_CONSOLE, > }; > > - > /* ======================================================================== */ > /* OF Platform Driver */ > /* ======================================================================== */ > @@ -598,12 +671,12 @@ static int __devinit apbuart_probe(struct platform_device *op) > port->dev = &op->dev; > port->irq = op->archdata.irqs[0]; > > - uart_add_one_port(&grlib_apbuart_driver, (struct uart_port *) port); > + uart_add_one_port(&grlib_apbuart_driver, (struct uart_port *)port); > > - apbuart_flush_fifo((struct uart_port *) port); > + apbuart_flush_fifo((struct uart_port *)port); > > printk(KERN_INFO "grlib-apbuart at 0x%llx, irq %d\n", > - (unsigned long long) port->mapbase, port->irq); > + (unsigned long long)port->mapbase, port->irq); > return 0; > } > > @@ -620,13 +693,12 @@ static struct of_device_id __initdata apbuart_match[] = { > static struct platform_driver grlib_apbuart_of_driver = { > .probe = apbuart_probe, > .driver = { > - .owner = THIS_MODULE, > - .name = "grlib-apbuart", > - .of_match_table = apbuart_match, > - }, > + .owner = THIS_MODULE, > + .name = "grlib-apbuart", > + .of_match_table = apbuart_match, > + }, > }; > > - > static int grlib_apbuart_configure(void) > { > struct device_node *np; > @@ -641,7 +713,7 @@ static int grlib_apbuart_configure(void) > > ampopts = of_get_property(np, "ampopts", NULL); > if (ampopts && (*ampopts == 0)) > - continue; /* Ignore if used by another OS instance */ > + continue; /* Ignore if used by another OS instance */ > regs = of_get_property(np, "reg", NULL); > /* Frequency of APB Bus is frequency of UART */ > freq_hz = of_get_property(np, "freq", NULL); > @@ -656,14 +728,16 @@ static int grlib_apbuart_configure(void) > port = &grlib_apbuart_ports[line]; > > port->mapbase = addr; > - port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map)); > + port->membase = > + ioremap(addr, sizeof(struct grlib_apbuart_regs_map)); > port->irq = 0; > port->iotype = UPIO_MEM; > port->ops = &grlib_apbuart_ops; > port->flags = UPF_BOOT_AUTOCONF; > port->line = line; > port->uartclk = *freq_hz; > - port->fifosize = apbuart_scan_fifo_size((struct uart_port *) port, line); > + port->fifosize = > + apbuart_scan_fifo_size((struct uart_port *)port, line); > line++; > > /* We support maximum UART_NR uarts ... */ -- Julian Calaby Email: julian.calaby@xxxxxxxxx Profile: http://www.google.com/profiles/julian.calaby/ .Plan: http://sites.google.com/site/juliancalaby/ -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html