From 417bc1f82a4b5f5c0a23179b0f966bd7294dc66c Mon Sep 17 00:00:00 2001 From: Israel Perez Date: Wed, 31 Oct 2012 17:13:36 -0500 Subject: [PATCH] ENGR00225875-2 i.MX6Q/Solo Sabreauto Bluetooth H4 fix uart rx timeouts. Bluetooth H4 protocol is very susceptible to data reception timeouts. DMA transfer only happen when ICD or AGTIM interrutps are trigger. ICD only happen when a N idle frames are present on rx line and rx FIFO is empty. Meanwhile Aging timer is trigger when data in FIFO was been sitting for a period of 8 frames. This patch enable both in order to dispatch data as fast is possible only when the select uart have enable DMA flag. Signed-off-by: Israel Perez --- drivers/tty/serial/imx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 5e9594d744d9..e76e5b9435b9 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -818,8 +818,11 @@ static void imx_finish_dma(struct imx_port *sport) * [2] the Aging timer expires(wait for 8 bytes long) * [3] the Idle Condition Detect(enabled the UCR4_IDDMAEN). * - * The [2] and [3] are similar, but [3] is better. - * [3] can wait for 32 bytes long, so we do not use [2]. + * [2] is trigger when a character was been sitting in the FIFO + * meanwhile [3] can wait for 32 bytes long when the RX line is + * on IDLE state and RxFIFO is empty. + * Bluetooth H4 is very susceptible to Rx timeouts if data is not available + * in a specific period of time so we use both. */ static void dma_rx_callback(void *data) { @@ -1060,8 +1063,8 @@ static int imx_startup(struct uart_port *port) temp |= UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN; if (sport->enable_dma) { temp |= UCR1_RDMAEN | UCR1_TDMAEN; - /* ICD, wait for more than 32 frames, but it still to short. */ - temp |= UCR1_ICD_REG(3); + /* ICD,await 4 idle frames also enable AGING Timer */ + temp |= UCR1_ICD_REG(0)|UCR1_ATDMAEN; } if (USE_IRDA(sport)) { -- 2.39.5