All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver
@ 2011-08-15  9:17 Jamie Iles
  2011-08-15  9:17 ` [PATCH 1/5] tty: serial: allow ports to override the irq handler Jamie Iles
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Jamie Iles @ 2011-08-15  9:17 UTC (permalink / raw)
  To: linux-serial; +Cc: arnd, Jamie Iles

This is just a repost of a series from a couple of months ago to remove
the special DWAPB 8250 handling from the generic driver.

Arnd, I'd have a platform that needs some special handlers like these
using the device tree and of_serial.  Once these are merged I plan on
passing the serial_{in,out} and handle_irq callbacks through
platform_data to of_serial.  Does this seem sensible?

Jamie

Jamie Iles (5):
  tty: serial: allow ports to override the irq handler
  tty: serial8250: allow platforms to override irq handler
  mips: msp71xx/serial: convert to pr_foo() helpers
  mips: msp71xx/serial: add workaround for DW UART
  tty: serial8250: remove UPIO_DWAPB{,32}

 arch/mips/pmc-sierra/msp71xx/msp_serial.c |   73 ++++++++++++++++++--
 drivers/tty/serial/8250.c                 |  107 +++++++++-------------------
 drivers/tty/serial/serial_core.c          |    4 -
 include/linux/serial_8250.h               |    2 +
 include/linux/serial_core.h               |    5 +-
 5 files changed, 106 insertions(+), 85 deletions(-)

-- 
1.7.4.1


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

* [PATCH 1/5] tty: serial: allow ports to override the irq handler
  2011-08-15  9:17 [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Jamie Iles
@ 2011-08-15  9:17 ` Jamie Iles
  2011-08-15  9:17 ` [PATCH 2/5] tty: serial8250: allow platforms to override " Jamie Iles
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Jamie Iles @ 2011-08-15  9:17 UTC (permalink / raw)
  To: linux-serial; +Cc: arnd, Jamie Iles, Alan Cox, Greg Kroah-Hartman

Some serial ports may have unusal requirements for interrupt handling
(e.g. the Synopsys DesignWare 8250-alike port and it's busy detect
interrupt).  Add a .handle_irq callback that can be used for platforms
to override the interrupt behaviour in a similar fashion to the
.serial_out and .serial_in callbacks.

Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 include/linux/serial_core.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a5c3114..b6fa317 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -300,6 +300,7 @@ struct uart_port {
 	void			(*set_termios)(struct uart_port *,
 				               struct ktermios *new,
 				               struct ktermios *old);
+	int			(*handle_irq)(struct uart_port *);
 	void			(*pm)(struct uart_port *, unsigned int state,
 				      unsigned int old);
 	unsigned int		irq;			/* irq number */
-- 
1.7.4.1


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

* [PATCH 2/5] tty: serial8250: allow platforms to override irq handler
  2011-08-15  9:17 [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Jamie Iles
  2011-08-15  9:17 ` [PATCH 1/5] tty: serial: allow ports to override the irq handler Jamie Iles
@ 2011-08-15  9:17 ` Jamie Iles
  2011-08-15  9:17 ` [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers Jamie Iles
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Jamie Iles @ 2011-08-15  9:17 UTC (permalink / raw)
  To: linux-serial; +Cc: arnd, Jamie Iles, Alan Cox, Greg Kroah-Hartman

Some ports (e.g. Synopsys DesignWare 8250) have special requirements for
handling the interrupts.  Allow these platforms to specify their own
interrupt handler that will override the default.
serial8250_handle_irq() is provided so that platforms can extend the IRQ
handler rather than completely replacing it.

Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/tty/serial/8250.c   |   39 +++++++++++++++++++++++++++++++++++----
 include/linux/serial_8250.h |    2 ++
 2 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index f2dfec8..833e011 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -509,6 +509,8 @@ static void io_serial_out(struct uart_port *p, int offset, int value)
 	outb(value, p->iobase + offset);
 }
 
+static int serial8250_default_handle_irq(struct uart_port *port);
+
 static void set_io_from_upio(struct uart_port *p)
 {
 	struct uart_8250_port *up =
@@ -557,6 +559,7 @@ static void set_io_from_upio(struct uart_port *p)
 	}
 	/* Remember loaded iotype */
 	up->cur_iotype = p->iotype;
+	p->handle_irq = serial8250_default_handle_irq;
 }
 
 static void
