Commit 3732b68f authored by Philippe De Muyter's avatar Philippe De Muyter Committed by Greg Ungerer

m68knommu: fix coldfire tcdrain

Fix tcdrain on coldfire uarts.
Currently with coldfire uarts tcdrain returns without waiting for txempty,
because (tx)fifosize is 0.  Fix that and call uart_update_timeout when
setting the baud rate, otherwise tcdrain will wait for an half our :)
Also constify mcf_uart_ops.
Signed-off-by: default avatarPhilippe De Muyter <phdm@macqel.be>
Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
parent 6ecaf44e
...@@ -212,5 +212,10 @@ struct mcf_platform_uart { ...@@ -212,5 +212,10 @@ struct mcf_platform_uart {
#define MCFUART_URF_RXS 0xc0 /* Receiver status */ #define MCFUART_URF_RXS 0xc0 /* Receiver status */
#endif #endif
#if defined(CONFIG_M5272)
#define MCFUART_TXFIFOSIZE 25
#else
#define MCFUART_TXFIFOSIZE 1
#endif
/****************************************************************************/ /****************************************************************************/
#endif /* mcfuart_h */ #endif /* mcfuart_h */
...@@ -263,6 +263,7 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -263,6 +263,7 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios,
} }
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
uart_update_timeout(port, termios->c_cflag, baud);
writeb(MCFUART_UCR_CMDRESETRX, port->membase + MCFUART_UCR); writeb(MCFUART_UCR_CMDRESETRX, port->membase + MCFUART_UCR);
writeb(MCFUART_UCR_CMDRESETTX, port->membase + MCFUART_UCR); writeb(MCFUART_UCR_CMDRESETTX, port->membase + MCFUART_UCR);
writeb(MCFUART_UCR_CMDRESETMRPTR, port->membase + MCFUART_UCR); writeb(MCFUART_UCR_CMDRESETMRPTR, port->membase + MCFUART_UCR);
...@@ -379,6 +380,7 @@ static irqreturn_t mcf_interrupt(int irq, void *data) ...@@ -379,6 +380,7 @@ static irqreturn_t mcf_interrupt(int irq, void *data)
static void mcf_config_port(struct uart_port *port, int flags) static void mcf_config_port(struct uart_port *port, int flags)
{ {
port->type = PORT_MCF; port->type = PORT_MCF;
port->fifosize = MCFUART_TXFIFOSIZE;
/* Clear mask, so no surprise interrupts. */ /* Clear mask, so no surprise interrupts. */
writeb(0, port->membase + MCFUART_UIMR); writeb(0, port->membase + MCFUART_UIMR);
...@@ -424,7 +426,7 @@ static int mcf_verify_port(struct uart_port *port, struct serial_struct *ser) ...@@ -424,7 +426,7 @@ static int mcf_verify_port(struct uart_port *port, struct serial_struct *ser)
/* /*
* Define the basic serial functions we support. * Define the basic serial functions we support.
*/ */
static struct uart_ops mcf_uart_ops = { static const struct uart_ops mcf_uart_ops = {
.tx_empty = mcf_tx_empty, .tx_empty = mcf_tx_empty,
.get_mctrl = mcf_get_mctrl, .get_mctrl = mcf_get_mctrl,
.set_mctrl = mcf_set_mctrl, .set_mctrl = mcf_set_mctrl,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment