linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities
@ 2012-12-03 11:17 Heikki Krogerus
  2012-12-03 11:17 ` [PATCHv2 1/5] serial: 8250: Allow drivers to deliver capabilities Heikki Krogerus
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Heikki Krogerus @ 2012-12-03 11:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jamie Iles, linux-serial, LKML


Changes since v1:
- rebased on top of Greg's tty-next

These are mainly small 8250_dw.c changes. The interesting patch is
probable the first one that changes 8250.c so the drivers are able to
deliver their UART's capabilities when they are registering ports.


Heikki Krogerus (5):
  serial: 8250: Allow drivers to deliver capabilities
  serial: 8250_dw: Don't use UPF_FIXED_TYPE
  serial: 8250_dw: Map IO memory
  serial: 8250_dw: Move device tree code to separate function
  serial: 8250_dw: Set FIFO size dynamically

 drivers/tty/serial/8250/8250.c    |   22 ++++--
 drivers/tty/serial/8250/8250_dw.c |  140 +++++++++++++++++++++++++++----------
 2 files changed, 120 insertions(+), 42 deletions(-)

-- 
1.7.10.4


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

* [PATCHv2 1/5] serial: 8250: Allow drivers to deliver capabilities
  2012-12-03 11:17 [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Heikki Krogerus
@ 2012-12-03 11:17 ` Heikki Krogerus
  2012-12-03 11:17 ` [PATCHv2 2/5] serial: 8250_dw: Don't use UPF_FIXED_TYPE Heikki Krogerus
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Heikki Krogerus @ 2012-12-03 11:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jamie Iles, linux-serial, LKML

Modern UARTs are able to provide information about their
capabilities such as FIFO size. This allows the drivers to
deliver this information to 8250.c when they are registering
ports.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/tty/serial/8250/8250.c |   22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index d085e3a..da3f828 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -1980,9 +1980,12 @@ static int serial8250_startup(struct uart_port *port)
 	if (port->type == PORT_8250_CIR)
 		return -ENODEV;
 
-	port->fifosize = uart_config[up->port.type].fifo_size;
-	up->tx_loadsz = uart_config[up->port.type].tx_loadsz;
-	up->capabilities = uart_config[up->port.type].flags;
+	if (!port->fifosize)
+		port->fifosize = uart_config[port->type].fifo_size;
+	if (!up->tx_loadsz)
+		up->tx_loadsz = uart_config[port->type].tx_loadsz;
+	if (!up->capabilities)
+		up->capabilities = uart_config[port->type].flags;
 	up->mcr = 0;
 
 	if (port->iotype != up->cur_iotype)
@@ -2815,9 +2818,12 @@ static void
 serial8250_init_fixed_type_port(struct uart_8250_port *up, unsigned int type)
 {
 	up->port.type = type;
-	up->port.fifosize = uart_config[type].fifo_size;
-	up->capabilities = uart_config[type].flags;
-	up->tx_loadsz = uart_config[type].tx_loadsz;
+	if (!up->port.fifosize)
+		up->port.fifosize = uart_config[type].fifo_size;
+	if (!up->tx_loadsz)
+		up->tx_loadsz = uart_config[type].tx_loadsz;
+	if (!up->capabilities)
+		up->capabilities = uart_config[type].flags;
 }
 
 static void __init
@@ -3251,6 +3257,10 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
 		uart->bugs		= up->bugs;
 		uart->port.mapbase      = up->port.mapbase;
 		uart->port.private_data = up->port.private_data;
+		uart->port.fifosize	= up->port.fifosize;
+		uart->tx_loadsz		= up->tx_loadsz;
+		uart->capabilities	= up->capabilities;
+
 		if (up->port.dev)
 			uart->port.dev = up->port.dev;
 
-- 
1.7.10.4


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

* [PATCHv2 2/5] serial: 8250_dw: Don't use UPF_FIXED_TYPE
  2012-12-03 11:17 [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Heikki Krogerus
  2012-12-03 11:17 ` [PATCHv2 1/5] serial: 8250: Allow drivers to deliver capabilities Heikki Krogerus