@@ -1621,6 +1624,28 @@ static void serial8250_handle_port(struct uart_8250_port *up)
 	spin_unlock_irqrestore(&up->port.lock, flags);
 }
 
+int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
+{
+	struct uart_8250_port *up =
+		container_of(port, struct uart_8250_port, port);
+
+	if (!(iir & UART_IIR_NO_INT)) {
+		serial8250_handle_port(up);
+		return 1;
+	}
+
+	return 0;
+}
+
+static int serial8250_default_handle_irq(struct uart_port *port)
+{
+	struct uart_8250_port *up =
+		container_of(port, struct uart_8250_port, port);
+	unsigned int iir = serial_in(up, UART_IIR);
+
+	return serial8250_handle_irq(port, iir);
+}
+
 /*
  * This is the serial driver's interrupt routine.
  *
@@ -1648,13 +1673,12 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
 	l = i->head;
 	do {
 		struct uart_8250_port *up;
-		unsigned int iir;
+		struct uart_port *port;
 
 		up = list_entry(l, struct uart_8250_port, list);
+		port = &up->port;
 
-		iir = serial_in(up, UART_IIR);
-		if (!(iir & UART_IIR_NO_INT)) {
-			serial8250_handle_port(up);
+		if (port->handle_irq(port)) {
 
 			handled = 1;
 
@@ -3048,6 +3072,10 @@ int __init early_serial_setup(struct uart_port *port)
 		p->serial_in = port->serial_in;
 	if (port->serial_out)
 		p->serial_out = port->serial_out;
+	if (port->handle_irq)
+		p->handle_irq = port->handle_irq;
+	else
+		p->handle_irq = serial8250_default_handle_irq;
 
 	return 0;
 }
@@ -3116,6 +3144,7 @@ static int __devinit serial8250_probe(struct platform_device *dev)
 		port.type		= p->type;
 		port.serial_in		= p->serial_in;
 		port.serial_out		= p->serial_out;
+		port.handle_irq		= p->handle_irq;
 		port.set_termios	= p->set_termios;
 		port.pm			= p->pm;
 		port.dev		= &dev->dev;
@@ -3281,6 +3310,8 @@ int serial8250_register_port(struct uart_port *port)
 			uart->port.serial_in = port->serial_in;
 		if (port->serial_out)
 			uart->port.serial_out = port->serial_out;
+		if (port->handle_irq)
+			uart->port.handle_irq = port->handle_irq;
 		/*  Possibly override set_termios call */
 		if (port->set_termios)
 			uart->port.set_termios = port->set_termios;
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 97f5b45..1f05bbe 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -35,6 +35,7 @@ struct plat_serial8250_port {
 	void		(*set_termios)(struct uart_port *,
 			               struct ktermios *new,
 			               struct ktermios *old);
+	int		(*handle_irq)(struct uart_port *);
 	void		(*pm)(struct uart_port *, unsigned int state,
 			      unsigned old);
 };
@@ -80,6 +81,7 @@ extern void serial8250_do_set_termios(struct uart_port *port,
 		struct ktermios *termios, struct ktermios *old);
 extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
 			     unsigned int oldstate);
