summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/imx.c
AgeCommit message (Collapse)Author
2015-12-13serial: imx: implement handshaking using gpios with the mctrl_gpio helperUwe Kleine-König
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-13serial: imx: reorder functions and simplify a bitUwe Kleine-König
Now that imx_mctrl_check is implemented below imx_get_mctrl the former can call the latter directly instead of via sport->port.ops->get_mctrl. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-13serial: imx: repair and complete handshakingUwe Kleine-König
The .get_mctrl callback should not report the status of RTS or LOOP, so drop this. Instead implement reporting the state of CAR (aka DCD) and RI. For .set_mctrl implement setting the DTR line. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-13serial: imx: fix a possible NULL dereferenceLABBE Corentin
of_match_device could return NULL, and so cause a NULL pointer dereference later. Even if the probability of this case is very low, fixing it made static analyzers happy. Solving this with of_device_get_match_data made also code simplier. Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12Merge 4.3-rc5 into tty-nextGreg Kroah-Hartman
We want the tty fixes and reverts in here as well so that people can properly test and use it. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04Revert "serial: imx: remove unbalanced clk_prepare"Fabio Estevam
This reverts commit 9e7b399d6528eac33a6fbfceb2b92af209c3454d. Commit ("9e7b399d6528ea") causes the following warning and sometimes also hangs the system: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at kernel/locking/mutex.c:868 mutex_trylock+0x20c/0x22c() DEBUG_LOCKS_WARN_ON(in_interrupt()) Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.2.0-rc7-next-20150818-00001-g14418a6 #4 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) Backtrace: [<80012f08>] (dump_backtrace) from [<800130a4>] (show_stack+0x18/0x1c) r6:00000364 r5:00000000 r4:00000000 r3:00000000 [<8001308c>] (show_stack) from [<807902b8>] (dump_stack+0x88/0xa4) [<80790230>] (dump_stack) from [<8002a604>] (warn_slowpath_common+0x80/0xbc) r5:807945c4 r4:80ab3b50 [<8002a584>] (warn_slowpath_common) from [<8002a6e4>] (warn_slowpath_fmt+0x38/0x40) r8:00000000 r7:8131100c r6:8054c3cc r5:8131300c r4:80b0a570 [<8002a6b0>] (warn_slowpath_fmt) from [<807945c4>] (mutex_trylock+0x20c/0x22c) r3:8095d0d8 r2:8095ab28 [<807943b8>] (mutex_trylock) from [<8054c3cc>] (clk_prepare_lock+0x14/0xf4) r7:8131100c r6:be3f0c80 r5:00000037 r4:be3f0c80 [<8054c3b8>] (clk_prepare_lock) from [<8054dbfc>] (clk_prepare+0x18/0x30) r5:00000037 r4:be3f0c80 [<8054dbe4>] (clk_prepare) from [<8036a600>] (imx_console_write+0x30/0x244) r4:812d0bc8 r3:8132b9a4 To reproduce the problem we only need to let the board idle for something like 30 seconds. Tested on a imx6q-sabresd. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Reviewed-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04serial: imx: also update RX stats in DMA pathLucas Stach
The RX bytecount was only updated in the PIO path and thus the device erroneously reported a value of 0 if DMA is in use. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04serial: imx: re-enable DMA support without hardware flow controlLucas Stach
The commit enabling DMA support even if no flow control is present was reverted on the grounds that it uncovered a number of bugs in the code that lead to hanging tty devices and/or missing characters. After tracking down the issues it is clear that those were generic bugs and had nothing to do with flow control being present or not, only that allowing DMA without hardware flow control increased the exposure of that code a lot. Now that those bugs are fixed, it should be safe to re-enable DMA support. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04serial: imx: don't use idle condition detect for DMA transfersLucas Stach
The reference manual states that idle condition detect should not be used with DMA transfers, as the ROM SDMA scripts don't check those conditions. The RAM SDMA scripts worked around this, but the change broke compatibility with the ROM scripts. The previous commits fixed the DMA burst sizes, so that the aging timer is now working as described in the reference manual. With this fixed we can remove the hack of using the idle condition detect to stop the DMA transfer if there are no new characters incoming. This should work with both the ROM and RAM SDMA scripts. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04serial: imx: configure proper DMA burst sizesLucas Stach
Triggering the DMA engine for every byte is horribly inefficient. Also it doesn't allow to use the aging timer for the RX FIFO as this requires the DMA engine to leave one byte remaining in the FIFO when doing a normal burst transfer. Adjust watermark levels so that the DMA engine can do at least 8 byte burst transfers. This is a conservative value, as the both TX and RX FIFOs are able to contain 32 bytes. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04serial: imx: always restart DMA if more data is availableLucas Stach
Simplify the DMA restart logic to always queue up the next transfer immediately if there is at least one more byte available in the FIFO, so that the transfer will finish in a limited time. This way the driver stops to rely on zero length transfers to signal transfers ends. Those will go away when the idle detect DMA requests are disabled. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04serial: imx: set up aging timer interrupt as DMA triggerLucas Stach
The DMA transfer is only started once we are sure it will finish in a limited time, i.e. only after we received a RRDY interrupt. In order to allow the watermark level to be raised the aging timer and the corresponding interrupt need to be set up as an additional trigger, so that the transfer is also started if the incoming amount of bytes never reach the watermark. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04serial: imx: make setup_ufcr more usefulLucas Stach
This function currently doesn't use its parameter. Change prototype to pass in watermark levels, so we can reuse this function in the DMA setup paths. Also relocate to be near the calling functions. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04serial: imx: add earlycon supportLucas Stach
Earlycon allows to have an early debugging console that doesn't need to be statically configured in the kernel config, like earlyprintk, but is set up through the stdout-path DT property. This allows to have the early debugging always built into the kernel and enabled on demand without clashing between different boards or architectures. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14serial: imx: save and restore context in the suspend pathEduardo Valentin
This change teaches the imx serial driver to save its context and restore it across suspend and resume path. To do so, it introduces serial_imx_restore_context() and serial_imx_save_context() functions. They use a shadow set of registers to save key registers and restore them accordingly. These functions can be reused on other situations, when the device context is lost. Cc: Fabio Estevam <festevam@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14serial: imx: allow waking up on RTSDEduardo Valentin
This patch sets RTSDEN bit when going into idle (Stop mode). We add the RTSDEN for the case RTS is sent from the remote connection. This way we allow the system to wakeup when RTS is received. Cc: Fabio Stevam <festevam@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14serial: imx: introduce serial_imx_enable_wakeup()Eduardo Valentin
This change is a code reorganization. Here we introduce serial_imx_enable_wakeup() helper function to do the job of configuring and preparing wakeup sources on imx serial device. The idea is to allow other parts of the code to call this function whenever the device is known to go to idle. Cc: Fabio Estevam <festevam@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14serial: imx: remove unbalanced clk_prepareEduardo Valentin
The current code attempts to prepare clk_per and clk_ipg before using the device. However, the result is an extra prepare call on each clock. Here is the output of uart clocks (only uart enabled and used as console): $ grep uart /sys/kernel/debug/clk/clk_summary uart_serial 1 2 80000000 0 0 uart 1 2 66000000 0 0 This patch balances the calls of prepares. The result is: $ grep uart /sys/kernel/debug/clk/clk_summary uart_serial 1 1 80000000 0 0 uart 1 1 66000000 0 0 Cc: Fabio Estevam <festevam@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03Serial: imx: add dev_pm_ops to support suspend to ram/diskShenwei Wang
When system goes into low power states like SUSPEND_MEM and HIBERNATION, the hardware IP block may be powered off to reduce the power consumption. This power down may cause problems on some imx platforms, because the hardware settings are reset to its power on default values which may differ from the ones when it power off. This patch added the dev_pm_ops and implemented two callbacks: suspend_noirq and resume_noirq, which will save the necessory hardware parameters right before power down and recover them before system uses the hardware. Because added the dev_pm_ops, the old suspend/resume callbacks under platform_driver will not be called any more. Changed their prototypes and moved those two callbacks into dev_pm_ops too. Signed-off-by: Shenwei Wang <shenwei.wang@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-27Revert "tty: serial: imx.c: Reset UART before activating interrupts"Fabio Estevam
This reverts commit e95044ba4fee93f5ea8a1a24b2d921e148503833. Commit e95044ba4fee93 ("tty: serial: imx.c: Reset UART before activating interrupts") terribly messes up with the console on mx6 boards, so let's revert it. Reported-by: kernelci.org bot <bot@kernelci.org> Cc: David Jander <david@protonic.nl> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-27Merge 4.2-rc4 into tty-nextGreg Kroah-Hartman
Other serial driver work wants to build on patches now in 4.2-rc4 so merge the branch so this can properly happen. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23Revert "serial: imx: initialized DMA w/o HW flow enabled"David Jander
This reverts commit 068500e08dc87ea9a453cc4a500cf3ab28d0f936. According to some tests, SDMA support is broken at least for i.MX6 without HW flow control. Different forms of data-corruption appear either with the ROM firmware for the SDMA controller as well as when loading Freescale provided SDMA firmware versions 1.1 or 3.1. Signed-off-by: David Jander <david@protonic.nl> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23tty: serial: imx.c: Reset UART before activating interruptsDavid Jander
If the UART has been in use before this driver was loaded, IRQs might be active and get fired as soon as we set the handler, which will crash in the spin_lock_irqsave(&sport->port.lock, flags) because port.lock is not initialized until the port is added at the end of probe. Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23serial: imx: reduce irq-latency after rx overflowManfred Schlaegl
To prevent problems with interrupt latency, and due to the fact, that the error will be counted anyway (icount.overrun), the dev_err is simply removed. Background: If an rx-fifo overflow occurs a dev_err message was called in interrupt context. Since dev_err messages are written to console in a synchronous way (unbuffered), and console may be a serial terminal, this leads to a highly increased interrupt-latency (several milliseconds). As a result of the high latency more rx-fifo overflows will happen, and therefore a feedback loop of errors is created. Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at> Acked-By: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23serial: imx: count tty buffer overrunsManfred Schlaegl
As can be seen in function uart_insert_char (serial_core) the element buf_overrun of struct uart_icount is used to count overruns of tty-buffer. Added support for counting of overruns in imx driver analogue to serial_core. Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23serial: imx: Disable irqs before requesting themFabio Estevam
Disable interrupts before requesting them in order to fix a kernel oops after lauching a kernel via kexec. Tested on a imx6sl-evk board. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08Merge 4.1-rc7 into tty-nextGreg Kroah-Hartman
This fixes up a merge issue with the amba-pl011.c driver, and we want the fixes in this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24serial: imx: Fix DMA handling for IDLE condition abortsPhilipp Zabel
The driver configures the IDLE condition to interrupt the SDMA engine. Since the SDMA UART ROM script doesn't clear the IDLE bit itself, this caused repeated 1-byte DMA transfers, regardless of available data in the RX FIFO. Also, when returning due to the IDLE condition, the UART ROM script already increased its counter, causing residue to be off by one. This patch clears the IDLE condition to avoid repeated 1-byte DMA transfers and decreases count by when the DMA transfer was aborted due to the IDLE condition, fixing serial transfers using DMA on i.MX6Q. Reported-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Fabio Estevam <fabio.estevam@freescale.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10serial: imx: Constify platform_device_idKrzysztof Kozlowski
The platform_device_id is not modified by the driver and core uses it as const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06serial: imx: Remove return value from imx_setup_ufcr()Fabio Estevam
The return value from imx_setup_ufcr() is always 0 and its value is never checked, so better to remove the return value. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06serial: imx: protect Soft Reset of port with lockJiada Wang
Previously Soft Reset (clear of SRST bit in UCR2 register) of UART in startup is not protected by lock, which may have race with console_write, as console_write may occur at anytime even when UART port is shutdown. To avoid this race, protect Soft reset of UART port with spin_lock. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-11serial: imx: Add braces to avoid ambiguous 'else'Fabio Estevam
Commit 17b8f2a3fdca29 ("serial: imx: add support for half duplex rs485") introduced the following build warning: drivers/tty/serial/imx.c: In function 'imx_set_termios': drivers/tty/serial/imx.c:1301:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] Add the suggested braces to avoid the build warning. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial: imx: add support for half duplex rs485Uwe Kleine-König
The transmitter is expected to be controlled by the UART's RTS pin. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial: imx: drop support for IRDAUwe Kleine-König
Support for IRDA was added in 2009 in commit v2.6.31-rc1~399^2~2. There are no in-tree users. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial: imx: fix comment about which machines use the i.MX21 typeUwe Kleine-König
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial: imx: reformat and cleanup copyright headerUwe Kleine-König
Fix indention, remove old address of the FSF, remove in-file changelog, mention Freescale. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial: imx: drop members from driver data that are only used during probeUwe Kleine-König
There is no benefit in keeping this information in RAM when it's not used any more, so better use function local variables instead. These members are unused since c0d1c6b0f0dc ("serial: imx: Fix the reporting of interrupts") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial: imx: remove long dead codeUwe Kleine-König
This if (0) exists since the driver was introduced in commit c49bde83eb6a ([ARM PATCH] 1956/2: Re: Motorola i.MX serial driver) back in 2004. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial: imx: Fix clearing of receiver overrun flagUwe Kleine-König
The writeable bits in the USR2 register are all "write 1 to clear" so only write the bits that actually should be cleared. Fixes: f1f836e4209e ("serial: imx: Add Rx Fifo overrun error message") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial: imx: Do not store/restore the UBRC registerFabio Estevam
UBRC is a read-only register, so we should not store and restore it inside imx_flush_buffer(). Reported-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07serial:imx make of_device_id array constSanjeev Sharma
Make of_device_id array const. Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-02serial: imx: Fix imx_flush_buffer()Fabio Estevam
When running an userspace program that does a 'tcflush(fd, TCIOFLUSH)' call we still see the last received character in the URXD register afterwards. Clear UCR2_SRST bit so that the UART FIFO is flushed properly. Since UCR2_SRST also resets some UART registers, we need to save and restore some of them. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Tested-by: Fugang Duan <B38611@freescale.com> Acked-by: Jason Liu <r64343@freecale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09serial: imx: ignore framing errors when IGNPAR is set.Eric Nelson
When IGNPAR is set in termios->c_iflag, characters with framing errors should be ignored. Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09serial: imx: preserve characters with parity or framing errorsEric Nelson
If IGNPAR/INPCK are clear in termios->c_iflag, characters received with parity or framing errors should be preserved and passed to the upper layers of the tty stack. Specifically, the decision of whether to set the character value to zero should be made by n_tty.c/n_tty_receive_parity_error(). Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09serial: imx: Support sw flow control in DMA modeJiada Wang
This patch adds Software flow control support in DMA mode. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09serial: imx: Fix issue in software flow controlJiada Wang
After send out x_char in UART driver, x_char needs to be cleared by UART driver itself, otherwise data in TXFIFO can no longer be sent out. Also tx counter needs to be increased to keep track of correct number of transmitted data. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09serial: imx: Enable UCR4_OREN in startup interfaceJiada Wang
Other than enable Receiver Overrun Interrupt Enable (UCR4_OREN) in start_tx interface, UCR4_OREN should be enabled before enable of Receiver. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09serial: imx: start rx_dma once RXFIFO is not emptyRobin Gong
Start rx_dma once RXFIFO is not empty that can avoid dma request lost and causes data delay issue. Signed-off-by: Robin Gong <b38343@freescale.com> Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09serial: imx: initialized DMA w/o HW flow enabledAnton Bondarenko
DMA mode for UART can be used even w/o HW flow control with RTS/CTS. So it need to be initialized and enabled earlier. Signed-off-by: Anton Bondarenko <anton_bondarenko@mentor.com> Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09serial: imx: disable TDMAEN in imx_flush_buffer()Dirk Behme
Terminating the DMA, make sure the interrupt is disabled, too. This fixes random kernel Oops due to dma_tx_call() called for invalid transmissions. If we disable the TDMAEN, make sure it's enabled again if a TX DMA is started. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>