aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx6/patches-4.4/113-serial-imx-make-sure-unhandled-irqs-are-disabled.patch
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2017-01-13 11:42:08 +0100
committerJohn Crispin <john@phrozen.org>2017-01-15 17:41:14 +0100
commit26e4fee6e28d5f5d50a5ce74aa044fa5b3a9db65 (patch)
treee52d28f64fb11cdf57e689f73067ccaed44ad2ce /target/linux/imx6/patches-4.4/113-serial-imx-make-sure-unhandled-irqs-are-disabled.patch
parent1708644f1915eb7587a904d81da0ef0b559d1567 (diff)
downloadupstream-26e4fee6e28d5f5d50a5ce74aa044fa5b3a9db65.tar.gz
upstream-26e4fee6e28d5f5d50a5ce74aa044fa5b3a9db65.tar.bz2
upstream-26e4fee6e28d5f5d50a5ce74aa044fa5b3a9db65.zip
imx6: kernel: Backport serial port fixes
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'target/linux/imx6/patches-4.4/113-serial-imx-make-sure-unhandled-irqs-are-disabled.patch')
-rw-r--r--target/linux/imx6/patches-4.4/113-serial-imx-make-sure-unhandled-irqs-are-disabled.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/target/linux/imx6/patches-4.4/113-serial-imx-make-sure-unhandled-irqs-are-disabled.patch b/target/linux/imx6/patches-4.4/113-serial-imx-make-sure-unhandled-irqs-are-disabled.patch
new file mode 100644
index 0000000000..8978d33e6e
--- /dev/null
+++ b/target/linux/imx6/patches-4.4/113-serial-imx-make-sure-unhandled-irqs-are-disabled.patch
@@ -0,0 +1,61 @@
+From a58c6360b9eb3a2374b0b069ba9ce7baec0f26df Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Thu, 24 Mar 2016 14:24:22 +0100
+Subject: [PATCH 3/3] serial: imx: make sure unhandled irqs are disabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Make sure that events that are not handled in the irq function don't
+trigger an interrupt.
+
+When the serial port is operated in DTE mode, the events for DCD and RI
+events are enabled after a system reset by default.
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Petr Štetiar <ynezz@true.cz>
+---
+ drivers/tty/serial/imx.c | 23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
+index 5ced61e..fcd48fd 100644
+--- a/drivers/tty/serial/imx.c
++++ b/drivers/tty/serial/imx.c
+@@ -1221,11 +1221,32 @@ static int imx_startup(struct uart_port *port)
+ temp |= (UCR2_RXEN | UCR2_TXEN);
+ if (!sport->have_rtscts)
+ temp |= UCR2_IRTS;
++ /*
++ * make sure the edge sensitive RTS-irq is disabled,
++ * we're using RTSD instead.
++ */
++ if (!is_imx1_uart(sport))
++ temp &= ~UCR2_RTSEN;
+ writel(temp, sport->port.membase + UCR2);
+
+ if (!is_imx1_uart(sport)) {
+ temp = readl(sport->port.membase + UCR3);
+- temp |= IMX21_UCR3_RXDMUXSEL | UCR3_ADNIMP;
++
++ /*
++ * The effect of RI and DCD differs depending on the UFCR_DCEDTE
++ * bit. In DCE mode they control the outputs, in DTE mode they
++ * enable the respective irqs. At least the DCD irq cannot be
++ * cleared on i.MX25 at least, so it's not usable and must be
++ * disabled. I don't have test hardware to check if RI has the
++ * same problem but I consider this likely so it's disabled for
++ * now, too.
++ */
++ temp |= IMX21_UCR3_RXDMUXSEL | UCR3_ADNIMP |
++ UCR3_RI | UCR3_DCD;
++
++ if (sport->dte_mode)
++ temp &= ~(UCR3_RI | UCR3_DCD);
++
+ writel(temp, sport->port.membase + UCR3);
+ }
+
+--
+1.9.1
+