From cd65a9496903590f57c3d78cebe4072094d9d791 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Wed, 10 Sep 2003 20:58:04 +0100 Subject: [PATCH] [SERIAL] Fix for NS16550A on a Super I/O on PPC On some PowerPC machines with a National Semiconductor Super I/O chip, we have a divisor other than 1.625 Hz. So when detecting a Super I/O, don't change baud_base again. --- drivers/serial/8250.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index c60101ffc3ca6..88deb3a2605bd 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -490,7 +490,9 @@ static void autoconfig_16550a(struct uart_8250_port *up) * Attempt to switch to bank 2, read the value of the LOOP bit * from EXCR1. Switch back to bank 0, change it in MCR. Then * switch back to bank 2, read it from EXCR1 again and check - * it's changed. If so, set baud_base in EXCR2 to 921600. + * it's changed. If so, set baud_base in EXCR2 to 921600. -- dwmw2 + * On PowerPC we don't want to change baud_base, as we have + * a number of different divisors. -- Tom Rini */ serial_outp(up, UART_LCR, 0); status1 = serial_in(up, UART_MCR); @@ -506,12 +508,14 @@ static void autoconfig_16550a(struct uart_8250_port *up) serial_outp(up, UART_MCR, status1); if ((status2 ^ status1) & UART_MCR_LOOP) { +#ifndef CONFIG_PPC serial_outp(up, UART_LCR, 0xE0); status1 = serial_in(up, 0x04); /* EXCR1 */ status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ serial_outp(up, 0x04, status1); serial_outp(up, UART_LCR, 0); +#endif up->port.type = PORT_NS16550A; up->port.uartclk = 921600*16; -- 2.53.0