@ 2012-12-03 11:17 ` Heikki Krogerus
  2012-12-03 11:17 ` [PATCHv2 3/5] serial: 8250_dw: Map IO memory Heikki Krogerus
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Heikki Krogerus @ 2012-12-03 11:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jamie Iles, linux-serial, LKML

Allow 8250.c to determine the port type for us. This allows
the driver take advantage of FIFO on Designware UARTs that
have it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/tty/serial/8250/8250_dw.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 1d0dba2..ff83ea5 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -112,7 +112,7 @@ static int dw8250_probe(struct platform_device *pdev)
 	uart.port.handle_irq = dw8250_handle_irq;
 	uart.port.type = PORT_8250;
 	uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP |
-		UPF_FIXED_PORT | UPF_FIXED_TYPE;
+		UPF_FIXED_PORT;
 	uart.port.dev = &pdev->dev;
 
 	uart.port.iotype = UPIO_MEM;
-- 
1.7.10.4


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

* [PATCHv2 3/5] serial: 8250_dw: Map IO memory
  2012-12-03 11:17 [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Heikki Krogerus
  2012-12-03 11:17 ` [PATCHv2 1/5] serial: 8250: Allow drivers to deliver capabilities Heikki Krogerus
  2012-12-03 11:17 ` [PATCHv2 2/5] serial: 8250_dw: Don't use UPF_FIXED_TYPE Heikki Krogerus
@ 2012-12-03 11:17 ` Heikki Krogerus
  2012-12-03 11:47   ` Alan Cox
  2012-12-03 15:40   ` Jamie Iles
  2012-12-03 11:17 ` [PATCHv2 4/5] serial: 8250_dw: Move device tree code to separate function Heikki Krogerus
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 13+ messages in thread
From: Heikki Krogerus @ 2012-12-03 11:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jamie Iles, linux-serial, LKML

This needs to be done in order to later access the
Designware specific registers.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/tty/serial/8250/8250_dw.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index ff83ea5..300bbed 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -111,10 +111,13 @@ static int dw8250_probe(struct platform_device *pdev)
 	uart.port.irq = irq->start;
 	uart.port.handle_irq = dw8250_handle_irq;
 	uart.port.type = PORT_8250;
-	uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP |
-		UPF_FIXED_PORT;
+	uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_FIXED_PORT;
 	uart.port.dev = &pdev->dev;
 
+	uart.port.membase = ioremap(regs->start, regs->end - regs->start);
+	if (!uart.port.membase)
+		return -ENOMEM;
+
 	uart.port.iotype = UPIO_MEM;
 	uart.port.serial_in = dw8250_serial_in;
 	uart.port.serial_out = dw8250_serial_out;
-- 
1.7.10.4


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

* [PATCHv2 4/5] serial: 8250_dw: Move device tree code to separate function
  2012-12-03 11:17 [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Heikki Krogerus
                   ` (2 preceding siblings ...)
  2012-12-03 11:17 ` [PATCHv2 3/5] serial: 8250_dw: Map IO memory Heikki Krogerus
@ 2012-12-03 11:17 ` Heikki Krogerus
  2012-12-03 11:17 ` [PATCHv2 5/5] serial: 8250_dw: Set FIFO size dynamically Heikki Krogerus
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Heikki Krogerus @ 2012-12-03 11:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jamie Iles, linux-serial, LKML

Trivial cleanup. This makes it easier to add different
methods to enumerate the device, for example ACPI 5.0
enumeration.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/tty/serial/8250/8250_dw.c |   76 ++++++++++++++++++++++---------------
 1 file changed, 46 insertions(+), 30 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 300bbed..c4e28df 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -87,25 +87,51 @@ static int dw8250_handle_irq(struct uart_port *p)
 	return 0;
 }
 
+static int dw8250_probe_of(struct uart_port *p)
+{
+	struct device_node	*np = p->dev->of_node;
+	u32			val;
+
+	if (!of_property_read_u32(np, "reg-io-width", &val)) {
+		switch (val) {
+		case 1:
+			break;
+		case 4:
+			p->iotype = UPIO_MEM32;
+			p->serial_in = dw8250_serial_in32;
+			p->serial_out = dw8250_serial_out32;
+			break;
+		default:
+			dev_err(p->dev, "unsupported reg-io-width (%u)\n", val);
+			return -EINVAL;
+		}
+	}
+
+	if (!of_property_read_u32(np, "reg-shift", &val))
+		p->regshift = val;
+
+	if (of_property_read_u32(np, "clock-frequency", &val)) {
+		dev_err(p->dev, "no clock-frequency property set\n");
+		return -EINVAL;
+	}
+	p->uartclk = val;
+
+	return 0;
+}
+
 static int dw8250_probe(struct platform_device *pdev)
 {
 	struct uart_8250_port uart = {};
 	struct resource *regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct resource *irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	struct device_node *np = pdev->dev.of_node;
-	u32 val;
 	struct dw8250_data *data;
+	int err;
 
 	if (!regs || !irq) {
 		dev_err(&pdev->dev, "no registers/irq defined\n");
 		return -EINVAL;
 	}
 
-	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-	if (!data)
-		return -ENOMEM;
-	uart.port.private_data = data;
-
 	spin_lock_init(&uart.port.lock);
 	uart.port.mapbase = regs->start;
 	uart.port.irq = irq->start;
@@ -121,30 +147,20 @@ static int dw8250_probe(struct platform_device *pdev)
 	uart.port.iotype = UPIO_MEM;
 	uart.port.serial_in = dw8250_serial_in;
 	uart.port.serial_out = dw8250_serial_out;
-	if (!of_property_read_u32(np, "reg-io-width", &val)) {
-		switch (val) {
-		case 1:
-			break;
-		case 4:
-			uart.port.iotype = UPIO_MEM32;
-			uart.port.serial_in = dw8250_serial_in32;
-			uart.port.serial_out = dw8250_serial_out32;
-			break;
-		default:
-			dev_err(&pdev->dev, "unsupported reg-io-width (%u)\n",
-				val);
-			return -EINVAL;
-		}
+
+	if (pdev->dev.of_node) {
+		err = dw8250_probe_of(&uart.port);
+		if (err)
+			return err;
+	} else {
+		return -ENODEV;
 	}
 
-	if (!of_property_read_u32(np, "reg-shift", &val))
-		uart.port.regshift = val;
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
 
-	if (of_property_read_u32(np, "clock-frequency", &val)) {
-		dev_err(&pdev->dev, "no clock-frequency property set\n");
-		return -EINVAL;
-	}
-	uart.port.uartclk = val;
+	uart.port.private_data = data;
 
 	data->line = serial8250_register_8250_port(&uart);
 	if (data->line < 0)
@@ -187,7 +203,7 @@ static int dw8250_resume(struct platform_device *pdev)
 #define dw8250_resume NULL
 #endif /* CONFIG_PM */
 
-static const struct of_device_id dw8250_match[] = {
+static const struct of_device_id dw8250_of_match[] = {
 	{ .compatible = "snps,dw-apb-uart" },
 	{ /* Sentinel */ }
 };
@@ -197,7 +213,7 @@ static struct platform_driver dw8250_platform_driver = {
 	.driver = {
 		.name		= "dw-apb-uart",
 		.owner		= THIS_MODULE,
-		.of_match_table	= dw8250_match,
+		.of_match_table	= dw8250_of_match,
 	},
 	.probe			= dw8250_probe,
 	.remove			= dw8250_remove,
-- 
1.7.10.4


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

* [PATCHv2 5/5] serial: 8250_dw: Set FIFO size dynamically
  2012-12-03 11:17 [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Heikki Krogerus
                   ` (3 preceding siblings ...)
  2012-12-03 11:17 ` [PATCHv2 4/5] serial: 8250_dw: Move device tree code to separate function Heikki Krogerus
@ 2012-12-03 11:17 ` Heikki Krogerus
  2012-12-03 15:43 ` [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Jamie Iles
  2013-01-09  9:22 ` Heikki Krogerus
  6 siblings, 0 replies; 13+ messages in thread
From: Heikki Krogerus @ 2012-12-03 11:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jamie Iles, linux-serial, LKML

Designware UART provides optional Component Parameter
Register that lists most of the capabilities of the UART,
including FIFO size. This uses that register to set FIFO
size for the port before registering it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/tty/serial/8250/8250_dw.c |   57 ++++++++++++++++++++++++++++++++++---
 1 file changed, 53 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index c4e28df..e834d41 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -25,6 +25,28 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
+/* Offsets for the DesignWare specific registers */
+#define DW_UART_USR	0x1f /* UART Status Register */
+#define DW_UART_CPR	0xf4 /* Component Parameter Register */
+#define DW_UART_UCV	0xf8 /* UART Component Version */
+
+/* Component Parameter Register bits */
+#define DW_UART_CPR_ABP_DATA_WIDTH	(3 << 0)
+#define DW_UART_CPR_AFCE_MODE		(1 << 4)
+#define DW_UART_CPR_THRE_MODE		(1 << 5)
+#define DW_UART_CPR_SIR_MODE		(1 << 6)
+#define DW_UART_CPR_SIR_LP_MODE		(1 << 7)
+#define DW_UART_CPR_ADDITIONAL_FEATURES	(1 << 8)
+#define DW_UART_CPR_FIFO_ACCESS		(1 << 9)
+#define DW_UART_CPR_FIFO_STAT		(1 << 10)
+#define DW_UART_CPR_SHADOW		(1 << 11)
+#define DW_UART_CPR_ENCODED_PARMS	(1 << 12)
+#define DW_UART_CPR_DMA_EXTRA		(1 << 13)
+#define DW_UART_CPR_FIFO_MODE		(0xff << 16)
+/* Helper for fifo size calculation */
+#define DW_UART_CPR_FIFO_SIZE(a)	(((a >> 16) & 0xff) * 16)
+
+
 struct dw8250_data {
 	int	last_lcr;
 	int	line;
@@ -66,9 +88,6 @@ static unsigned int dw8250_serial_in32(struct uart_port *p, int offset)
 	return readl(p->membase + offset);
 }
 
-/* Offset for the DesignWare's UART Status Register. */
-#define UART_USR	0x1f
-
 static int dw8250_handle_irq(struct uart_port *p)
 {
 	struct dw8250_data *d = p->private_data;
@@ -78,7 +97,7 @@ static int dw8250_handle_irq(struct uart_port *p)
 		return 1;
 	} else if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
 		/* Clear the USR and write the LCR again. */
-		(void)p->serial_in(p, UART_USR);
+		(void)p->serial_in(p, DW_UART_USR);
 		p->serial_out(p, d->last_lcr, UART_LCR);
 
 		return 1;
@@ -119,6 +138,34 @@ static int dw8250_probe_of(struct uart_port *p)
 	return 0;
 }
 
+static void dw8250_setup_port(struct uart_8250_port *up)
+{
+	struct uart_port	*p = &up->port;
+	u32			reg = readl(p->membase + DW_UART_UCV);
+
+	/*
+	 * If the Component Version Register returns zero, we know that
+	 * ADDITIONAL_FEATURES are not enabled. No need to go any further.
+	 */
+	if (!reg)
+		return;
+
+	dev_dbg_ratelimited(p->dev, "Designware UART version %c.%c%c\n",
+		(reg >> 24) & 0xff, (reg >> 16) & 0xff, (reg >> 8) & 0xff);
+
+	reg = readl(p->membase + DW_UART_CPR);
+	if (!reg)
+		return;
+
+	/* Select the type based on fifo */
+	if (reg & DW_UART_CPR_FIFO_MODE) {
+		p->type = PORT_16550A;
+		p->flags |= UPF_FIXED_TYPE;
+		p->fifosize = DW_UART_CPR_FIFO_SIZE(reg);
+		up->tx_loadsz = p->fifosize;
+	}
+}
+
 static int dw8250_probe(struct platform_device *pdev)
 {
 	struct uart_8250_port uart = {};
@@ -156,6 +203,8 @@ static int dw8250_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	dw8250_setup_port(&uart);
+
 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
 	if (!data)
 		return -ENOMEM;
-- 
1.7.10.4


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

* Re: [PATCHv2 3/5] serial: 8250_dw: Map IO memory
  2012-12-03 11:17 ` [PATCHv2 3/5] serial: 8250_dw: Map IO memory Heikki Krogerus
@ 2012-12-03 11:47   ` Alan Cox
  2012-12-03 15:40   ` Jamie Iles
  1 sibling, 0 replies; 13+ messages in thread
From: Alan Cox @ 2012-12-03 11:47 UTC (permalink / raw)
  To: Heikki Krogerus; +Cc: Greg Kroah-Hartman, Jamie Iles, linux-serial, LKML

On Mon,  3 Dec 2012 13:17:57 +0200
Heikki Krogerus <heikki.krogerus@linux.intel.com> wrote:

> This needs to be done in order to later access the
> Designware specific registers.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

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

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

* Re: [PATCHv2 3/5] serial: 8250_dw: Map IO memory
  2012-12-03 11:17 ` [PATCHv2 3/5] serial: 8250_dw: Map IO memory Heikki Krogerus
  2012-12-03 11:47   ` Alan Cox
@ 2012-12-03 15:40   ` Jamie Iles
  2012-12-04  8:17     ` Heikki Krogerus
  1 sibling, 1 reply; 13+ messages in thread
From: Jamie Iles @ 2012-12-03 15:40 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: Greg Kroah-Hartman, Alan Cox, Jamie Iles, linux-serial, LKML

Hi Heikki,

On Mon, Dec 03, 2012 at 01:17:57PM +0200, Heikki Krogerus wrote:
> This needs to be done in order to later access the
> Designware specific registers.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  drivers/tty/serial/8250/8250_dw.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index ff83ea5..300bbed 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -111,10 +111,13 @@ static int dw8250_probe(struct platform_device *pdev)
>  	uart.port.irq = irq->start;
>  	uart.port.handle_irq = dw8250_handle_irq;
>  	uart.port.type = PORT_8250;
> -	uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP |
> -		UPF_FIXED_PORT;
> +	uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_FIXED_PORT;
>  	uart.port.dev = &pdev->dev;
>  
> +	uart.port.membase = ioremap(regs->start, regs->end - regs->start);

Doesn't this have an off-by-one error?  Perhaps:

+	uart.port.membase = ioremap(regs->start, resource_size(regs));

instead?

Jamie

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

* Re: [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities
  2012-12-03 11:17 [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Heikki Krogerus
                   ` (4 preceding siblings ...)
  2012-12-03 11:17 ` [PATCHv2 5/5] serial: 8250_dw: Set FIFO size dynamically Heikki Krogerus
@ 2012-12-03 15:43 ` Jamie Iles
  2013-01-09  9:22 ` Heikki Krogerus
  6 siblings, 0 replies; 13+ messages in thread
From: Jamie Iles @ 2012-12-03 15:43 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: Greg Kroah-Hartman, Alan Cox, Jamie Iles, linux-serial, LKML

Hi Heikki,

On Mon, Dec 03, 2012 at 01:17:54PM +0200, Heikki Krogerus wrote:
> 
> Changes since v1:
> - rebased on top of Greg's tty-next
> 
> These are mainly small 8250_dw.c changes. The interesting patch is
> probable the first one that changes 8250.c so the drivers are able to
> deliver their UART's capabilities when they are registering ports.

Other than my comment on 3/5 it looks great.

Reviewed-by: Jamie Iles <jamie@jamieiles.com>

Jamie

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

* Re: [PATCHv2 3/5] serial: 8250_dw: Map IO memory
  2012-12-03 15:40   ` Jamie Iles
@ 2012-12-04  8:17     ` Heikki Krogerus
  2012-12-04 15:21       ` [PATCHv3 " Heikki Krogerus
  0 siblings, 1 reply; 13+ messages in thread
From: Heikki Krogerus @ 2012-12-04  8:17 UTC (permalink / raw)
  To: Jamie Iles; +Cc: Greg Kroah-Hartman, Alan Cox, linux-serial, LKML

Hi Jamie,

On Mon, Dec 03, 2012 at 03:40:14PM +0000, Jamie Iles wrote:
> > +	uart.port.membase = ioremap(regs->start, regs->end - regs->start);
> 
> Doesn't this have an off-by-one error?

True.

> +	uart.port.membase = ioremap(regs->start, resource_size(regs));
> 
> instead?

Yes, I'll fix this. Thanks!

-- 
heikki

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

* [PATCHv3 3/5] serial: 8250_dw: Map IO memory
  2012-12-04  8:17     ` Heikki Krogerus
@ 2012-12-04 15:21       ` Heikki Krogerus
  2012-12-04 17:02         ` Jamie Iles
  0 siblings, 1 reply; 13+ messages in thread
From: Heikki Krogerus @ 2012-12-04 15:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jamie Iles, linux-serial, LKML

This needs to be done in order to later access the
Designware specific registers.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/tty/serial/8250/8250_dw.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index ff83ea5..e174901 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -111,10 +111,13 @@ static int dw8250_probe(struct platform_device *pdev)
 	uart.port.irq = irq->start;
 	uart.port.handle_irq = dw8250_handle_irq;
 	uart.port.type = PORT_8250;
-	uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP |
-		UPF_FIXED_PORT;
+	uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_FIXED_PORT;
 	uart.port.dev = &pdev->dev;
 
+	uart.port.membase = ioremap(regs->start, resource_size(regs));
+	if (!uart.port.membase)
+		return -ENOMEM;
+
 	uart.port.iotype = UPIO_MEM;
 	uart.port.serial_in = dw8250_serial_in;
 	uart.port.serial_out = dw8250_serial_out;
-- 
1.7.10.4


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

* Re: [PATCHv3 3/5] serial: 8250_dw: Map IO memory
  2012-12-04 15:21       ` [PATCHv3 " Heikki Krogerus
@ 2012-12-04 17:02         ` Jamie Iles
  0 siblings, 0 replies; 13+ messages in thread
From: Jamie Iles @ 2012-12-04 17:02 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: Greg Kroah-Hartman, Alan Cox, Jamie Iles, linux-serial, LKML

Looks good to me!

On Tue, Dec 04, 2012 at 05:21:52PM +0200, Heikki Krogerus wrote:
> This needs to be done in order to later access the
> Designware specific registers.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

Reviewed-by: Jamie Iles <jamie@jamieiles.com>

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

* Re: [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities
  2012-12-03 11:17 [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Heikki Krogerus
                   ` (5 preceding siblings ...)
  2012-12-03 15:43 ` [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Jamie Iles
@ 2013-01-09  9:22 ` Heikki Krogerus
  6 siblings, 0 replies; 13+ messages in thread
From: Heikki Krogerus @ 2013-01-09  9:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jamie Iles, linux-serial, LKML

Hi,

On Mon, Dec 03, 2012 at 01:17:54PM +0200, Heikki Krogerus wrote:
> Changes since v1:
> - rebased on top of Greg's tty-next
> 
> These are mainly small 8250_dw.c changes. The interesting patch is
> probable the first one that changes 8250.c so the drivers are able to
> deliver their UART's capabilities when they are registering ports.

I will make one more version of this set. I'll add ACPI support for
8250_dw.c, and also introduce dmaengine support for 8250.c.

-- 
heikki

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

end of thread, other threads:[~2013-01-09  9:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03 11:17 [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Heikki Krogerus
2012-12-03 11:17 ` [PATCHv2 1/5] serial: 8250: Allow drivers to deliver capabilities Heikki Krogerus
2012-12-03 11:17 ` [PATCHv2 2/5] serial: 8250_dw: Don't use UPF_FIXED_TYPE Heikki Krogerus
2012-12-03 11:17 ` [PATCHv2 3/5] serial: 8250_dw: Map IO memory Heikki Krogerus
2012-12-03 11:47   ` Alan Cox
2012-12-03 15:40   ` Jamie Iles
2012-12-04  8:17     ` Heikki Krogerus
2012-12-04 15:21       ` [PATCHv3 " Heikki Krogerus
2012-12-04 17:02         ` Jamie Iles
2012-12-03 11:17 ` [PATCHv2 4/5] serial: 8250_dw: Move device tree code to separate function Heikki Krogerus
2012-12-03 11:17 ` [PATCHv2 5/5] serial: 8250_dw: Set FIFO size dynamically Heikki Krogerus
2012-12-03 15:43 ` [PATCHv2 0/5] serial: 8250: 8250_dw changes and dynamic capabilities Jamie Iles
2013-01-09  9:22 ` Heikki Krogerus

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).