- 09 Jan, 2015 40 commits
-
-
Baruch Siach authored
Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Baruch Siach authored
Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Baruch Siach authored
Use "cnxt" since it once was the stock ticker of Conexant. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Eric Nelson authored
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>
-
Eric Nelson authored
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>
-
Ley Foon Tan authored
Add device pointer to port->dev. Before: "(NULL device *): ttyAL0 at MMIO 0x2020 (irq = 6, base_baud = 3125000) is a Altera UART" After: "altera_uart 2020.serial: ttyAL0 at MMIO 0x2020 (irq = 6, base_baud = 3125000) is a Altera UART" Signed-off-by: Ley Foon Tan <lftan@altera.com> Acked-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ley Foon Tan authored
Add device pointer to port->dev. Before: "(NULL device *): ttyJ0 at MMIO 0x1008 (irq = 2, base_baud = 0) is a Altera JTAG UART" After: "altera_jtaguart 1008.serial: ttyJ0 at MMIO 0x1008 (irq = 2, base_baud = 0) is a Altera JTAG UART" Signed-off-by: Ley Foon Tan <lftan@altera.com> Acked-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Robert Baldyga authored
Add RX DMA transfers support for samsung serial driver. It's enabled when DMA controller for RX channel is specified in device-tree. DMA transactions are started when number of bytes in RX FIFO reaches trigger level, otherwise PIO mode is used. DMA transfer size is always PAGE_SIZE which can cause large latency when smaller data amount is transferred, so we always terminate DMA transaction on RX timeout interrupt. Timeout interval is set to 64 frame times. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Robert Baldyga authored
Add TX DMA transfers support for samsung serial driver. It's enabled when "dmas" property is defined in serial device-tree node, otherwise TX transfers are prerformed using PIO. TX DMA is used for data segments larger than fifosize to reduce number of interrupts during data transmission. For buffers shorter than fifosize PIO mode is selected. Data blocks for DMA transfers are aligned to cache line size to avoid problems with coherency (some areas of TX circ buffer can be used by CPU during DMA transaction, so we have to ensure that our data is always consistent). Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Robert Baldyga authored
Add functions requesting and releasing RX and TX DMA channels. This function are called only when "dmas" property in serial device-tree node is defined. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Robert Baldyga authored
This macro definitions are necessary to implement DMA transfers is samsung serial driver. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Robert Baldyga authored
When we have "dmas" property in serial node in device-tree, we do memory alocation for dma structure which will be used in DMA handling code. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Robert Baldyga authored
This struct contains DMA configuration for each serial port. It will be used in next commits adding DMA support in driver. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiada Wang authored
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>
-
Jiada Wang authored
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>
-
Jiada Wang authored
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>
-
Robin Gong authored
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>
-
Anton Bondarenko authored
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>
-
Dirk Behme authored
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>
-
Jiada Wang authored
Currently in dma_tx_callback(), no matter if there is still remaining data pending in circle buffer or not, DMA transmit will be terminated. This will result in some data never get transmitted. In order to fix this issue, call imx_dma_tx() again in dma_tx_callback, when there is pending data and uart hasn't been stopped. 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>
-
Jiada Wang authored
This reverts commit 2ad28e3e. Instead of always wake up write_wait process in TX callback, TX callback should call imx_dma_tx() again, and let imx_dma_tx transfer the remaining data in circle buffer. The issue with commit 2ad28e3e is, in case there is remaining data in circle buffer, but no process is waiting on write_wait queue, then as no following uart_write() will be called after uart_write_wakeup(), thus cause data loss. Moreover according to Documentation/serial/driver, uart_write_wakeup() should be called in case the transmit buffer have dropped below a threshold. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dirk Behme authored
To synchronize between dma_tx_callback() and imx_dma_tx() use the same variable, dma_is_txing. This prevents any race between these two functions and ensures that a new DMA can start only after the first has been finished. Before the new DMA can be set up, update the circular buffer logic, first. Therefore, change dma_is_txing after that update, instead of before. While doing this, in dma_tx_callback() extend the locking to dma_unmap_sg() and the update of dma_is_txing. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dirk Behme authored
First, reformat the code to exit immediately. This allows us to add more code in more readable format. In case the TX DMA was still running, remove and disable it's resources. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dirk Behme authored
In case dmaengine_prep_slave_sg() fails, add the missing dma_unmap_sg(). Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Anton Bondarenko <anton_bondarenko@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dirk Behme authored
Inverting the logic of the if statement for the sg initialization makes the if statement easier and better to read. No functional change. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dirk Behme authored
Use imx_start_tx() just to enable the TX interrupt. It's the job of the TX interrupt ISR to fill the transmit buffer, then. If the transmit buffer is empty, the TX interrupt should be executed as soon as the start_tx() enables the interrupt, so there is no reason for the extra imx_transmit_buffer() call, here. Remove it. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Andy Lowe <andy_lowe@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiada Wang authored
Several places are accessing the UCR1 register without locking. This probably will cause a race issue when another thread is accessing the same register. Add locking to preventing concurrent access of the UCR1 register. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiada Wang authored
Add CREAD flag hanlding in set_termios and UART DMA mode which ignores all received chars when CREAD flag cleared. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Anton Bondarenko <anton_bondarenko@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Cyrille Pitchen authored
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Cyrille Pitchen authored
This patch fixes many bugs in the code dealing with the hardware handshake. As an example, in atmel_set_termios(), we used to test whether the CRTSCTS c_cflag was set. If so, we selected the "Hardware Handshake" mode through the Mode Register. However, few lines below the mode was reset to "Normal" (0). So there was no way to select the "Hardware Handshake" mode. To fix this issue, we moved the CRTSCRTS c_cflag test AFTER the mode has been reset to "Normal". Also setting the RTSEN and RTSDIS bits in the Control Register has different results whether the USART is set in "Normal" or "Hardware Handshake" mode: 1) "Normal" mode - the RTSEN bit forces the RTS line to low level, which tells the remote peer that we are ready to received new data. - the RTSDIS bit forces the RTS line to high level, which tells the remote peer to stop sending new data. 2) "Hardware Handshake" mode - the RTSEN bit forces the RTS line to high level. - the RTSDIS bit lets the hardware control the RTS line. WARNING: when FIFOs are not available or not enabled, the RTS line is controlled by the PDC. This is why using the Hardware Handshake mode requires using the PDC channel for reception. However the Hardware Handshake mode DOES NOT work with DMA controller since it cannot control the RTS line. Future designs with FIFOs will introduce a new feature: the RTS line will be controlled by the RX FIFO using thresholds. This patch was tested with this new design. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Cyrille Pitchen authored
-EDEFER error wasn't handle properly by atmel_serial_probe(). As an example, when atmel_serial_probe() is called for the first time, we pass the test_and_set_bit() test to check whether the port has already been initalized. Then we call atmel_init_port(), which may return -EDEFER, possibly returned before by clk_get(). Consequently atmel_serial_probe() used to return this error code WITHOUT clearing the port bit in the "atmel_ports_in_use" mask. When atmel_serial_probe() was called for the second time, it used to fail on the test_and_set_bit() function then returning -EBUSY. When atmel_serial_probe() fails, this patch make it clear the port bit in the "atmel_ports_in_use" mask, if needed, before returning the error code. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: <stable@vger.kernel.org> # 3.12+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Cyrille Pitchen authored
atmel_serial_probe() calls atmel_init_port(). In turn, atmel_init_port() calls clk_disable_unprepare() to disable the peripheral clock before returning. Later atmel_serial_probe() accesses some I/O registers such as the Mode and Control registers for RS485 support then the Name and Version registers, through a call to atmel_get_ip_name(), but at that moment the peripheral clock was still disabled. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: <stable@vger.kernel.org> # 3.12+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Cyrille Pitchen authored
dma_sync_*_for_cpu() and dma_sync_*_for_device() use 'enum dma_data_direction', not 'enum dma_transfer_direction' Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Barry Song authored
MARCO will not be supported any more and the project was dropped. it has been replaced by CSR atlas7. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
Commit 2aff5e2b ('tty: Change tty lock order to master->slave') added a warning which is broken and unnecessary now that the tty lock has fixed lock subclasses, added in commit 2febdb63 ('tty: Preset lock subclass for nested tty locks'). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wolfram Sang authored
This platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Feng Kan authored
Enable APM X-Gene SoC serial port functionality when using ACPI table to initialize serial port. Signed-off-by: Feng Kan <fkan@apm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Andy Shevchenko authored
There is no need to terminate transfer in the __dma_rx_complete() since it's called at the end of transfer. Special case when serial timeout occurs is handled separately where we have to terminate transfer. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Estevam authored
By using devm_request_irq() we can have a shorter and cleaner code. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Estevam authored
By using devm_clk_get() we can have a shorter and cleaner code. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-