public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] U6715 16550A serial driver support
  2010-07-29 13:32 New U6715 8250 serial patch Philippe Langlais
@ 2010-07-29 13:32 ` Philippe Langlais
  2010-07-29 13:53   ` Alan Cox
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Langlais @ 2010-07-29 13:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: alan, gregkh, ludovic.barre, vincent.guittot, Philippe Langlais

UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone):
* Fully compatible with industry standard 16C550 and 16C450 from various
manufacturers
* RX and TX 64 byte FIFO reduces CPU interrupts
* Full double buffering
* Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only)
* Automatic baud rate selection
* Manual or automatic RTS/CTS smart hardware flow control
* Programmable serial characteristics:
– Baud rate generation (50 to 3.25M baud)
– 5, 6, 7 or 8-bit characters
– Even, odd or no-parity bit generation and detection
– 1, 1.5 or 2 stop bit generation
* Independent control of transmit, receive, line status, data set interrupts and FIFOs
* Full status-reporting capabilities
* Separate DMA signaling for RX and TX
* Timed interrupt to spread receive interrupt on known duration
* DMA time-out interrupt to allow detection of end of reception
* Carkit pulse coding and decoding compliant with USB carkit control interface [40]

In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port
Add pre_set_termios call at normal serial8250_set_termios beginning

Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
---
 drivers/serial/8250.c       |   24 ++++++++++++++++++++++++
 include/linux/serial.h      |    3 ++-
 include/linux/serial_8250.h |    3 +++
 include/linux/serial_core.h |    3 +++
 4 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 607ed7f..1e9e2f2 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -300,6 +300,13 @@ static const struct serial8250_config uart_config[] = {
 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
 		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
 	},
+	[PORT_U6_16550A] = {
+		.name		= "U6_16550A",
+		.fifo_size	= 64,
+		.tx_loadsz	= 64,
+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
+	},
 };
 
 #if defined (CONFIG_SERIAL_8250_AU1X00)
@@ -1075,6 +1082,15 @@ static void autoconfig_16550a(struct uart_8250_port *up)
 		DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
 	}
 	serial_outp(up, UART_IER, iersave);
