--- 8250.c_2.6.11-org 2005-03-02 08:37:47.000000000 +0100 +++ 8250.c 2005-03-05 02:32:50.000000000 +0100 @@ -56,11 +56,11 @@ /* * Debugging. */ -#if 0 +//#if 0 #define DEBUG_AUTOCONF(fmt...) printk(fmt) -#else -#define DEBUG_AUTOCONF(fmt...) do { } while (0) -#endif +//#else +//#define DEBUG_AUTOCONF(fmt...) do { } while (0) +//#endif #if 0 #define DEBUG_INTR(fmt...) printk(fmt) @@ -346,7 +346,7 @@ static inline void serial8250_clear_fifos(struct uart_8250_port *p) { if (p->capabilities & UART_CAP_FIFO) { - serial_outp(p, UART_FCR, UART_FCR_ENABLE_FIFO); +//alskdfj serial_outp(p, UART_FCR, UART_FCR_ENABLE_FIFO); serial_outp(p, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); serial_outp(p, UART_FCR, 0); @@ -1636,9 +1636,25 @@ /* * Ask the core to calculate the divisor for us. */ - baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk /* /16 */); quot = serial8250_get_divisor(port, baud); + printk(KERN_INFO "***** Serial: baud=%d quot=%d\n", baud, quot); + if (up->port.type == PORT_16C950) { + unsigned int baud_base = port->uartclk/16; + if (baud <= baud_base) + serial_icr_write(up, UART_TCR, 0); + else if (baud <= 2*baud_base) { + serial_icr_write(up, UART_TCR, 0x8); + baud_base = baud_base * 2; + } else if (baud <= 4*baud_base) { + serial_icr_write(up, UART_TCR, 0x4); + baud_base = baud_base * 4; + } else + serial_icr_write(up, UART_TCR, 0); + printk(KERN_INFO "***** Serial: baud_base=%d\n", baud_base); + } + /* * Work around a bug in the Oxford Semiconductor 952 rev B * chip which causes it to seriously miscalculate baud rates