aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/8250.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r--drivers/serial/8250.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 0d9358608fdf..30e8beb71430 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -682,8 +682,6 @@ static void autoconfig_16550a(struct uart_8250_port *up)
682 * from EXCR1. Switch back to bank 0, change it in MCR. Then 682 * from EXCR1. Switch back to bank 0, change it in MCR. Then
683 * switch back to bank 2, read it from EXCR1 again and check 683 * switch back to bank 2, read it from EXCR1 again and check
684 * it's changed. If so, set baud_base in EXCR2 to 921600. -- dwmw2 684 * it's changed. If so, set baud_base in EXCR2 to 921600. -- dwmw2
685 * On PowerPC we don't want to change baud_base, as we have
686 * a number of different divisors. -- Tom Rini
687 */ 685 */
688 serial_outp(up, UART_LCR, 0); 686 serial_outp(up, UART_LCR, 0);
689 status1 = serial_in(up, UART_MCR); 687 status1 = serial_in(up, UART_MCR);
@@ -699,16 +697,25 @@ static void autoconfig_16550a(struct uart_8250_port *up)
699 serial_outp(up, UART_MCR, status1); 697 serial_outp(up, UART_MCR, status1);
700 698
701 if ((status2 ^ status1) & UART_MCR_LOOP) { 699 if ((status2 ^ status1) & UART_MCR_LOOP) {
702#ifndef CONFIG_PPC 700 unsigned short quot;
701
703 serial_outp(up, UART_LCR, 0xE0); 702 serial_outp(up, UART_LCR, 0xE0);
703
704 quot = serial_inp(up, UART_DLM) << 8;
705 quot += serial_inp(up, UART_DLL);
706 quot <<= 3;
707
704 status1 = serial_in(up, 0x04); /* EXCR1 */ 708 status1 = serial_in(up, 0x04); /* EXCR1 */
705 status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ 709 status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
706 status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ 710 status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
707 serial_outp(up, 0x04, status1); 711 serial_outp(up, 0x04, status1);
712
713 serial_outp(up, UART_DLL, quot & 0xff);
714 serial_outp(up, UART_DLM, quot >> 8);
715
708 serial_outp(up, UART_LCR, 0); 716 serial_outp(up, UART_LCR, 0);
709 up->port.uartclk = 921600*16;
710#endif
711 717
718 up->port.uartclk = 921600*16;
712 up->port.type = PORT_NS16550A; 719 up->port.type = PORT_NS16550A;
713 up->capabilities |= UART_NATSEMI; 720 up->capabilities |= UART_NATSEMI;
714 return; 721 return;
@@ -1122,18 +1129,9 @@ receive_chars(struct uart_8250_port *up, int *status, struct pt_regs *regs)
1122 } 1129 }
1123 if (uart_handle_sysrq_char(&up->port, ch, regs)) 1130 if (uart_handle_sysrq_char(&up->port, ch, regs))
1124 goto ignore_char; 1131 goto ignore_char;
1125 if ((lsr & up->port.ignore_status_mask) == 0) { 1132
1126 tty_insert_flip_char(tty, ch, flag); 1133 uart_insert_char(&up->port, lsr, UART_LSR_OE, ch, flag);
1127 } 1134
1128 if ((lsr & UART_LSR_OE) &&
1129 tty->flip.count < TTY_FLIPBUF_SIZE) {
1130 /*
1131 * Overrun is special, since it's reported
1132 * immediately, and doesn't affect the current
1133 * character.
1134 */
1135 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
1136 }
1137 ignore_char: 1135 ignore_char:
1138 lsr = serial_inp(up, UART_LSR); 1136 lsr = serial_inp(up, UART_LSR);
1139 } while ((lsr & UART_LSR_DR) && (max_count-- > 0)); 1137 } while ((lsr & UART_LSR_DR) && (max_count-- > 0));