--- zzzz-none-000/linux-3.10.107/drivers/tty/serial/8250/8250_core.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/drivers/tty/serial/8250/8250_core.c 2021-11-10 11:53:55.000000000 +0000 @@ -16,7 +16,17 @@ * membase is an 'ioremapped' cookie. */ -#if defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +/** + * Some part of this file is modified by Ikanos Communications. + * + * Copyright (C) 2013-2014 Ikanos Communications. + */ + +#if defined(CONFIG_FUSIV_VX185) && defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#define SUPPORT_SYSRQ +#endif + +#if defined(CONFIG_FUSIV_VX585) && defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ #endif @@ -45,7 +55,20 @@ #include #include +#if defined(CONFIG_FUSIV_VX185) +#include +#endif +#if defined(CONFIG_FUSIV_VX585) +#include +#endif + +#if defined(CONFIG_FUSIV_VX185) && defined (CONFIG_CPU_MIPSR2_IRQ_VI) +fusiv_irq_params_t serial_fusiv_irq; +#endif + + #include "8250.h" +#warning MIPS_UR8_HACK aus 2.6.32 bisher nicht übernommen /* * Configuration: @@ -323,6 +346,13 @@ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, .flags = UART_CAP_FIFO | UART_CAP_AFE, }, + [PORT_UR8] = { + .name = "UR8", + .fifo_size = 16, + .tx_loadsz = 16, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, + .flags = UART_CAP_FIFO, + }, }; /* Uart divisor latch read */ @@ -410,6 +440,18 @@ writeb(value, p->membase + offset); } +static void mem16_serial_out(struct uart_port *p, int offset, int value) +{ + offset = offset << p->regshift; + writew(value, p->membase + offset); +} + +static unsigned int mem16_serial_in(struct uart_port *p, int offset) +{ + offset = offset << p->regshift; + return readw(p->membase + offset); +} + static void mem32_serial_out(struct uart_port *p, int offset, int value) { offset = offset << p->regshift; @@ -456,6 +498,11 @@ p->serial_out = mem_serial_out; break; + case UPIO_MEM16: + p->serial_in = mem16_serial_in; + p->serial_out = mem16_serial_out; + break; + case UPIO_MEM32: p->serial_in = mem32_serial_in; p->serial_out = mem32_serial_out; @@ -485,6 +532,7 @@ { switch (p->iotype) { case UPIO_MEM: + case UPIO_MEM16: case UPIO_MEM32: case UPIO_AU: p->serial_out(p, offset, value); @@ -1173,6 +1221,10 @@ } #endif +#if defined(CONFIG_AR9100) || defined(CONFIG_SOC_AR724X) || defined(CONFIG_SOC_AR934X) + up->bugs |= UART_BUG_NOMSR; +#endif + serial_out(up, UART_LCR, save_lcr); port->fifosize = uart_config[up->port.type].fifo_size; @@ -1570,7 +1622,11 @@ */ static irqreturn_t serial8250_interrupt(int irq, void *dev_id) { +#if defined(CONFIG_FUSIV_VX185) && defined(CONFIG_CPU_MIPSR2_IRQ_VI) + struct irq_info *i = (struct irq_info *) (((fusiv_irq_params_t *) dev_id)->priv); +#else struct irq_info *i = dev_id; +#endif struct list_head *l, *end = NULL; int pass_counter = 0, handled = 0; @@ -1677,8 +1733,20 @@ i->head = &up->list; spin_unlock_irq(&i->lock); irq_flags |= up->port.irqflags; +#if defined (CONFIG_FUSIV_VX185) && defined (CONFIG_CPU_MIPSR2_IRQ_VI) + serial_fusiv_irq.ipc_src = UART1_INT; + serial_fusiv_irq.priv = (void *) i; + ret = request_irq(up->port.irq, serial8250_interrupt, + irq_flags, "serial", &serial_fusiv_irq); +#else ret = request_irq(up->port.irq, serial8250_interrupt, irq_flags, "serial", i); +#endif +#if defined(CONFIG_FUSIV_VX585) + if(!ret) { + irq_set_affinity(up->port.irq,cpumask_of(UART0_CPU_NUM)); + } +#endif if (ret < 0) serial_do_unlink(i, up); } @@ -2183,7 +2251,16 @@ outb_p(0x80, icp); inb_p(icp); } - +#if !defined(CONFIG_MACH_FUSIV) + { + volatile unsigned int *my_fcr = (unsigned int *)0xA8610E08; + volatile unsigned int *my_ier = (unsigned int *)0xA8610E04; + WARN_ONCE(1, "[%s] Verwende festkodierte Adressen zur FIFO-Adressierung!\n", __func__); + *my_fcr = 0x1; + *my_ier = 0x5; + printk("[%s] FIFO eingeschaltet\n", __FUNCTION__); + } +#endif return 0; } @@ -2193,6 +2270,9 @@ container_of(port, struct uart_8250_port, port); unsigned long flags; + WARN(1, "[%s] Ignoriere ordentliche 'shutdown'-Sequenz!\n", __func__); + return; + /* * Disable interrupts from this port */ @@ -2263,6 +2343,9 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, struct ktermios *old) { + pr_err("[%s] Called\n", __func__); +// AVM/TKL: MERGE +#if !defined(CONFIG_FUSIV_VX185) //defined(CONFIG_FUSIV_VX585) struct uart_8250_port *up = container_of(port, struct uart_8250_port, port); unsigned char cval, fcr = 0; @@ -2303,11 +2386,22 @@ /* * Ask the core to calculate the divisor for us. */ +// AVM/TKL: MERGE Ikanos used these original settings only for VX185 +#if !defined(CONFIG_FUSIV_VX585) baud = uart_get_baud_rate(port, termios, old, port->uartclk / 16 / 0xffff, port->uartclk / 16); +#else + baud = 115200 ; /* hardcoded baud rate to 115200 for CatShark Silicon - SI_BRINGUP */ +#endif quot = serial8250_get_divisor(port, baud); +#if defined CONFIG_FUSIV_VX585_PALLADIUM + /*Are these required for palladium ? CRS */ + baud = 1437000/16; + quot=1; +#endif /* CONFIG_FUSIV_VX185 */ + /* * Oxford Semi 952 rev B workaround */ @@ -2446,6 +2540,7 @@ /* Don't rewrite B0 */ if (tty_termios_baud_rate(termios)) tty_termios_encode_baud_rate(termios, baud, baud); +#endif } EXPORT_SYMBOL(serial8250_do_set_termios); @@ -2513,6 +2608,7 @@ case UPIO_AU: case UPIO_TSI: case UPIO_MEM32: + case UPIO_MEM16: case UPIO_MEM: if (!port->mapbase) break; @@ -2549,6 +2645,7 @@ case UPIO_AU: case UPIO_TSI: case UPIO_MEM32: + case UPIO_MEM16: case UPIO_MEM: if (!port->mapbase) break; @@ -2904,11 +3001,32 @@ static int __init serial8250_console_setup(struct console *co, char *options) { struct uart_port *port; +// AVM/TKL: MERGE +#if !defined(CONFIG_FUSIV_VX585) //defined CONFIG_FUSIV_VX185 int baud = 9600; +#endif /* CONFIG_FUSIV_VX185 */ + +#if defined CONFIG_FUSIV_VX585 +#if defined CONFIG_FUSIV_VX585_PALLADIUM + int baud = 813000/16; +#else + int baud = 115200 ; /* Baud rate change for CatShark Silicon - SI_BRINGUP */ +#endif /* CONFIG_FUSIV_VX585_PALLADIUM */ +#endif /* CONFIG_FUSIV_VX585 */ + int bits = 8; int parity = 'n'; int flow = 'n'; +// AVM/TKL: MERGE +#if defined CONFIG_FUSIV_VX185 +#if defined (CONFIG_MACH_FUSIV) + return 0; /* We stop console port initialization to resolve Bug# 24551 & 24334 */ +#endif +#endif /* CONFIG_FUSIV_VX185 */ + + + /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have