Skip to content

Commit 6f81fdd

Browse files
AngeloGioacchino Del Regnogregkh
authored andcommitted
serial: 8250_mtk: Make sure to select the right FEATURE_SEL
Set the FEATURE_SEL at probe time to make sure that BIT(0) is enabled: this guarantees that when the port is configured as AP UART, the right register layout is interpreted by the UART IP. Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bb0b197 commit 6f81fdd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/tty/serial/8250/8250_mtk.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
#define MTK_UART_TX_TRIGGER 1
5555
#define MTK_UART_RX_TRIGGER MTK_UART_RX_SIZE
5656

57+
#define MTK_UART_FEATURE_SEL 39 /* Feature Selection register */
58+
#define MTK_UART_FEAT_NEWRMAP BIT(0) /* Use new register map */
59+
5760
#ifdef CONFIG_SERIAL_8250_DMA
5861
enum dma_rx_status {
5962
DMA_RX_START = 0,
@@ -569,6 +572,10 @@ static int mtk8250_probe(struct platform_device *pdev)
569572
uart.dma = data->dma;
570573
#endif
571574

575+
/* Set AP UART new register map */
576+
writel(MTK_UART_FEAT_NEWRMAP, uart.port.membase +
577+
(MTK_UART_FEATURE_SEL << uart.port.regshift));
578+
572579
/* Disable Rate Fix function */
573580
writel(0x0, uart.port.membase +
574581
(MTK_UART_RATE_FIX << uart.port.regshift));

0 commit comments

Comments
 (0)