Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758162AbXENR7y (ORCPT ); Mon, 14 May 2007 13:59:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756784AbXENR7r (ORCPT ); Mon, 14 May 2007 13:59:47 -0400 Received: from nwk-ea-fw-1.sun.com ([192.18.42.249]:41358 "EHLO nwk-ea-fw-1.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756345AbXENR7r (ORCPT ); Mon, 14 May 2007 13:59:47 -0400 Date: Mon, 14 May 2007 10:57:36 -0700 From: Yinghai Lu Subject: [PATCH] serial: set RTS and DTR if flow is 'r' --- resend In-reply-to: <46489BC2.6040403@sun.com> To: Andrew Morton , rmk@arm.linux.org.uk, Andi Kleen , bjorn.helgaas@hp.com Cc: Randy Dunlap , Linux Kernel Mailing List Reply-to: Yinghai.Lu@Sun.COM Message-id: <4648A310.1050908@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=us-ascii Content-transfer-encoding: 7BIT References: <86802c440705122233y327756e7te534199f46b2059d@mail.gmail.com> <46489BC2.6040403@sun.com> User-Agent: Thunderbird 2.0.0.0 (X11/20070326) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1443 Lines: 42 [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 Cc: Russell King Cc: Andi Kleen Cc: Bjorn Helgaas 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/