/* * Attempts to turn on the RSA FIFO. Returns zero on failure. * We set the port uart clock rate if we succeed.
*/ staticint __rsa_enable(struct uart_8250_port *up)
{ unsignedchar mode; int result;
mode = serial_in(up, UART_RSA_MSR);
result = mode & UART_RSA_MSR_FIFO;
if (!result) {
serial_out(up, UART_RSA_MSR, mode | UART_RSA_MSR_FIFO);
mode = serial_in(up, UART_RSA_MSR);
result = mode & UART_RSA_MSR_FIFO;
}
if (result)
up->port.uartclk = SERIAL_RSA_BAUD_BASE * 16;
return result;
}
/* * If this is an RSA port, see if we can kick it up to the higher speed clock.
*/ void rsa_enable(struct uart_8250_port *up)
{ if (up->port.type != PORT_RSA) return;
/* * Attempts to turn off the RSA FIFO and resets the RSA board back to 115kbps compat mode. It is * unknown why interrupts were disabled in here. However, the caller is expected to preserve this * behaviour by grabbing the spinlock before calling this function.
*/ void rsa_disable(struct uart_8250_port *up)
{ unsignedchar mode; int result;
if (up->port.type != PORT_RSA) return;
if (up->port.uartclk != SERIAL_RSA_BAUD_BASE * 16) return;
uart_port_lock_irq(&up->port);
mode = serial_in(up, UART_RSA_MSR);
result = !(mode & UART_RSA_MSR_FIFO);
if (!result) {
serial_out(up, UART_RSA_MSR, mode & ~UART_RSA_MSR_FIFO);
mode = serial_in(up, UART_RSA_MSR);
result = !(mode & UART_RSA_MSR_FIFO);
}
void rsa_autoconfig(struct uart_8250_port *up)
{ /* Only probe for RSA ports if we got the region. */ if (up->port.type != PORT_16550A) return; if (!(up->probe & UART_PROBE_RSA)) return;
if (__rsa_enable(up))
up->port.type = PORT_RSA;
}
EXPORT_SYMBOL_FOR_MODULES(rsa_autoconfig, "8250_base");
void rsa_reset(struct uart_8250_port *up)
{ if (up->port.type != PORT_RSA) return;
#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS #ifndef MODULE /* * Keep the old "8250" name working as well for the module options so we don't * break people. We need to keep the names identical and the convenient macros * will happily refuse to let us do that by failing the build with redefinition * errors of global variables. So we stick them inside a dummy function to * avoid those conflicts. The options still get parsed, and the redefined * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. * * This is hacky. I'm sorry.
*/ staticvoid __used rsa8250_options(void)
{ #undef MODULE_PARAM_PREFIX #define MODULE_PARAM_PREFIX "8250_core."
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.