]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00225875-2 i.MX6Q/Solo Sabreauto Bluetooth H4 fix uart rx timeouts.
authorIsrael Perez <B37753@freescale.com>
Wed, 31 Oct 2012 22:13:36 +0000 (17:13 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:39 +0000 (08:35 +0200)
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 <B37753@freescale.com>
drivers/tty/serial/imx.c

index 5e9594d744d952936238495cf126dc1448ab5c8d..e76e5b9435b9c818bad832353bce268a1bbeb49e 100644 (file)
@@ -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)) {