aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-04 12:12:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-04 12:14:42 -0400
commit8e50254a6ab2abb6ae08699adffe3d89e4c75912 (patch)
tree23216a6463fe9eef287ea050486001df1793f49c
parent062a68a5e0aaa9577d75391ffafa11e3c2a5f892 (diff)
Revert "uart: pl011: Improve LCRH register access decision"
This reverts commit 09dcc7dfc05b31bf0bbcd1511cd1a2644908d5c8 as with this patch the serial console is broken on lots of platforms. Reported-by: Marc Zyngier <marc.zyngier@arm.com> Cc: Jun Nie <jun.nie@linaro.org> Acked-by: Will Deacon <will.deacon@arm.com> Tested-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/amba-pl011.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 017443d092c1..e1f3bd5afad6 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -249,11 +249,6 @@ struct uart_amba_port {
249#endif 249#endif
250}; 250};
251 251
252static bool is_implemented(struct uart_amba_port *uap, unsigned int reg)
253{
254 return uap->reg_lut[reg] != (u16)~0;
255}
256
257static unsigned int pl011_readw(struct uart_amba_port *uap, int index) 252static unsigned int pl011_readw(struct uart_amba_port *uap, int index)
258{ 253{
259 WARN_ON(index > REG_NR); 254 WARN_ON(index > REG_NR);
@@ -1654,7 +1649,7 @@ static int pl011_hwinit(struct uart_port *port)
1654static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h) 1649static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h)
1655{ 1650{
1656 pl011_writew(uap, lcr_h, uap->lcrh_rx); 1651 pl011_writew(uap, lcr_h, uap->lcrh_rx);
1657 if (is_implemented(uap, REG_ST_LCRH_RX)) { 1652 if (uap->lcrh_rx != uap->lcrh_tx) {
1658 int i; 1653 int i;
1659 /* 1654 /*
1660 * Wait 10 PCLKs before writing LCRH_TX register, 1655 * Wait 10 PCLKs before writing LCRH_TX register,
@@ -1789,7 +1784,7 @@ static void pl011_disable_uart(struct uart_amba_port *uap)
1789 * disable break condition and fifos 1784 * disable break condition and fifos
1790 */ 1785 */
1791 pl011_shutdown_channel(uap, uap->lcrh_rx); 1786 pl011_shutdown_channel(uap, uap->lcrh_rx);
1792 if (is_implemented(uap, REG_ST_LCRH_RX)) 1787 if (uap->lcrh_rx != uap->lcrh_tx)
1793 pl011_shutdown_channel(uap, uap->lcrh_tx); 1788 pl011_shutdown_channel(uap, uap->lcrh_tx);
1794} 1789}
1795 1790