+
+	/*
+	 * We distinguish between 16550A and U6 16550A by counting
+	 * how many bytes are in the FIFO.
+	 */
+	if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
+		up->port.type = PORT_U6_16550A;
+		up->capabilities |= UART_CAP_AFE;
+	}
 }
 
 /*
@@ -2238,6 +2254,10 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
 	unsigned long flags;
 	unsigned int baud, quot;
 
+	/* Possibly call pre_set_termios function.  */
+	if (port->pre_set_termios)
+		port->pre_set_termios(port, termios, old);
+
 	switch (termios->c_cflag & CSIZE) {
 	case CS5:
 		cval = UART_LCR_WLEN5;
@@ -2989,6 +3009,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.pre_set_termios	= p->pre_set_termios;
 		port.dev		= &dev->dev;
 		port.irqflags		|= irqflag;
 		ret = serial8250_register_port(&port);
@@ -3152,6 +3173,9 @@ 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;
+		/*  Possibly add pre_set_termios call */
+		if (port->pre_set_termios)
+			uart->port.pre_set_termios = port->pre_set_termios;
 
 		ret = uart_add_one_port(&serial8250_reg, &uart->port);
 		if (ret == 0)
diff --git a/include/linux/serial.h b/include/linux/serial.h
index c8613c3..06c99b6 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -77,7 +77,8 @@ struct serial_struct {
 #define PORT_16654	11
 #define PORT_16850	12
 #define PORT_RSA	13	/* RSA-DV II/S card */
-#define PORT_MAX	13
+#define PORT_U6_16550A	14
+#define PORT_MAX	14
 
 #define SERIAL_IO_PORT	0
 #define SERIAL_IO_HUB6	1
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index fb46aba..f5fbc7e 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -32,6 +32,9 @@ struct plat_serial8250_port {
 	unsigned int	type;		/* If UPF_FIXED_TYPE */
 	unsigned int	(*serial_in)(struct uart_port *, int);
 	void		(*serial_out)(struct uart_port *, int, int);
+	void		(*pre_set_termios)(struct uart_port *,
+			                   struct ktermios *new,
+			                   struct ktermios *old);
 };
 
 /*
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 18f2fe0..5ff5591 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -279,6 +279,9 @@ struct uart_port {
 	unsigned char __iomem	*membase;		/* read/write[bwl] */
 	unsigned int		(*serial_in)(struct uart_port *, int);
 	void			(*serial_out)(struct uart_port *, int, int);
+	void			(*pre_set_termios)(struct uart_port *,
+				                   struct ktermios *new,
+				                   struct ktermios *old);
 	unsigned int		irq;			/* irq number */
 	unsigned long		irqflags;		/* irq flags  */
 	unsigned int		uartclk;		/* base uart clock */
-- 
1.7.1


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

* Re: [PATCH] U6715 16550A serial driver support
  2010-07-29 13:32 ` [PATCH] U6715 16550A serial driver support Philippe Langlais
@ 2010-07-29 13:53   ` Alan Cox
  0 siblings, 0 replies; 11+ messages in thread
From: Alan Cox @ 2010-07-29 13:53 UTC (permalink / raw)
  To: Philippe Langlais; +Cc: linux-kernel, gregkh, ludovic.barre, vincent.guittot

> In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port

That may not be reliable given the other 8250 clones around but looks
generally sane.


> @@ -2238,6 +2254,10 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
>  	unsigned long flags;
>  	unsigned int baud, quot;
>  
> +	/* Possibly call pre_set_termios function.  */
> +	if (port->pre_set_termios)
> +		port->pre_set_termios(port, termios, old);
> +

Ok I think it might be better to have

serial8250_do_set_termios(...)
{
	/* Existing set_termios code here */
}
EXPORT_SYMBOL(serial8250_do_set_termios);

serial8250_set_termios(...)
{
	if (port->set_termios)
		return port->set_termios(...)
	else
		serial8250_do_set_termions(...)
}

That allows people to wrap it with before/after/both handling, or replace
it entirely.

So in your case it would

my_set_termios()
{
	/* pre set termios code here */
	return serial8250_do_set_termios();
}


Looks ok to me though - it splits the special bits out from the core
nicely

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

* [PATCH] U6715 16550A serial driver support
@ 2010-07-29 15:13 Philippe Langlais
  2010-07-29 15:31 ` Alan Cox
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Langlais @ 2010-07-29 15:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: alan, gregkh, ludovic.barre, vincent.guittot, Philippe Langlais

UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone):
* Fully compatible with industry standard 16C550 and 16C450 from various
manufacturers
* RX and TX 64 byte FIFO reduces CPU interrupts
* Full double buffering
* Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only)
* Automatic baud rate selection
* Manual or automatic RTS/CTS smart hardware flow control
* Programmable serial characteristics:
– Baud rate generation (50 to 3.25M baud)
– 5, 6, 7 or 8-bit characters
– Even, odd or no-parity bit generation and detection
– 1, 1.5 or 2 stop bit generation
* Independent control of transmit, receive, line status, data set interrupts and FIFOs
* Full status-reporting capabilities
* Separate DMA signaling for RX and TX
* Timed interrupt to spread receive interrupt on known duration
* DMA time-out interrupt to allow detection of end of reception
* Carkit pulse coding and decoding compliant with USB carkit control interface [40]

In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port
Add set_termios hook & export serial8250_do_set_termios to change uart
clock following baudrate

Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
---
 drivers/serial/8250.c       |   37 ++++++++++++++++++++++++++++++++++---
 include/linux/serial.h      |    3 ++-
 include/linux/serial_8250.h |    5 +++++
 include/linux/serial_core.h |    3 +++
 4 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 607ed7f..fa85a5c 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -300,6 +300,13 @@ static const struct serial8250_config uart_config[] = {
 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
 		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
 	},
+	[PORT_U6_16550A] = {
+		.name		= "U6_16550A",
+		.fifo_size	= 64,
+		.tx_loadsz	= 64,
+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
+	},
 };
 
 #if defined (CONFIG_SERIAL_8250_AU1X00)
@@ -1075,6 +1082,15 @@ static void autoconfig_16550a(struct uart_8250_port *up)
 		DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
 	}
 	serial_outp(up, UART_IER, iersave);
+
+	/*
+	 * We distinguish between 16550A and U6 16550A by counting
+	 * how many bytes are in the FIFO.
+	 */
+	if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
+		up->port.type = PORT_U6_16550A;
+		up->capabilities |= UART_CAP_AFE;
+	}
 }
 
 /*
@@ -2229,9 +2245,9 @@ static unsigned int serial8250_get_divisor(struct uart_port *port, unsigned int
 	return quot;
 }
 
-static void
-serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
-		       struct ktermios *old)
+void
+serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
+		          struct ktermios *old)
 {
 	struct uart_8250_port *up = (struct uart_8250_port *)port;
 	unsigned char cval, fcr = 0;
@@ -2407,6 +2423,17 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
 	if (tty_termios_baud_rate(termios))
 		tty_termios_encode_baud_rate(termios, baud, baud);
 }
+EXPORT_SYMBOL(serial8250_do_set_termios);
+
+static void
+serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
+		       struct ktermios *old)
+{
+	if (port->set_termios)
+		port->set_termios(port, termios, old);
+	else
+		serial8250_do_set_termios(port, termios, old);
+}
 
 static void
 serial8250_set_ldisc(struct uart_port *port, int new)
@@ -2989,6 +3016,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.set_termios	= p->set_termios;
 		port.dev		= &dev->dev;
 		port.irqflags		|= irqflag;
 		ret = serial8250_register_port(&port);
@@ -3152,6 +3180,9 @@ 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;
+		/*  Possibly override set_termios call */
+		if (port->set_termios)
+			uart->port.set_termios = port->set_termios;
 
 		ret = uart_add_one_port(&serial8250_reg, &uart->port);
 		if (ret == 0)
diff --git a/include/linux/serial.h b/include/linux/serial.h
index c8613c3..06c99b6 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -77,7 +77,8 @@ struct serial_struct {
 #define PORT_16654	11
 #define PORT_16850	12
 #define PORT_RSA	13	/* RSA-DV II/S card */
-#define PORT_MAX	13
+#define PORT_U6_16550A	14
+#define PORT_MAX	14
 
 #define SERIAL_IO_PORT	0
 #define SERIAL_IO_HUB6	1
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index fb46aba..7638dea 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -32,6 +32,9 @@ struct plat_serial8250_port {
 	unsigned int	type;		/* If UPF_FIXED_TYPE */
 	unsigned int	(*serial_in)(struct uart_port *, int);
 	void		(*serial_out)(struct uart_port *, int, int);
+	void		(*set_termios)(struct uart_port *,
+			               struct ktermios *new,
+			               struct ktermios *old);
 };
 
 /*
@@ -71,5 +74,7 @@ extern int early_serial_setup(struct uart_port *port);
 extern int serial8250_find_port(struct uart_port *p);
 extern int serial8250_find_port_for_earlycon(void);
 extern int setup_early_serial8250_console(char *cmdline);
+extern void serial8250_do_set_termios(struct uart_port *port,
+		struct ktermios *termios, struct ktermios *old);
 
 #endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 18f2fe0..119354f 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -279,6 +279,9 @@ struct uart_port {
 	unsigned char __iomem	*membase;		/* read/write[bwl] */
 	unsigned int		(*serial_in)(struct uart_port *, int);
 	void			(*serial_out)(struct uart_port *, int, int);
+	void			(*set_termios)(struct uart_port *,
+				               struct ktermios *new,
+				               struct ktermios *old);
 	unsigned int		irq;			/* irq number */
 	unsigned long		irqflags;		/* irq flags  */
 	unsigned int		uartclk;		/* base uart clock */
-- 
1.7.1


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

* Re: [PATCH] U6715 16550A serial driver support
  2010-07-29 15:13 Philippe Langlais
@ 2010-07-29 15:31 ` Alan Cox
  0 siblings, 0 replies; 11+ messages in thread
From: Alan Cox @ 2010-07-29 15:31 UTC (permalink / raw)
  To: Philippe Langlais; +Cc: linux-kernel, gregkh, ludovic.barre, vincent.guittot

On Thu, 29 Jul 2010 17:13:57 +0200
Philippe Langlais <philippe.langlais@stericsson.com> wrote:

> UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone):
> * Fully compatible with industry standard 16C550 and 16C450 from various

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


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

* [PATCH] U6715 16550A serial driver support
@ 2010-08-02  8:58 Philippe Langlais
  2010-08-04 19:52 ` Andrew Morton
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Langlais @ 2010-08-02  8:58 UTC (permalink / raw)
  To: linux-kernel, gregkh
  Cc: alan, ludovic.barre, vincent.guittot, Philippe Langlais

UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone):
* Fully compatible with industry standard 16C550 and 16C450 from various
manufacturers
* RX and TX 64 byte FIFO reduces CPU interrupts
* Full double buffering
* Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only)
* Automatic baud rate selection
* Manual or automatic RTS/CTS smart hardware flow control
* Programmable serial characteristics:
– Baud rate generation (50 to 3.25M baud)
– 5, 6, 7 or 8-bit characters
– Even, odd or no-parity bit generation and detection
– 1, 1.5 or 2 stop bit generation
* Independent control of transmit, receive, line status, data set interrupts and FIFOs
* Full status-reporting capabilities
* Separate DMA signaling for RX and TX
* Timed interrupt to spread receive interrupt on known duration
* DMA time-out interrupt to allow detection of end of reception
* Carkit pulse coding and decoding compliant with USB carkit control interface [40]

In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port
Add set_termios hook & export serial8250_do_set_termios to change uart
clock following baudrate

Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
---
 drivers/serial/8250.c       |   39 ++++++++++++++++++++++++++++++++++++---
 include/linux/serial.h      |    3 ++-
 include/linux/serial_8250.h |    5 +++++
 include/linux/serial_core.h |    3 +++
 4 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 607ed7f..702f0fa 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -300,6 +300,13 @@ static const struct serial8250_config uart_config[] = {
 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
 		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
 	},
+	[PORT_U6_16550A] = {
+		.name		= "U6_16550A",
+		.fifo_size	= 64,
+		.tx_loadsz	= 64,
+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
+	},
 };
 
 #if defined (CONFIG_SERIAL_8250_AU1X00)
@@ -1075,6 +1082,15 @@ static void autoconfig_16550a(struct uart_8250_port *up)
 		DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
 	}
 	serial_outp(up, UART_IER, iersave);
+
+	/*
+	 * We distinguish between 16550A and U6 16550A by counting
+	 * how many bytes are in the FIFO.
+	 */
+	if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
+		up->port.type = PORT_U6_16550A;
+		up->capabilities |= UART_CAP_AFE;
+	}
 }
 
 /*
@@ -2229,9 +2245,9 @@ static unsigned int serial8250_get_divisor(struct uart_port *port, unsigned int
 	return quot;
 }
 
-static void
-serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
-		       struct ktermios *old)
+void
+serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
+		          struct ktermios *old)
 {
 	struct uart_8250_port *up = (struct uart_8250_port *)port;
 	unsigned char cval, fcr = 0;
@@ -2407,6 +2423,17 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
 	if (tty_termios_baud_rate(termios))
 		tty_termios_encode_baud_rate(termios, baud, baud);
 }
+EXPORT_SYMBOL(serial8250_do_set_termios);
+
+static void
+serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
+		       struct ktermios *old)
+{
+	if (port->set_termios)
+		port->set_termios(port, termios, old);
+	else
+		serial8250_do_set_termios(port, termios, old);
+}
 
 static void
 serial8250_set_ldisc(struct uart_port *port, int new)
@@ -2917,6 +2944,8 @@ 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->set_termios)
+		p->set_termios = port->set_termios;
 
 	return 0;
 }
@@ -2989,6 +3018,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.set_termios	= p->set_termios;
 		port.dev		= &dev->dev;
 		port.irqflags		|= irqflag;
 		ret = serial8250_register_port(&port);
@@ -3152,6 +3182,9 @@ 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;
+		/*  Possibly override set_termios call */
+		if (port->set_termios)
+			uart->port.set_termios = port->set_termios;
 
 		ret = uart_add_one_port(&serial8250_reg, &uart->port);
 		if (ret == 0)
diff --git a/include/linux/serial.h b/include/linux/serial.h
index c8613c3..06c99b6 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -77,7 +77,8 @@ struct serial_struct {
 #define PORT_16654	11
 #define PORT_16850	12
 #define PORT_RSA	13	/* RSA-DV II/S card */
-#define PORT_MAX	13
+#define PORT_U6_16550A	14
+#define PORT_MAX	14
 
 #define SERIAL_IO_PORT	0
 #define SERIAL_IO_HUB6	1
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index fb46aba..7638dea 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -32,6 +32,9 @@ struct plat_serial8250_port {
 	unsigned int	type;		/* If UPF_FIXED_TYPE */
 	unsigned int	(*serial_in)(struct uart_port *, int);
 	void		(*serial_out)(struct uart_port *, int, int);
+	void		(*set_termios)(struct uart_port *,
+			               struct ktermios *new,
+			               struct ktermios *old);
 };
 
 /*
@@ -71,5 +74,7 @@ extern int early_serial_setup(struct uart_port *port);
 extern int serial8250_find_port(struct uart_port *p);
 extern int serial8250_find_port_for_earlycon(void);
 extern int setup_early_serial8250_console(char *cmdline);
+extern void serial8250_do_set_termios(struct uart_port *port,
+		struct ktermios *termios, struct ktermios *old);
 
 #endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 18f2fe0..119354f 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -279,6 +279,9 @@ struct uart_port {
 	unsigned char __iomem	*membase;		/* read/write[bwl] */
 	unsigned int		(*serial_in)(struct uart_port *, int);
 	void			(*serial_out)(struct uart_port *, int, int);
+	void			(*set_termios)(struct uart_port *,
+				               struct ktermios *new,
+				               struct ktermios *old);
 	unsigned int		irq;			/* irq number */
 	unsigned long		irqflags;		/* irq flags  */
 	unsigned int		uartclk;		/* base uart clock */
-- 
1.7.1


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

* Re: [PATCH] U6715 16550A serial driver support
  2010-08-02  8:58 [PATCH] U6715 16550A serial driver support Philippe Langlais
@ 2010-08-04 19:52 ` Andrew Morton
  2010-08-05  7:14   ` Philippe Langlais
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2010-08-04 19:52 UTC (permalink / raw)
  To: Philippe Langlais
  Cc: linux-kernel, gregkh, alan, ludovic.barre, vincent.guittot

On Mon, 2 Aug 2010 10:58:39 +0200
Philippe Langlais <philippe.langlais@stericsson.com> wrote:

> UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone):
> * Fully compatible with industry standard 16C550 and 16C450 from various
> manufacturers
> * RX and TX 64 byte FIFO reduces CPU interrupts
> * Full double buffering
> * Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only)
> * Automatic baud rate selection
> * Manual or automatic RTS/CTS smart hardware flow control
> * Programmable serial characteristics:
> ___ Baud rate generation (50 to 3.25M baud)
> ___ 5, 6, 7 or 8-bit characters
> ___ Even, odd or no-parity bit generation and detection
> ___ 1, 1.5 or 2 stop bit generation
> * Independent control of transmit, receive, line status, data set interrupts and FIFOs
> * Full status-reporting capabilities
> * Separate DMA signaling for RX and TX
> * Timed interrupt to spread receive interrupt on known duration
> * DMA time-out interrupt to allow detection of end of reception
> * Carkit pulse coding and decoding compliant with USB carkit control interface [40]
> 
> In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port
> Add set_termios hook & export serial8250_do_set_termios to change uart
> clock following baudrate

Confused.

> ...
>
> --- a/include/linux/serial_8250.h
> +++ b/include/linux/serial_8250.h
> @@ -32,6 +32,9 @@ struct plat_serial8250_port {
>  	unsigned int	type;		/* If UPF_FIXED_TYPE */
>  	unsigned int	(*serial_in)(struct uart_port *, int);
>  	void		(*serial_out)(struct uart_port *, int, int);
> +	void		(*set_termios)(struct uart_port *,
> +			               struct ktermios *new,
> +			               struct ktermios *old);
>  };
>  
> ...
>
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -279,6 +279,9 @@ struct uart_port {
>  	unsigned char __iomem	*membase;		/* read/write[bwl] */
>  	unsigned int		(*serial_in)(struct uart_port *, int);
>  	void			(*serial_out)(struct uart_port *, int, int);
> +	void			(*set_termios)(struct uart_port *,
> +				               struct ktermios *new,
> +				               struct ktermios *old);
>  	unsigned int		irq;			/* irq number */
>  	unsigned long		irqflags;		/* irq flags  */
>  	unsigned int		uartclk;		/* base uart clock */

The patch adds these .set_termios hooks but doesn't actually use them
for anything.

The changelog doesn't tell us _why_ this was done (it should) and
lacking any code to look at it's all a bit mysterious.


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

* Re: [PATCH] U6715 16550A serial driver support
  2010-08-04 19:52 ` Andrew Morton
@ 2010-08-05  7:14   ` Philippe Langlais
  2010-08-05  7:22     ` Andrew Morton
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe Langlais @ 2010-08-05  7:14 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel@vger.kernel.org, gregkh@suse.de,
	alan@lxorguk.ukuu.org.uk, Ludovic BARRE, Vincent GUITTOT



On 08/04/10 21:52, Andrew Morton wrote:
> On Mon, 2 Aug 2010 10:58:39 +0200
> Philippe Langlais<philippe.langlais@stericsson.com>  wrote:
>
>    
>> UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone):
>> * Fully compatible with industry standard 16C550 and 16C450 from various
>> manufacturers
>> * RX and TX 64 byte FIFO reduces CPU interrupts
>> * Full double buffering
>> * Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only)
>> * Automatic baud rate selection
>> * Manual or automatic RTS/CTS smart hardware flow control
>> * Programmable serial characteristics:
>> ___ Baud rate generation (50 to 3.25M baud)
>> ___ 5, 6, 7 or 8-bit characters
>> ___ Even, odd or no-parity bit generation and detection
>> ___ 1, 1.5 or 2 stop bit generation
>> * Independent control of transmit, receive, line status, data set interrupts and FIFOs
>> * Full status-reporting capabilities
>> * Separate DMA signaling for RX and TX
>> * Timed interrupt to spread receive interrupt on known duration
>> * DMA time-out interrupt to allow detection of end of reception
>> * Carkit pulse coding and decoding compliant with USB carkit control interface [40]
>>
>> In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port
>> Add set_termios hook&  export serial8250_do_set_termios to change uart
>> clock following baudrate
>>      
> Confused.
>
>    
>> ...
>>
>> --- a/include/linux/serial_8250.h
>> +++ b/include/linux/serial_8250.h
>> @@ -32,6 +32,9 @@ struct plat_serial8250_port {
>>   	unsigned int	type;		/* If UPF_FIXED_TYPE */
>>   	unsigned int	(*serial_in)(struct uart_port *, int);
>>   	void		(*serial_out)(struct uart_port *, int, int);
>> +	void		(*set_termios)(struct uart_port *,
>> +			               struct ktermios *new,
>> +			               struct ktermios *old);
>>   };
>>
>> ...
>>
>> --- a/include/linux/serial_core.h
>> +++ b/include/linux/serial_core.h
>> @@ -279,6 +279,9 @@ struct uart_port {
>>   	unsigned char __iomem	*membase;		/* read/write[bwl] */
>>   	unsigned int		(*serial_in)(struct uart_port *, int);
>>   	void			(*serial_out)(struct uart_port *, int, int);
>> +	void			(*set_termios)(struct uart_port *,
>> +				               struct ktermios *new,
>> +				               struct ktermios *old);
>>   	unsigned int		irq;			/* irq number */
>>   	unsigned long		irqflags;		/* irq flags  */
>>   	unsigned int		uartclk;		/* base uart clock */
>>      
> The patch adds these .set_termios hooks but doesn't actually use them
> for anything.
>
> The changelog doesn't tell us _why_ this was done (it should) and
> lacking any code to look at it's all a bit mysterious.
>
>    
This feature is used in our U6715 8250 platform serial driver, to avoid
hack in 8250.c set_termios (Alan Cox requirement).
In this driver the input uart clock frequency depends on baud rate and
is computed in our set_termios override function.
The U6715 paltform serial patch has been submitted on linux-arm mailing 
list,
and is ready to enter Russell King Linux tree.

More things to do ?

Philippe

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

* Re: [PATCH] U6715 16550A serial driver support
  2010-08-05  7:14   ` Philippe Langlais
@ 2010-08-05  7:22     ` Andrew Morton
  2010-08-05  8:51       ` Philippe Langlais
  2010-08-05 23:04       ` Greg KH
  0 siblings, 2 replies; 11+ messages in thread
From: Andrew Morton @ 2010-08-05  7:22 UTC (permalink / raw)
  To: Philippe Langlais
  Cc: linux-kernel@vger.kernel.org, gregkh@suse.de,
	alan@lxorguk.ukuu.org.uk, Ludovic BARRE, Vincent GUITTOT

On Thu, 5 Aug 2010 09:14:40 +0200 Philippe Langlais <philippe.langlais@stericsson.com> wrote:

> 
> >>      
> > The patch adds these .set_termios hooks but doesn't actually use them
> > for anything.
> >
> > The changelog doesn't tell us _why_ this was done (it should) and
> > lacking any code to look at it's all a bit mysterious.
> >
> >    
> This feature is used in our U6715 8250 platform serial driver, to avoid
> hack in 8250.c set_termios (Alan Cox requirement).
> In this driver the input uart clock frequency depends on baud rate and
> is computed in our set_termios override function.
> The U6715 paltform serial patch has been submitted on linux-arm mailing 
> list,
> and is ready to enter Russell King Linux tree.

Oh.

> More things to do ?

Update the changelog to include this rather important information.

As the patches are dependent, treat them as a single series.  Russell
can merge them both with Greg's ack or Greg can merge them both with
Russell's ack.


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

* Re: [PATCH] U6715 16550A serial driver support
  2010-08-05  7:22     ` Andrew Morton
@ 2010-08-05  8:51       ` Philippe Langlais
  2010-08-05  9:00         ` Andrew Morton
  2010-08-05 23:04       ` Greg KH
  1 sibling, 1 reply; 11+ messages in thread
From: Philippe Langlais @ 2010-08-05  8:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel@vger.kernel.org, gregkh@suse.de,
	alan@lxorguk.ukuu.org.uk, Ludovic BARRE, Vincent GUITTOT,
	Russell King - ARM Linux



On 08/05/10 09:22, Andrew Morton wrote:
> On Thu, 5 Aug 2010 09:14:40 +0200 Philippe Langlais<philippe.langlais@stericsson.com>  wrote:
>
>    
>>      
>>>>
>>>>          
>>> The patch adds these .set_termios hooks but doesn't actually use them
>>> for anything.
>>>
>>> The changelog doesn't tell us _why_ this was done (it should) and
>>> lacking any code to look at it's all a bit mysterious.
>>>
>>>
>>>        
>> This feature is used in our U6715 8250 platform serial driver, to avoid
>> hack in 8250.c set_termios (Alan Cox requirement).
>> In this driver the input uart clock frequency depends on baud rate and
>> is computed in our set_termios override function.
>> The U6715 paltform serial patch has been submitted on linux-arm mailing
>> list,
>> and is ready to enter Russell King Linux tree.
>>      
> Oh.
>
>    
>> More things to do ?
>>      
> Update the changelog to include this rather important information.
>    
Ok is done
> As the patches are dependent, treat them as a single series.  Russell
> can merge them both with Greg's ack or Greg can merge them both with
> Russell's ack.
>
>    
This patch can be merged before U6715 platform one without problem.
Where I post the series in linux-kernel or linux-arm or both mailing lists ?
Greg has already taken this patch in its linux-next tree, need to resend 
to him the patch with new comments ?
All U6715 platform patches are already posted in linux-arm mailing list.
It's my first contribution and I don't know how to proceed.

Thanks
Philippe

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

* Re: [PATCH] U6715 16550A serial driver support
  2010-08-05  8:51       ` Philippe Langlais
@ 2010-08-05  9:00         ` Andrew Morton
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Morton @ 2010-08-05  9:00 UTC (permalink / raw)
  To: Philippe Langlais
  Cc: linux-kernel@vger.kernel.org, gregkh@suse.de,
	alan@lxorguk.ukuu.org.uk, Ludovic BARRE, Vincent GUITTOT,
	Russell King - ARM Linux

On Thu, 5 Aug 2010 10:51:31 +0200 Philippe Langlais <philippe.langlais@stericsson.com> wrote:

> >> More things to do ?
> >>      
> > Update the changelog to include this rather important information.
> >    
> Ok is done
> > As the patches are dependent, treat them as a single series.  Russell
> > can merge them both with Greg's ack or Greg can merge them both with
> > Russell's ack.
> >
> >    
> This patch can be merged before U6715 platform one without problem.
> Where I post the series in linux-kernel or linux-arm or both mailing lists ?

Both.

> Greg has already taken this patch in its linux-next tree, need to resend 
> to him the patch with new comments ?

Sure, Greg can probably update the changelog.

> All U6715 platform patches are already posted in linux-arm mailing list.
> It's my first contribution and I don't know how to proceed.

I'd suggest that Greg merge both patches.  The patch he has at present
doesn't do anything useful.

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

* Re: [PATCH] U6715 16550A serial driver support
  2010-08-05  7:22     ` Andrew Morton
  2010-08-05  8:51       ` Philippe Langlais
@ 2010-08-05 23:04       ` Greg KH
  1 sibling, 0 replies; 11+ messages in thread
From: Greg KH @ 2010-08-05 23:04 UTC (permalink / raw)
  To: Andrew Morton, Philippe Langlais
  Cc: linux-kernel@vger.kernel.org, alan@lxorguk.ukuu.org.uk,
	Ludovic BARRE, Vincent GUITTOT

On Thu, Aug 05, 2010 at 12:22:06AM -0700, Andrew Morton wrote:
> On Thu, 5 Aug 2010 09:14:40 +0200 Philippe Langlais <philippe.langlais@stericsson.com> wrote:
> 
> > 
> > >>      
> > > The patch adds these .set_termios hooks but doesn't actually use them
> > > for anything.
> > >
> > > The changelog doesn't tell us _why_ this was done (it should) and
> > > lacking any code to look at it's all a bit mysterious.
> > >
> > >    
> > This feature is used in our U6715 8250 platform serial driver, to avoid
> > hack in 8250.c set_termios (Alan Cox requirement).
> > In this driver the input uart clock frequency depends on baud rate and
> > is computed in our set_termios override function.
> > The U6715 paltform serial patch has been submitted on linux-arm mailing 
> > list,
> > and is ready to enter Russell King Linux tree.
> 
> Oh.
> 
> > More things to do ?
> 
> Update the changelog to include this rather important information.
> 
> As the patches are dependent, treat them as a single series.  Russell
> can merge them both with Greg's ack or Greg can merge them both with
> Russell's ack.

I've dropped the patch from my tree, so send it through Russell's, with
the proper changelog change and:
	Acked-by: Greg Kroah-Hartman <gregkh@suse.de>

thanks,

greg k-h

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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-02  8:58 [PATCH] U6715 16550A serial driver support Philippe Langlais
2010-08-04 19:52 ` Andrew Morton
2010-08-05  7:14   ` Philippe Langlais
2010-08-05  7:22     ` Andrew Morton
2010-08-05  8:51       ` Philippe Langlais
2010-08-05  9:00         ` Andrew Morton
2010-08-05 23:04       ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2010-07-29 15:13 Philippe Langlais
2010-07-29 15:31 ` Alan Cox
2010-07-29 13:32 New U6715 8250 serial patch Philippe Langlais
2010-07-29 13:32 ` [PATCH] U6715 16550A serial driver support Philippe Langlais
2010-07-29 13:53   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox