The check for the TRDY flag after writing the character is not needed.
Also do a cpu_relax() inside the loop.
Pass a struct uart_port to altera_uart_console_putc, so we do not need
to get it (and dereference pointers) for every character.
Cc: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Don't take the port spinlock in uart functions where the serial core
already takes care of locking/unlocking them.
The code would actually lock up on architectures where spinlocks are
implemented (not the case on nios2 where this driver is primarily used
for now, thus this bug didn't trigger).
Also protect calling altera_uart_rx_chars/altera_uart_tx_chars in the
interrupt handler by the port spinlock.
Thanks to Ian Abbott for pointing these issues out.
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Add an UART driver for the UART component available as a SOPC (System on
Programmable Chip) component for Altera FPGAs.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>