Hi,
I try to activate the DMA with UART5 on a custom board with the kernel linux-2.6.35, but when I do exchange data on uart, I have a DMA_ERROR sr1:2040 sr2:508a (or sr1=2010 sr2:5089) .
I try to change the size of different received buffers ( UART5_DMA_RXBUFSIZE from serial.h , or RXDMA_BUFF_SIZE from mxc_uart.c ) but nothing change, i always have the same error.
The uart in normal mode at 115200 bauds works well but i need to increase the baud rate up to 2,000,000 .
Is there any solution or patch ? I search but i don't find anything actually.
best regards
Nicolas.
已解决! 转到解答。
Are you working of the linux source code found at the below link:
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_2.6.35_11.09.01
I would recommend that you replicate the settings for UART3 found in serial.h for UART5.
Best regards,
-Mahesh
I have just given Freescale support a version of the mxc_uart.c driver containing a number of fixes for bugs in DMA operation at high baud rates. If you ask them nicely they should be able to provide it to you.
I am not sure what the clock issue was, but DMA was re-enabled on UART 3 via a subsequent patch that also increased the UART DMA RX buffer size. Below is the commit.
commit 191aff8468999abc730ffe4ee0b99fc6afd6a091
Author: Zhang Jiejing <jiejing.zhang@freescale.com>
Date: Fri Apr 1 10:33:26 2011 +0800
ENGR00140702-2 MX5: UART: enable UART3 DMA transfer
- enable DMA transfer of UART3
- enlarge DMA receive buffer size.
Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
diff --git a/arch/arm/mach-mx5/serial.h b/arch/arm/mach-mx5/serial.h
index 9fbb0b3..6ed55da 100644
--- a/arch/arm/mach-mx5/serial.h
+++ b/arch/arm/mach-mx5/serial.h
@@ -51,8 +51,8 @@
#define UART2_UFCR_TXTL 16
/* UART 3 configuration */
#define UART3_UCR4_CTSTL 16
-#define UART3_DMA_ENABLE 0
-#define UART3_DMA_RXBUFSIZE 1024
+#define UART3_DMA_ENABLE 1
+#define UART3_DMA_RXBUFSIZE 2048
#define UART3_UFCR_RXTL 16
#define UART3_UFCR_TXTL 16
/* UART 4 configuration */
This patch was cherry-picked from the 2.6.35_maintain branch to 11.09 branch. Below is the link:
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_2.6.35_maintain&ofs=50
Yes, I see that. However, I'm on the 2.6.35_maintain branch and am seeing the same error on UART3 (/dev/ttymxc2), which appears to be the only port with DMA enabled, but only if I get the data rate wrong:
~$ microcom -s 115200 /dev/ttymxc2
$C83.9P0.3R0.6T25.7*12
$C84.0P0.3R0.6T25.7*1C
$C84.0P0.3R0.6T25.7*1C
$C84.0P0.2R0.6T25.7*1D
$C84.0P0.2R0.6T25.7*1D
~$ microcom -s 9600 /dev/ttymxc2
[ 382.075133] UART: DMA_ERROR: sr1:2040 sr2:5089
�[ 382.106380] UART: DMA_ERROR: sr1:2040 sr2:5089
�[ 382.169261] UART: DMA_ERROR: sr1:2040 sr2:5089
�g�3�[ 382.263372] UART: DMA_ERROR: sr1:2040 sr2:5089
�?[ 382.326259] UART: DMA_ERROR: sr1:2040 sr2:5089
Are you working of the linux source code found at the below link:
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_2.6.35_11.09.01
I would recommend that you replicate the settings for UART3 found in serial.h for UART5.
Best regards,
-Mahesh
Hi,
Yes it's from git I take the kernel, three or four months ago.
I enabled the dma for uart5 in the same way of uart3.
Actually I am on another project for the week. The next week I do anther tests.
Best regards,
Nicolas
Please get the latest code from :
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_2.6.35_11.09.01
A recent patch was added to update UART SDMA scripts.
Best regards,
-Mahesh
I also met this issue in mx53 uart3: UART: DMA_ERROR: sr1:2040 sr2:508c
My uart3 connnect a bluetooth module, and only first DMAread operation occur this error, sequential DMAread successful.
I patch several commits including the one update UART SDMA scripts, but this error still occurs.
BTW, I noticed this git commit:
-------------------------------------------------------
commit a77a4c4f12640c414adf8c4381cb1d8eb8364dd0
Author: Zhang Jiejing <jiejing.zhang@freescale.com>
Date: Wed Dec 8 20:24:04 2010 +0800
ENGR00137669-3 MX53_SMD: workaround for UART have problem when DMA enable.
There is a clock issue when UART3 enable DMA, so disable this.
Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
----------------------------------------------------
what's mean "a clock issue"? any detail?
BR
wenpeng