+int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
 
 extern void serial8250_set_isa_configurator(void (*v)
 					(int port, struct uart_port *up,
-- 
1.7.4.1


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

* [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers
  2011-08-15  9:17 [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Jamie Iles
  2011-08-15  9:17 ` [PATCH 1/5] tty: serial: allow ports to override the irq handler Jamie Iles
  2011-08-15  9:17 ` [PATCH 2/5] tty: serial8250: allow platforms to override " Jamie Iles
@ 2011-08-15  9:17 ` Jamie Iles
  2011-08-15 12:44   ` Ralf Baechle
  2011-08-18 18:40   ` Anoop P.A.
  2011-08-15  9:17 ` [PATCH 4/5] mips: msp71xx/serial: add workaround for DW UART Jamie Iles
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 16+ messages in thread
From: Jamie Iles @ 2011-08-15  9:17 UTC (permalink / raw)
  To: linux-serial; +Cc: arnd, Jamie Iles, Ralf Baechle

Convert to pr_foo() helpers rather than printk(KERN_.*).

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 arch/mips/pmc-sierra/msp71xx/msp_serial.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/pmc-sierra/msp71xx/msp_serial.c b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
index f726162..c3247b5 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_serial.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
@@ -65,7 +65,7 @@ void __init msp_serial_setup(void)
 	up.line         = 0;
 	up.private_data		= (void*)UART0_STATUS_REG;
 	if (early_serial_setup(&up))
-		printk(KERN_ERR "Early serial init of port 0 failed\n");
+		pr_err("Early serial init of port 0 failed\n");
 
 	/* Initialize the second serial port, if one exists */
 	switch (mips_machtype) {
@@ -89,5 +89,5 @@ void __init msp_serial_setup(void)
 	up.line         = 1;
 	up.private_data		= (void*)UART1_STATUS_REG;
 	if (early_serial_setup(&up))
-		printk(KERN_ERR "Early serial init of port 1 failed\n");
+		pr_err("Early serial init of port 1 failed\n");
 }
-- 
1.7.4.1


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

* [PATCH 4/5] mips: msp71xx/serial: add workaround for DW UART
  2011-08-15  9:17 [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Jamie Iles
                   ` (2 preceding siblings ...)
  2011-08-15  9:17 ` [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers Jamie Iles
@ 2011-08-15  9:17 ` Jamie Iles
  2011-08-17 12:56   ` Ralf Baechle
  2011-08-15  9:17 ` [PATCH 5/5] tty: serial8250: remove UPIO_DWAPB{,32} Jamie Iles
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Jamie Iles @ 2011-08-15  9:17 UTC (permalink / raw)
  To: linux-serial; +Cc: arnd, Jamie Iles, Ralf Baechle, Alan Cox

The Synopsys DesignWare UART in pmc-sierra msp71xx has an extra feature
where the UART detects a write attempt to the LCR whilst busy and raises
an interrupt.  The driver needs to clear the interrupt and rewrite the
LCR.  Move this into platform code and out of the 8250 driver.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 arch/mips/pmc-sierra/msp71xx/msp_serial.c |   69 +++++++++++++++++++++++++++--
 1 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/arch/mips/pmc-sierra/msp71xx/msp_serial.c b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
index c3247b5..a1c7c7d 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_serial.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
@@ -27,6 +27,7 @@
 #include <linux/serial.h>
 #include <linux/serial_core.h>
 #include <linux/serial_reg.h>
+#include <linux/slab.h>
 
 #include <asm/bootinfo.h>
 #include <asm/io.h>
@@ -38,6 +39,55 @@
 #include <msp_int.h>
 #include <msp_regs.h>
 
+struct msp_uart_data {
+	int	last_lcr;
+};
+
+static void msp_serial_out(struct uart_port *p, int offset, int value)
+{
+	struct msp_uart_data *d = p->private_data;
+
+	if (offset == UART_LCR)
+		d->last_lcr = value;
+
+	offset <<= p->regshift;
+	writeb(value, p->membase + offset);
+}
+
+static unsigned int msp_serial_in(struct uart_port *p, int offset)
+{
+	offset <<= p->regshift;
+
+	return readb(p->membase + offset);
+}
+
+static int msp_serial_handle_irq(struct uart_port *p)
+{
+	struct msp_uart_data *d = p->private_data;
+	unsigned int iir = readb(p->membase + (UART_IIR << p->regshift));
+
+	if (serial8250_handle_irq(p, iir)) {
+		return 1;
+	} else if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
+		/*
+		 * The DesignWare APB UART has an Busy Detect (0x07) interrupt
+		 * meaning an LCR write attempt occurred while the UART was
+		 * busy. The interrupt must be cleared by reading the UART
+		 * status register (USR) and the LCR re-written.
+		 *
+		 * Note: MSP reserves 0x20 bytes of address space for the UART
+		 * and the USR is mapped in a separate block at an offset of
+		 * 0xc0 from the start of the UART.
+		 */
+		(void)readb(p->membase + 0xc0);
+		writeb(d->last_lcr, p->membase + (UART_LCR << p->regshift));
+
+		return 1;
+	}
+
+	return 0;
+}
+
 void __init msp_serial_setup(void)
 {
 	char    *s;
@@ -59,13 +109,22 @@ void __init msp_serial_setup(void)
 	up.irq          = MSP_INT_UART0;
 	up.uartclk      = uartclk;
 	up.regshift     = 2;
-	up.iotype       = UPIO_DWAPB; /* UPIO_MEM like */
+	up.iotype       = UPIO_MEM;
 	up.flags        = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
 	up.type         = PORT_16550A;
 	up.line         = 0;
-	up.private_data		= (void*)UART0_STATUS_REG;
-	if (early_serial_setup(&up))
+	up.serial_out	= msp_serial_out;
+	up.serial_in	= msp_serial_in;
+	up.handle_irq	= msp_serial_handle_irq;
+	up.private_data	= kzalloc(sizeof(struct msp_uart_data), GFP_KERNEL);
+	if (!up.private_data) {
+		pr_err("failed to allocate uart private data\n");
+		return;
+	}
+	if (early_serial_setup(&up)) {
+		kfree(up.private_data);
 		pr_err("Early serial init of port 0 failed\n");
+	}
 
 	/* Initialize the second serial port, if one exists */
 	switch (mips_machtype) {
@@ -88,6 +147,8 @@ void __init msp_serial_setup(void)
 	up.irq          = MSP_INT_UART1;
 	up.line         = 1;
 	up.private_data		= (void*)UART1_STATUS_REG;
-	if (early_serial_setup(&up))
+	if (early_serial_setup(&up)) {
+		kfree(up.private_data);
 		pr_err("Early serial init of port 1 failed\n");
+	}
 }
-- 
1.7.4.1


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

* [PATCH 5/5] tty: serial8250: remove UPIO_DWAPB{,32}
  2011-08-15  9:17 [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Jamie Iles
                   ` (3 preceding siblings ...)
  2011-08-15  9:17 ` [PATCH 4/5] mips: msp71xx/serial: add workaround for DW UART Jamie Iles
@ 2011-08-15  9:17 ` Jamie Iles
  2011-08-15  9:34 ` [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Alan Cox
  2011-08-16 14:05 ` Arnd Bergmann
  6 siblings, 0 replies; 16+ messages in thread
From: Jamie Iles @ 2011-08-15  9:17 UTC (permalink / raw)
  To: linux-serial; +Cc: arnd, Jamie Iles, Alan Cox, Greg Kroah-Hartman

Now that platforms can override the port IRQ handler and the only user
of these UPIO modes has been converted over, kill off UPIO_DWAPB and
UPIO_DWAPB32.

Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/tty/serial/8250.c        |   68 --------------------------------------
 drivers/tty/serial/serial_core.c |    4 --
 include/linux/serial_core.h      |    4 +--
 3 files changed, 1 insertions(+), 75 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 833e011..6f594d2 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -461,42 +461,6 @@ static void tsi_serial_out(struct uart_port *p, int offset, int value)
 		writeb(value, p->membase + offset);
 }
 
-/* Save the LCR value so it can be re-written when a Busy Detect IRQ occurs. */
-static inline void dwapb_save_out_value(struct uart_port *p, int offset,
-					int value)
-{
-	struct uart_8250_port *up =
-		container_of(p, struct uart_8250_port, port);
-
-	if (offset == UART_LCR)
-		up->lcr = value;
-}
-
-/* Read the IER to ensure any interrupt is cleared before returning from ISR. */
-static inline void dwapb_check_clear_ier(struct uart_port *p, int offset)
-{
-	if (offset == UART_TX || offset == UART_IER)
-		p->serial_in(p, UART_IER);
-}
-
-static void dwapb_serial_out(struct uart_port *p, int offset, int value)
-{
-	int save_offset = offset;
-	offset = map_8250_out_reg(p, offset) << p->regshift;
-	dwapb_save_out_value(p, save_offset, value);
-	writeb(value, p->membase + offset);
-	dwapb_check_clear_ier(p, save_offset);
-}
-
-static void dwapb32_serial_out(struct uart_port *p, int offset, int value)
-{
-	int save_offset = offset;
-	offset = map_8250_out_reg(p, offset) << p->regshift;
-	dwapb_save_out_value(p, save_offset, value);
-	writel(value, p->membase + offset);
-	dwapb_check_clear_ier(p, save_offset);
-}
-
 static unsigned int io_serial_in(struct uart_port *p, int offset)
 {
 	offset = map_8250_in_reg(p, offset) << p->regshift;
@@ -542,16 +506,6 @@ static void set_io_from_upio(struct uart_port *p)
 		p->serial_out = tsi_serial_out;
 		break;
 
-	case UPIO_DWAPB:
-		p->serial_in = mem_serial_in;
-		p->serial_out = dwapb_serial_out;
-		break;
-
-	case UPIO_DWAPB32:
-		p->serial_in = mem32_serial_in;
-		p->serial_out = dwapb32_serial_out;
-		break;
-
 	default:
 		p->serial_in = io_serial_in;
 		p->serial_out = io_serial_out;
@@ -570,8 +524,6 @@ serial_out_sync(struct uart_8250_port *up, int offset, int value)
 	case UPIO_MEM:
 	case UPIO_MEM32:
 	case UPIO_AU:
-	case UPIO_DWAPB:
-	case UPIO_DWAPB32:
 		p->serial_out(p, offset, value);
 		p->serial_in(p, UART_LCR);	/* safe, no side-effects */
 		break;
@@ -1679,23 +1631,7 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
 		port = &up->port;
 
 		if (port->handle_irq(port)) {
-
 			handled = 1;
-
-			end = NULL;
-		} else if ((up->port.iotype == UPIO_DWAPB ||
-			    up->port.iotype == UPIO_DWAPB32) &&
-			  (iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
-			/* The DesignWare APB UART has an Busy Detect (0x07)
-			 * interrupt meaning an LCR write attempt occurred while the
-			 * UART was busy. The interrupt must be cleared by reading
-			 * the UART status register (USR) and the LCR re-written. */
-			unsigned int status;
-			status = *(volatile u32 *)up->port.private_data;
-			serial_out(up, UART_LCR, up->lcr);
-
-			handled = 1;
-
 			end = NULL;
 		} else if (end == NULL)
 			end = l;
@@ -2592,8 +2528,6 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
 	case UPIO_TSI:
 	case UPIO_MEM32:
 	case UPIO_MEM:
-	case UPIO_DWAPB:
-	case UPIO_DWAPB32:
 		if (!up->port.mapbase)
 			break;
 
@@ -2630,8 +2564,6 @@ static void serial8250_release_std_resource(struct uart_8250_port *up)
 	case UPIO_TSI:
 	case UPIO_MEM32:
 	case UPIO_MEM:
-	case UPIO_DWAPB:
-	case UPIO_DWAPB32:
 		if (!up->port.mapbase)
 			break;
 
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index db7912c..e5a0cae 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2063,8 +2063,6 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
 	case UPIO_MEM32:
 	case UPIO_AU:
 	case UPIO_TSI:
-	case UPIO_DWAPB:
-	case UPIO_DWAPB32:
 		snprintf(address, sizeof(address),
 			 "MMIO 0x%llx", (unsigned long long)port->mapbase);
 		break;
@@ -2484,8 +2482,6 @@ int uart_match_port(struct uart_port *port1, struct uart_port *port2)
 	case UPIO_MEM32:
 	case UPIO_AU:
 	case UPIO_TSI:
-	case UPIO_DWAPB:
-	case UPIO_DWAPB32:
 		return (port1->mapbase == port2->mapbase);
 	}
 	return 0;
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index b6fa317..1b3669d 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -318,9 +318,7 @@ struct uart_port {
 #define UPIO_MEM32		(3)
 #define UPIO_AU			(4)			/* Au1x00 type IO */
 #define UPIO_TSI		(5)			/* Tsi108/109 type IO */
-#define UPIO_DWAPB		(6)			/* DesignWare APB UART */
-#define UPIO_RM9000		(7)			/* RM9000 type IO */
-#define UPIO_DWAPB32		(8)			/* DesignWare APB UART (32 bit accesses) */
+#define UPIO_RM9000		(6)			/* RM9000 type IO */
 
 	unsigned int		read_status_mask;	/* driver specific */
 	unsigned int		ignore_status_mask;	/* driver specific */
-- 
1.7.4.1


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

* Re: [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver
  2011-08-15  9:17 [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Jamie Iles
                   ` (4 preceding siblings ...)
  2011-08-15  9:17 ` [PATCH 5/5] tty: serial8250: remove UPIO_DWAPB{,32} Jamie Iles
@ 2011-08-15  9:34 ` Alan Cox
  2011-08-16 14:05 ` Arnd Bergmann
  6 siblings, 0 replies; 16+ messages in thread
From: Alan Cox @ 2011-08-15  9:34 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-serial, arnd

On Mon, 15 Aug 2011 10:17:50 +0100
Jamie Iles <jamie@jamieiles.com> wrote:

> This is just a repost of a series from a couple of months ago to remove
> the special DWAPB 8250 handling from the generic driver.
> 
> Arnd, I'd have a platform that needs some special handlers like these
> using the device tree and of_serial.  Once these are merged I plan on
> passing the serial_{in,out} and handle_irq callbacks through
> platform_data to of_serial.  Does this seem sensible?

Acked-by: Alan Cox <alan@linux.intel.com>

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

* Re: [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers
  2011-08-15  9:17 ` [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers Jamie Iles
@ 2011-08-15 12:44   ` Ralf Baechle
  2011-08-15 12:47     ` Ralf Baechle
  2011-08-18 18:40   ` Anoop P.A.
  1 sibling, 1 reply; 16+ messages in thread
From: Ralf Baechle @ 2011-08-15 12:44 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-serial, arnd

On Mon, Aug 15, 2011 at 10:17:53AM +0100, Jamie Iles wrote:

Thanks, queued for 3.2.

But please cc all MIPS patches to linux-mips@linux-mips.org.

  Ralf

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

* Re: [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers
  2011-08-15 12:44   ` Ralf Baechle
@ 2011-08-15 12:47     ` Ralf Baechle
  0 siblings, 0 replies; 16+ messages in thread
From: Ralf Baechle @ 2011-08-15 12:47 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-serial, arnd

On Mon, Aug 15, 2011 at 01:44:48PM +0100, Ralf Baechle wrote:

> Thanks, queued for 3.2.
> 
> But please cc all MIPS patches to linux-mips@linux-mips.org.

I notice that patch 4/5 depends on this one so I'm going to drop this one
again from my patch queue; preferably you should merge both 3/5 and 4/5.

Acked-by: Ralf Baechle <ralf@linux-mips.org>

Thanks,

  Ralf

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

* Re: [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver
  2011-08-15  9:17 [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Jamie Iles
                   ` (5 preceding siblings ...)
  2011-08-15  9:34 ` [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Alan Cox
@ 2011-08-16 14:05 ` Arnd Bergmann
  2011-08-16 14:20   ` Jamie Iles
  6 siblings, 1 reply; 16+ messages in thread
From: Arnd Bergmann @ 2011-08-16 14:05 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-serial

On Monday 15 August 2011, Jamie Iles wrote:
> 
> This is just a repost of a series from a couple of months ago to remove
> the special DWAPB 8250 handling from the generic driver.
> 
> Arnd, I'd have a platform that needs some special handlers like these
> using the device tree and of_serial.  Once these are merged I plan on
> passing the serial_{in,out} and handle_irq callbacks through
> platform_data to of_serial.  Does this seem sensible?

Do you mean passing through the uart_port? Yes, that seems sensible.
Depending on how complicated the callbacks are, it might be
simpler to write a new platform_driver based on of_serial.c for
your device that hardcodes these.

The of_serial driver started out with the goal of covering all sorts
of serial port devices based on device tree probing, but with the
direction that the platform drivers have moved to, this seems a bit
silly, and I think we should take the NWPSERIAL support out and
rename it to 8250_of.c.

	Arnd

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

* Re: [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver
  2011-08-16 14:05 ` Arnd Bergmann
@ 2011-08-16 14:20   ` Jamie Iles
  2011-08-16 14:39     ` Arnd Bergmann
  0 siblings, 1 reply; 16+ messages in thread
From: Jamie Iles @ 2011-08-16 14:20 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Jamie Iles, linux-serial

On Tue, Aug 16, 2011 at 04:05:08PM +0200, Arnd Bergmann wrote:
> On Monday 15 August 2011, Jamie Iles wrote:
> > 
> > This is just a repost of a series from a couple of months ago to remove
> > the special DWAPB 8250 handling from the generic driver.
> > 
> > Arnd, I'd have a platform that needs some special handlers like these
> > using the device tree and of_serial.  Once these are merged I plan on
> > passing the serial_{in,out} and handle_irq callbacks through
> > platform_data to of_serial.  Does this seem sensible?
> 
> Do you mean passing through the uart_port? Yes, that seems sensible.
> Depending on how complicated the callbacks are, it might be
> simpler to write a new platform_driver based on of_serial.c for
> your device that hardcodes these.

Well for my platform it's handling the DesignWare variant of the 8250 
but the bus restricts us to 32-bit accesses.

> The of_serial driver started out with the goal of covering all sorts
> of serial port devices based on device tree probing, but with the
> direction that the platform drivers have moved to, this seems a bit
> silly, and I think we should take the NWPSERIAL support out and
> rename it to 8250_of.c.

In that case I could add an ns8250dw compatible string and put the 
handlers into here (both 8 and 32 bit variants).  Note that the MIPS 
user that I've removed in this series should probably still keep the 
accessors in the platform code as they've remapped the USR to a 
different location to the Synopsys spec.

Jamie

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

* Re: [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver
  2011-08-16 14:20   ` Jamie Iles
@ 2011-08-16 14:39     ` Arnd Bergmann
  0 siblings, 0 replies; 16+ messages in thread
From: Arnd Bergmann @ 2011-08-16 14:39 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-serial

On Tuesday 16 August 2011, Jamie Iles wrote:
> In that case I could add an ns8250dw compatible string and put the 
> handlers into here (both 8 and 32 bit variants).

Not sure I understand what the effect of that is. I'll just wait
for your patch then and assume that you're doing it right.

> Note that the MIPS 
> user that I've removed in this series should probably still keep the 
> accessors in the platform code as they've remapped the USR to a 
> different location to the Synopsys spec.

Agreed.

	Arnd

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

* Re: [PATCH 4/5] mips: msp71xx/serial: add workaround for DW UART
  2011-08-15  9:17 ` [PATCH 4/5] mips: msp71xx/serial: add workaround for DW UART Jamie Iles
@ 2011-08-17 12:56   ` Ralf Baechle
  2011-08-17 13:51     ` Jamie Iles
  0 siblings, 1 reply; 16+ messages in thread
From: Ralf Baechle @ 2011-08-17 12:56 UTC (permalink / raw)
  To: Jamie Iles; +Cc: linux-serial, arnd, Alan Cox

On Mon, Aug 15, 2011 at 10:17:54AM +0100, Jamie Iles wrote:

> The Synopsys DesignWare UART in pmc-sierra msp71xx has an extra feature
> where the UART detects a write attempt to the LCR whilst busy and raises
> an interrupt.  The driver needs to clear the interrupt and rewrite the
> LCR.  Move this into platform code and out of the 8250 driver.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Alan Cox <alan@linux.intel.com>
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Not quite the way I'd have done it but looks like it's going to work.

Acked-by: Ralf Baechle <ralf@linux-mips.org>

  Ralf

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

* Re: [PATCH 4/5] mips: msp71xx/serial: add workaround for DW UART
  2011-08-17 12:56   ` Ralf Baechle
@ 2011-08-17 13:51     ` Jamie Iles
  0 siblings, 0 replies; 16+ messages in thread
From: Jamie Iles @ 2011-08-17 13:51 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Jamie Iles, linux-serial, arnd, Alan Cox

On Wed, Aug 17, 2011 at 01:56:33PM +0100, Ralf Baechle wrote:
> On Mon, Aug 15, 2011 at 10:17:54AM +0100, Jamie Iles wrote:
> 
> > The Synopsys DesignWare UART in pmc-sierra msp71xx has an extra feature
> > where the UART detects a write attempt to the LCR whilst busy and raises
> > an interrupt.  The driver needs to clear the interrupt and rewrite the
> > LCR.  Move this into platform code and out of the 8250 driver.
> > 
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > Cc: Alan Cox <alan@linux.intel.com>
> > Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> 
> Not quite the way I'd have done it but looks like it's going to work.
> 
> Acked-by: Ralf Baechle <ralf@linux-mips.org>

Thanks Ralf.  Out of interest, what would you have done differently?

Jamie

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

* RE: [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers
  2011-08-15  9:17 ` [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers Jamie Iles
  2011-08-15 12:44   ` Ralf Baechle
@ 2011-08-18 18:40   ` Anoop P.A.
  1 sibling, 0 replies; 16+ messages in thread
From: Anoop P.A. @ 2011-08-18 18:40 UTC (permalink / raw)
  To: Jamie Iles, linux-serial; +Cc: arnd, Ralf Baechle

Acked-by:  Anoop P A<Anoop_P.A@pmc-sierra.com>


> -----Original Message-----
> From: linux-mips-bounce@linux-mips.org
[mailto:linux-mips-bounce@linux-
> mips.org] On Behalf Of Jamie Iles
> Sent: Monday, August 15, 2011 2:48 PM
> To: linux-serial@vger.kernel.org
> Cc: arnd@arndb.de; Jamie Iles; Ralf Baechle
> Subject: [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers
> 
> Convert to pr_foo() helpers rather than printk(KERN_.*).
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> ---
>  arch/mips/pmc-sierra/msp71xx/msp_serial.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/pmc-sierra/msp71xx/msp_serial.c
b/arch/mips/pmc-
> sierra/msp71xx/msp_serial.c
> index f726162..c3247b5 100644
> --- a/arch/mips/pmc-sierra/msp71xx/msp_serial.c
> +++ b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
> @@ -65,7 +65,7 @@ void __init msp_serial_setup(void)
>  	up.line         = 0;
>  	up.private_data		= (void*)UART0_STATUS_REG;
>  	if (early_serial_setup(&up))
> -		printk(KERN_ERR "Early serial init of port 0 failed\n");
> +		pr_err("Early serial init of port 0 failed\n");
> 
>  	/* Initialize the second serial port, if one exists */
>  	switch (mips_machtype) {
> @@ -89,5 +89,5 @@ void __init msp_serial_setup(void)
>  	up.line         = 1;
>  	up.private_data		= (void*)UART1_STATUS_REG;
>  	if (early_serial_setup(&up))
> -		printk(KERN_ERR "Early serial init of port 1 failed\n");
> +		pr_err("Early serial init of port 1 failed\n");
>  }
> --
> 1.7.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe
linux-serial" in the
> body of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html


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

* [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver
@ 2011-06-16  9:19 Jamie Iles
  0 siblings, 0 replies; 16+ messages in thread
From: Jamie Iles @ 2011-06-16  9:19 UTC (permalink / raw)
  To: linux-serial; +Cc: Jamie Iles

This series removes UPIO_DWAPB and UPIO_DWAPB32 from the 8250 serial driver.
The quirk handling is moved into the platform code for the only user
(MIPS pmc-sierra).

A .handle_irq callback is added to uart_port and uart_8250_port so that
platforms can override IRQ behaviour in a generic way.

Jamie Iles (5):
  tty: serial: allow ports to override the irq handler
  tty: serial8250: allow platforms to override irq handler
  mips: msp71xx/serial: convert to pr_foo() helpers
  mips: msp71xx/serial: add workaround for DW UART
  tty: serial8250: remove UPIO_DWAPB{,32}

 arch/mips/pmc-sierra/msp71xx/msp_serial.c |   73 ++++++++++++++++++--
 drivers/tty/serial/8250.c                 |  107 +++++++++-------------------
 drivers/tty/serial/serial_core.c          |    4 -
 include/linux/serial_8250.h               |    2 +
 include/linux/serial_core.h               |    5 +-
 5 files changed, 106 insertions(+), 85 deletions(-)

-- 
1.7.4.1


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

end of thread, other threads:[~2011-08-18 19:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-15  9:17 [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Jamie Iles
2011-08-15  9:17 ` [PATCH 1/5] tty: serial: allow ports to override the irq handler Jamie Iles
2011-08-15  9:17 ` [PATCH 2/5] tty: serial8250: allow platforms to override " Jamie Iles
2011-08-15  9:17 ` [PATCH 3/5] mips: msp71xx/serial: convert to pr_foo() helpers Jamie Iles
2011-08-15 12:44   ` Ralf Baechle
2011-08-15 12:47     ` Ralf Baechle
2011-08-18 18:40   ` Anoop P.A.
2011-08-15  9:17 ` [PATCH 4/5] mips: msp71xx/serial: add workaround for DW UART Jamie Iles
2011-08-17 12:56   ` Ralf Baechle
2011-08-17 13:51     ` Jamie Iles
2011-08-15  9:17 ` [PATCH 5/5] tty: serial8250: remove UPIO_DWAPB{,32} Jamie Iles
2011-08-15  9:34 ` [PATCH 0/5] Remove UPIO_DWAPB{,32} from 8250 driver Alan Cox
2011-08-16 14:05 ` Arnd Bergmann
2011-08-16 14:20   ` Jamie Iles
2011-08-16 14:39     ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2011-06-16  9:19 Jamie Iles

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.