--- zzzz-none-000/linux-3.10.107/drivers/tty/serial/serial_core.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/drivers/tty/serial/serial_core.c 2021-11-10 11:53:55.000000000 +0000 @@ -496,6 +496,25 @@ uart_start(tty); } +#if defined(CONFIG_AVM_ENHANCED) +static unsigned int enable_avm_console; +static int uart_avm_console(struct tty_struct *tty) { + + struct uart_state *state = tty->driver_data; + struct uart_port *port = state->uart_port; + + if (port->cons) { + if (port->cons->flags & (CON_ENABLED | CON_CONSDEV)) { + if (enable_avm_console) + return 0; + else + return 1; + } + } + return 0; +} +#endif + static int uart_write(struct tty_struct *tty, const unsigned char *buf, int count) { @@ -1390,7 +1409,9 @@ struct uart_port *port = state->uart_port; unsigned long char_time, expire; - if (port->type == PORT_UNKNOWN || port->fifosize == 0) + // AVM/TKL: Ikanos disabled timeout update for VX185. Workaround, + // should be fixed in 8250_core + if (port->type == PORT_UNKNOWN || port->timeout < HZ/50 || port->fifosize == 0) return; /* @@ -2093,6 +2114,7 @@ "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); break; case UPIO_MEM: + case UPIO_MEM16: case UPIO_MEM32: case UPIO_AU: case UPIO_TSI: @@ -2275,6 +2297,9 @@ .poll_get_char = uart_poll_get_char, .poll_put_char = uart_poll_put_char, #endif +#if defined(CONFIG_AVM_ENHANCED) + .is_avm_console = uart_avm_console, +#endif }; static const struct tty_port_operations uart_port_ops = { @@ -2714,6 +2739,7 @@ return (port1->iobase == port2->iobase) && (port1->hub6 == port2->hub6); case UPIO_MEM: + case UPIO_MEM16: case UPIO_MEM32: case UPIO_AU: case UPIO_TSI: @@ -2797,6 +2823,14 @@ { struct tty_port *tport = &port->state->port; +#if defined(CONFIG_AVM_ENHANCED) + if (port->cons->flags & (CON_ENABLED | CON_CONSDEV)) { + if (ch == 0xD) { + enable_avm_console = 1; + } + } +#endif + if ((status & port->ignore_status_mask & ~overrun) == 0) if (tty_insert_flip_char(tport, ch, flag) == 0) ++port->icount.buf_overrun;