This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: Possible issue with omap-serial.c driver and IXON flag

Part Number: AM3352

Hello,

We are working with am3352 and using kernel 4.19.94 from TI SDK.

When we try to reconfigure uart settings with tcsetattr(), if data is still coming in and IXON flag is set, TX stops working.

Looking into omap-serial.c driver we see that data is written to the tx queue but in the oscilloscope we can see there is nothing in the TX line.

This driver seems to be based on 8250. Looking also in 8250_omap.c function omap_8250_set_termios() we see this comment, that could be the same problem
/*
* OMAP rx s/w flow control is borked; the transmitter remains
* stuck off even if rx flow control is subsequently disabled
*/

/*
* IXOFF Flag:
* Enable XON/XOFF flow control on output.
* Transmit XON1, XOFF1
*/
if (termios->c_iflag & IXOFF) {
up->port.status |= UPSTAT_AUTOXOFF;
priv->efr |= OMAP_UART_SW_TX;
}

We see that serial_omap_set_termios() in omap-serial.c is a bit different, and IXON is implepented:

/*
* IXON Flag:
* Enable XON/XOFF flow control on input.
* Receiver compares XON1, XOFF1.
*/
if (termios->c_iflag & IXON) {
up->efr |= OMAP_UART_SW_RX;
}

/*
* IXOFF Flag:
* Enable XON/XOFF flow control on output.
* Transmit XON1, XOFF1
*/
if (termios->c_iflag & IXOFF) {
up->port.status |= UPSTAT_AUTOXOFF;
up->efr |= OMAP_UART_SW_TX;
}

but according to termios manual page
    IXON Enable XON/XOFF flow control on output.
    IXOFF Enable XON/XOFF flow control on input.

And this is just the opposite way as considered in the driver.

If we change driver source code and make IXON for output and IXOFF for input error is fixed.

Could this be an error in the driver?

Best regards
Angel

  • Hi Angel,

    but according to termios manual page
        IXON Enable XON/XOFF flow control on output.
        IXOFF Enable XON/XOFF flow control on input.

    And this is just the opposite way as considered in the driver.

    Thanks for reporting this. Let me check with our sw dev team and get back to you.

    If we change driver source code and make IXON for output and IXOFF for input error is fixed.

    Which serial driver have you validated, omap-serial.c or 8250-omap.c, or both?

  • Hi,

    Thank you for your help. I will wait for your team answer.

    I have modified omap-serial.c, but I tested only that our error is not happening.

    I did not test full XON/XOFF functionality.

    Best regards

    Angel

  • Hi Angel,

    The logic in serial-omap.c is correct.

    IXOFF is to enable sw flow control on input, which means when the receiver input FIFO is full (or close to full), the receiver should send XOFF char to the transmitter to stop sending more chars, and send XON char when the receiver is able to receive more chars.

    While IXON is to enable sw flow control on output, which means the transmitter should respect the handshake of received XON/XOFF chars, to start/stop transmitting accordingly.

  • Hi,

    Thank you for your response.

    Best regards