diff mbox

[v2,4/7] serial: sh-sci: increase RX FIFO trigger defaults for (H)SCIF

Message ID 1485187458-8195-5-git-send-email-ulrich.hecht+renesas@gmail.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Ulrich Hecht Jan. 23, 2017, 4:04 p.m. UTC
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 drivers/tty/serial/sh-sci.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven Jan. 24, 2017, 8 a.m. UTC | #1
On Mon, Jan 23, 2017 at 5:04 PM, Ulrich Hecht
<ulrich.hecht+renesas@gmail.com> wrote:
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> @@ -2736,15 +2742,19 @@ static int sci_init_single(struct platform_device *dev,
>                 sci_port->sampling_rate_mask = SCI_SR_SCIFAB;
>                 break;
>         case PORT_SCIF:
> -               port->fifosize = 16;
>                 if (p->regtype == SCIx_SH7705_SCIF_REGTYPE) {
> +                       port->fifosize = 64;

Note that you forgot to mention that you also corrected the FIFO size for
sh7705, ssh7720, and sh7721. Not that we can easily test that, though.

>                         sci_port->overrun_reg = SCxSR;
>                         sci_port->overrun_mask = SCIFA_ORER;
>                         sci_port->sampling_rate_mask = SCI_SR(16);
> +                       /* RX triggering not implemented for this IP */
> +                       sci_port->rx_trigger = 1;
>                 } else {
> +                       port->fifosize = 16;
>                         sci_port->overrun_reg = SCLSR;
>                         sci_port->overrun_mask = SCLSR_ORER;
>                         sci_port->sampling_rate_mask = SCI_SR(32);
> +                       sci_port->rx_trigger = 8;
>                 }
>                 break;
>         default:
Greg KH Jan. 25, 2017, 10:06 a.m. UTC | #2
On Mon, Jan 23, 2017 at 05:04:15PM +0100, Ulrich Hecht wrote:
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> ---
>  drivers/tty/serial/sh-sci.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)

I will not take a patch without any changelog text, sorry...
diff mbox

Patch

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 39734cc..c7e2d0d 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -141,6 +141,7 @@  struct sci_port {
 	struct timer_list		rx_timer;
 	unsigned int			rx_timeout;
 #endif
+	int				rx_trigger;
 
 	bool autorts;
 };
@@ -2197,6 +2198,7 @@  static void sci_reset(struct uart_port *port)
 {
 	const struct plat_sci_reg *reg;
 	unsigned int status;
+	struct sci_port *s = to_sci_port(port);
 
 	if (serial_port_in(port, SCSCR) & SCSCR_TE) {
 		do {
@@ -2218,6 +2220,9 @@  static void sci_reset(struct uart_port *port)
 		status &= ~(SCLSR_TO | SCLSR_ORER);
 		serial_port_out(port, SCLSR, status);
 	}
+
+	if (s->rx_trigger > 1)
+		scif_set_rtrg(port, s->rx_trigger);
 }
 
 static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
@@ -2728,6 +2733,7 @@  static int sci_init_single(struct platform_device *dev,
 		sci_port->overrun_reg = SCLSR;
 		sci_port->overrun_mask = SCLSR_ORER;
 		sci_port->sampling_rate_mask = SCI_SR_RANGE(8, 32);
+		sci_port->rx_trigger = 64;
 		break;
 	case PORT_SCIFA:
 		port->fifosize = 64;
@@ -2736,15 +2742,19 @@  static int sci_init_single(struct platform_device *dev,
 		sci_port->sampling_rate_mask = SCI_SR_SCIFAB;
 		break;
 	case PORT_SCIF:
-		port->fifosize = 16;
 		if (p->regtype == SCIx_SH7705_SCIF_REGTYPE) {
+			port->fifosize = 64;
 			sci_port->overrun_reg = SCxSR;
 			sci_port->overrun_mask = SCIFA_ORER;
 			sci_port->sampling_rate_mask = SCI_SR(16);
+			/* RX triggering not implemented for this IP */
+			sci_port->rx_trigger = 1;
 		} else {
+			port->fifosize = 16;
 			sci_port->overrun_reg = SCLSR;
 			sci_port->overrun_mask = SCLSR_ORER;
 			sci_port->sampling_rate_mask = SCI_SR(32);
+			sci_port->rx_trigger = 8;
 		}
 		break;
 	default:
@@ -2752,6 +2762,7 @@  static int sci_init_single(struct platform_device *dev,
 		sci_port->overrun_reg = SCxSR;
 		sci_port->overrun_mask = SCI_ORER;
 		sci_port->sampling_rate_mask = SCI_SR(32);
+		sci_port->rx_trigger = 1;
 		break;
 	}