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!

cancel
Showing results for 
Search instead for 
Did you mean: 
783 Views
Registered: ‎10-19-2017

code for flow control for UARTs in Zynq-7000

A customer of mine has a product based on Zynq-7000. The driver for the UART (Cadence IP) found in the Xilinx-maintained Linux tree[1] doesn't look like it supports full flow control: it always reports CTS being asserted to the higher layers which means that the device will always keep transmitting even if the other side is telling it to pause (via RTS).

 

The relevant piece of code[2] looks like this:

992 /**

993  * cdns_uart_get_mctrl - Get the modem control state

994  * @port: Handle to the uart port structure

995  *

996  * Return: the modem control state

997  */

998 static unsigned int cdns_uart_get_mctrl(struct uart_port *port)

999 {

1000         return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;

1001 }

I found one discussion of this on Xilinx forums from 2013[3].

 

Would you be able to provide some answers regarding this:

  1. Am I missing something or does the Zynq driver on Linux really not support HW flow control using RTS/CTS?
  2. Is there a bug open for this or any plan to implement it fully, or do I have to rework the driver myself?
  3. The driver as-is doesn't make use of the UART controller's capability for automatic flow control (bit 5 (FCM) in MODEMCR register of the UART). Is there another driver that does?

 

[1] https://github.com/Xilinx/linux-xlnx

[2] drivers/tty/serial/xilinx_uartps.c

[3] https://forums.xilinx.com/t5/Embedded-Linux/UART-Modem-Control-RTS-CTS/td-p/354273

 

Could someone please answer if there is flow control code for UARTs in Zynq-7000?  And if so how to obtain it?

0 Kudos
2 Replies
Mentor jmcclusk
Mentor
767 Views
Registered: ‎02-24-2014

Re: code for flow control for UARTs in Zynq-7000

I think you've pretty much answered your own questions.   It might get upgraded some day in the future, but I think its much more likely to happen if you fork the repo,  upgrade the driver, and then send michalsimek a pull request.    Looking at the history of the driver, it seems to get a tweak or an upgrade every few months, so it's definitely not a dead driver.  It looks like nobody has had a burning need for flow control yet.    This is your chance to be a hero and step up...  hopefully getting paid for it too.  Good luck!

Don't forget to close a thread when possible by accepting a post as a solution.
0 Kudos
Newbie charle
Newbie
135 Views
Registered: ‎03-25-2019

Re: code for flow control for UARTs in Zynq-7000

     Do you now have resolved the flow control for UARTs in Zynq-7000 ?? Now aslo we meet the issue of using the Zynq-7000 to support the auto-flow-control.

     But in the latest kernel, We found it still has no patch to supporting it.If you have resolved the issue ,Could you share the patch of flow control for us?

     Thanks a lot.

Best wish.

 

0 Kudos