serial: qca_uart: Restart UART RX when RX stale timeout occurs

When a long string (>255 char) input given to uboot console, RX
stale timeout occurred on UART subsystem due to RXFULL. This in-turn
cause uboot console to stuck.

So, Added a check to catch this scenario and re-start the UART RX
if it occurred.

Change-Id: Ic80c1d5f1178bf2455385c3888a2023ce1dbf6fa
Signed-off-by: Ram Kumar D <ramd@codeaurora.org>
This commit is contained in:
Ram Kumar D 2021-10-27 14:50:57 +05:30
parent 0a8ac9e20a
commit dfb99bda23
2 changed files with 10 additions and 0 deletions

View file

@ -251,6 +251,7 @@ struct ipq_serial_platdata {
#define MSM_BOOT_UART_DM_RX_BREAK (1 << 6)
#define MSM_BOOT_UART_DM_HUNT_CHAR (1 << 7)
#define MSM_BOOT_UART_DM_RX_BRK_START_LAST (1 << 8)
#define MSM_BOOT_UART_DM_RX_STALE_TIMEOUT (2 << 10)
/* UART Receive FIFO Registers - 4 in numbers */
#if PERIPH_BLK_BLSP

View file

@ -113,6 +113,15 @@ msm_boot_uart_dm_read(unsigned int *data, int *count, int wait,
/* Check for DM_RXSTALE for RX transfer to finish */
while (!(status_reg & MSM_BOOT_UART_DM_RXSTALE)) {
status_reg = readl(MSM_BOOT_UART_DM_SR(base));
if((status_reg & MSM_BOOT_UART_DM_RX_STALE_TIMEOUT) && \
(status_reg & MSM_BOOT_UART_DM_SR_RXFULL)) {
printf("Console buffer overflow occured!!");
msm_boot_uart_dm_init_rx_transfer(base);
total_rx_data = rx_data_read = 0;
return MSM_BOOT_UART_DM_E_RX_NOT_READY;
}
status_reg = readl(MSM_BOOT_UART_DM_MISR(base));
if (!wait)
return MSM_BOOT_UART_DM_E_RX_NOT_READY;