When we detect that a 16550 was in fact part of a NatSemi SuperIO chip with high-speed mode enabled, we switch it to high-speed mode so that baud_base becomes 921600. However, we also need to multiply the baud divisor by 8 at the same time, in case it's already in use as a console.

Signed-off-by: David Woodhouse
Acked-by: Tom Rini
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by David Woodhouse and committed by Russell King 857dde2e 9636273d

+13 -6
+13 -6
drivers/serial/8250.c
··· 682 682 * from EXCR1. Switch back to bank 0, change it in MCR. Then 683 683 * switch back to bank 2, read it from EXCR1 again and check 684 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 686 serial_outp(up, UART_LCR, 0); 689 687 status1 = serial_in(up, UART_MCR); ··· 697 699 serial_outp(up, UART_MCR, status1); 698 700 699 701 if ((status2 ^ status1) & UART_MCR_LOOP) { 700 - #ifndef CONFIG_PPC 702 + unsigned short quot; 703 + 701 704 serial_outp(up, UART_LCR, 0xE0); 705 + 706 + quot = serial_inp(up, UART_DLM) << 8; 707 + quot += serial_inp(up, UART_DLL); 708 + quot <<= 3; 709 + 702 710 status1 = serial_in(up, 0x04); /* EXCR1 */ 703 711 status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ 704 712 status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ 705 713 serial_outp(up, 0x04, status1); 706 - serial_outp(up, UART_LCR, 0); 707 - up->port.uartclk = 921600*16; 708 - #endif 714 + 715 + serial_outp(up, UART_DLL, quot & 0xff); 716 + serial_outp(up, UART_DLM, quot >> 8); 709 717 718 + serial_outp(up, UART_LCR, 0); 719 + 720 + up->port.uartclk = 921600*16; 710 721 up->port.type = PORT_NS16550A; 711 722 up->capabilities |= UART_NATSEMI; 712 723 return;