drivers/apbuart: Fix interrupt-driven operation
This commit aligns the GRLIB APBUART driver with the Zephyr UART API and fixes an issue where TX interrupt could previously be lost. It was typically seen during interactive operation in the Zephyr shell. There is an expectation in the Zephyr UART API that TX ready (i.e. TX buffer space available) interrupt is a level interrupt, i.e. always active while there's TX buffer space available. In particular, there's an expectation that after uart_irq_tx_enable(), the TX interrupt will immediately fire (assuming free TX buffer space is available). The APBUART "Transmitter interrupt (CTRL_TI)" does not directly fulfill this expectation because it is edge triggered and fires when the TX holding register moves from being non-empty to empty. The solution is to "bootstrap" interrupt processing by calling user-defined ISR in irq_tx_enable(). This fix is similar to commit 49bb1637 ("drivers: serial: uart_cmsdk_apb: Fix interrupt-driven operation"). Signed-off-by:Martin Åberg <martin.aberg@gaisler.com>
Loading
Please sign in to comment