[SERIAL] don't disable xscale serial ports after autoconfig
authorLennert Buytenhek <buytenh@wantstofly.org>
Sat, 12 Nov 2005 21:58:05 +0000 (21:58 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 12 Nov 2005 21:58:05 +0000 (21:58 +0000)
xscale-type UARTs have an extra bit (UUE) in the IER register that has
to be written as 1 to enable the UART.  At the end of autoconfig() in
drivers/serial/8250.c, the IER register is unconditionally written as
zero, which turns off the UART, and makes any subsequent printch() hang
the box.

Since other 8250-type UARTs don't have this enable bit and are thus
always 'enabled' in this sense, it can't hurt to enable xscale-type
serial ports all the time as well.  The attached patch changes the
autoconfig() exit path to see if the port has an UUE enable bit, and if
yes, to write UUE=1 instead of just putting a zero into IER, using the
same test as is used at the beginning of serial8250_console_write().

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/serial/8250.c

index 3742753..e08510d 100644 (file)
@@ -999,7 +999,10 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
        serial_outp(up, UART_MCR, save_mcr);
        serial8250_clear_fifos(up);
        (void)serial_in(up, UART_RX);
-       serial_outp(up, UART_IER, 0);
+       if (up->capabilities & UART_CAP_UUE)
+               serial_outp(up, UART_IER, UART_IER_UUE);
+       else
+               serial_outp(up, UART_IER, 0);
 
  out:  
        spin_unlock_irqrestore(&up->port.lock, flags);