lkml.org 
[lkml]   [2007]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] serial: set RTS and DTR if flow is 'r' --- resend
[PATCH] serial: set RTS and DTR if flow is 'r'

if the serial console flow is set to 'r', We need to set RTS and DTR.
Some UARTs on other side need these bit set, otherwise will not send
char to or
receive char from the host that kernel is runing esp for kernel boot stage.

BTW:
earlyprintk and early_uart are hard coded to set DTR/RTS.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Andi Kleen <ak@suse.de>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 48e259a..4e6f8be 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2154,6 +2154,15 @@ serial8250_set_termios(struct uart_port *port,
struct ktermios *termios,
}
serial_outp(up, UART_FCR, fcr); /* set fcr */
}
+
+ /* if serial console flow is 'r', we need to set RTS and DTR to MCR.
+ * some uarts on other side don't support no flow control. So we state
+ * console=ttyS0,9600n8r in kernel command line to make those uart can
+ * work.
+ */
+ if (termios->c_cflag & CRTSCTS)
+ up->port.mctrl |= TIOCM_RTS | TIOCM_DTR;
+
serial8250_set_mctrl(&up->port, up->port.mctrl);
spin_unlock_irqrestore(&up->port.lock, flags);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-14 20:03    [W:1.211 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site