UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

Uart parity error handling paroblem in xuartps driver

Visitor
Posts: 4
Registered: ‎01-15-2015

Uart parity error handling paroblem in xuartps driver

Hello

 

At the uart driver, error in prity bit by setting to odd and send as even

make the linux hang and crash

 

I't seems that some ISR is blocked

 

Any solutions?

 

Thanks

 

Moti

Visitor
Posts: 11
Registered: ‎03-01-2017

Re: Uart parity error handling paroblem in xuartps driver

Hi,

 

Did you found the solution to this issue ?

We are experiencing the same problem on Xilinx Kernel 3.15.

 

Best regards!

Highlighted
Visitor
Posts: 11
Registered: ‎03-01-2017

Re: Uart parity error handling paroblem in xuartps driver

This is the patch that we found that works.

 

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index c3c252d..c205488 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -13,6 +13,12 @@
* still shows in the naming of this file, the kconfig symbols and some symbols
* in the code.
*/
+
+ /* 13.09.2018 PATCH for PARITY issue:
+ Djordje Vujic,
+ Darko Alavanja
+ Nikola Stojkov
+ */

#if defined(CONFIG_SERIAL_XILINX_PS_UART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
@@ -37,7 +43,7 @@
#define CDNS_UART_MINOR 0 /* works best with devtmpfs */
#define CDNS_UART_NR_PORTS 2
#define CDNS_UART_FIFO_SIZE 64 /* FIFO size */
-#define CDNS_UART_REGISTER_SPACE 0xFFF
+#define CDNS_UART_REGISTER_SPACE 0x1000 /* PATCH */

#define cdns_uart_readl(offset) ioread32(port->membase + offset)
#define cdns_uart_writel(val, offset) iowrite32(val, port->membase + offset)
@@ -792,8 +798,20 @@ static int cdns_uart_startup(struct uart_port *port)
cdns_uart_writel(cdns_uart_readl(CDNS_UART_ISR_OFFSET),
CDNS_UART_ISR_OFFSET);

+ /* PATCH PATCH PATCH PATCH PATCH PATCH PATCH PATCH PATCH PATCH PATCH
+ * Do not enable parity error interrupt for the following
+ * reason: When parity error interrupt is enabled, each Rx
+ * parity error always results in 2 events. The first one
+ * being parity error interrupt and the second one with a
+ * proper Rx interrupt with the incoming data. Disabling
+ * parity error interrupt ensures better handling of parity
+ * error events. With this change, for a parity error case, we
+ * get a Rx interrupt with parity error set in ISR register
+ * and we still handle parity errors in the desired way.
+ *PATCH PATCH PATCH PATCH PATCH PATCH PATCH PATCH PATCH PATCH PATCH/
+
/* Set the Interrupt Registers with desired interrupts */
- cdns_uart_writel(CDNS_UART_IXR_TXEMPTY | CDNS_UART_IXR_PARITY |
+ cdns_uart_writel(CDNS_UART_IXR_TXEMPTY |
CDNS_UART_IXR_FRAMING | CDNS_UART_IXR_OVERRUN |
CDNS_UART_IXR_RXTRIG | CDNS_UART_IXR_TOUT,
CDNS_UART_IER_OFFSET);
@@ -1466,3 +1484,4 @@ module_exit(cdns_uart_exit);
MODULE_DESCRIPTION("Driver for Cadence UART");
MODULE_AUTHOR("Xilinx Inc.");
MODULE_LICENSE("GPL");
+