--- zzzz-none-000/linux-2.4.17/arch/mips/au1000/common/serial.c 2001-10-05 19:06:51.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/arch/mips/au1000/common/serial.c 2004-11-24 13:22:38.000000000 +0000 @@ -131,7 +131,7 @@ static struct timer_list serial_timer; -extern unsigned long get_au1000_uart_baud(void); +extern unsigned long get_au1000_uart_baud_base(void); /* serial subtype definitions */ #ifndef SERIAL_TYPE_NORMAL @@ -241,12 +241,12 @@ static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset) { - return (inl(info->port+offset) & 0xff); + return (inl(info->port+offset) & 0xffff); } static _INLINE_ void serial_out(struct async_struct *info, int offset, int value) { - outl(value & 0xff, info->port+offset); + outl(value & 0xffff, info->port+offset); } @@ -752,6 +752,7 @@ if (inl(UART_MOD_CNTRL + state->port) != 0x3) { outl(3, UART_MOD_CNTRL + state->port); + au_sync_delay(10); } #ifdef SERIAL_DEBUG_OPEN printk("starting up ttys%d (irq %d)...", info->line, state->irq); @@ -986,6 +987,10 @@ set_bit(TTY_IO_ERROR, &info->tty->flags); info->flags &= ~ASYNC_INITIALIZED; +#ifndef CONFIG_REMOTE_DEBUG + outl(0, UART_MOD_CNTRL + state->port); + au_sync_delay(10); +#endif restore_flags(flags); } @@ -1037,7 +1042,8 @@ if (!baud) { baud = 9600; /* B0 transition handled in rs_set_termios */ } - baud_base = info->state->baud_base; + baud_base = get_au1000_uart_baud_base(); + //if (baud == 38400 && if (((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) { quot = info->state->custom_divisor; @@ -2511,6 +2517,7 @@ if (inl(UART_MOD_CNTRL + state->port) != 0x3) { outl(3, UART_MOD_CNTRL + state->port); + au_sync_delay(10); } state->type = PORT_16550; @@ -2541,7 +2548,11 @@ serial_outp(info, UART_FCR, 0); (void)serial_in(info, UART_RX); serial_outp(info, UART_IER, 0); - + +#ifndef CONFIG_REMOTE_DEBUG + outl(0, UART_MOD_CNTRL + state->port); + au_sync_delay(10); +#endif restore_flags(flags); } @@ -2643,12 +2654,12 @@ callout_driver.proc_entry = 0; if (tty_register_driver(&serial_driver)) - panic("Couldn't register serial driver\n"); + panic("Couldn't register serial driver"); if (tty_register_driver(&callout_driver)) - panic("Couldn't register callout driver\n"); + panic("Couldn't register callout driver"); for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { - state->baud_base = get_au1000_uart_baud(); + state->baud_base = get_au1000_uart_baud_base(); state->magic = SSTATE_MAGIC; state->line = i; state->type = PORT_UNKNOWN; @@ -3044,7 +3055,7 @@ info->io_type = state->io_type; info->iomem_base = state->iomem_base; info->iomem_reg_shift = state->iomem_reg_shift; - state->baud_base = get_au1000_uart_baud(); + state->baud_base = get_au1000_uart_baud_base(); quot = state->baud_base / baud; cval = cflag & (CSIZE | CSTOPB);