Enabling Interrupts for uart - Xavier agx

Hello There ,

Instead of polling how can we enable interrupts for uart so that rx pin will read on when data comes

hello boreddybharath20,

please access Xavier Series SoC Technical Reference Manual.
it’s control registers (IER, IIR) for interrupt controls.
you may check Chapter-10 Low-Speed I/O for the 10.4 session of UART for more details.

How can we make modifications to those registers IIR IER , How can we configure them?


check the driver in kernel source

Cant we configure the registers after flashing to xavier ?

went through soc_TRM manual and serial-tegra.c but unable to enable interrupts for uart.
can you help providing more resources

Hello boreddybharath20,

By default we are using interrupts to handle UART rx/tx data in linux.
You can check tegra_uart_hw_init function in serial-tegra driver, where we are enabling RX interrupts by writing into the IER (Interrupt enable) register:

     * Enable IE_RXS for the receive status interrupts like line errros.
     * Enable IE_RX_TIMEOUT to get the bytes which cannot be DMA'd.
     * If using DMA mode, enable EORD instead of receive interrupt which
     * will interrupt after the UART is done with the receive instead of
     * the interrupt when the FIFO "threshold" is reached.
     * EORD is different interrupt than RX_TIMEOUT - RX_TIMEOUT occurs when
     * the DATA is sitting in the FIFO and couldn't be transferred to the
     * DMA as the DMA size alignment(4 bytes) is not met. EORD will be
     * triggered when there is a pause of the incomming data stream for 4
     * characters long.
     * For pauses in the data which is not aligned to 4 bytes, we get
     * both the EORD as well as RX_TIMEOUT - SW sees RX_TIMEOUT first
     * then the EORD.
    if (!tup->use_rx_pio)
            tup->ier_shadow = UART_IER_RLSI | UART_IER_RTOIE |
            tup->ier_shadow = UART_IER_RLSI | UART_IER_RTOIE | UART_IER_RDI;

Then, whenever data is received. The UART driver calls the registered interrupt handler for serial-tegra driver i.e. tegra_uart_isr function.
In tegra_uart_isr we check IIR (Interrupt Identification Register) and if it is a RX interrupt we process the data.