Skip to content

Commit 7be047e

Browse files
masahir0ygregkh
authored andcommitted
serial: 8250_uniphier: fix dl_read and dl_write functions
The register offset must be shifted by regshift, otherwise the baudrate is not set. I missed the issue probably because the divisor register was already set by the boot loader. Fixes: 1a8d290 ("serial: 8250_uniphier: add UniPhier serial driver") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 527e931 commit 7be047e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/tty/serial/8250/8250_uniphier.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,16 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value)
115115
*/
116116
static int uniphier_serial_dl_read(struct uart_8250_port *up)
117117
{
118-
return readl(up->port.membase + UNIPHIER_UART_DLR);
118+
int offset = UNIPHIER_UART_DLR << up->port.regshift;
119+
120+
return readl(up->port.membase + offset);
119121
}
120122

121123
static void uniphier_serial_dl_write(struct uart_8250_port *up, int value)
122124
{
123-
writel(value, up->port.membase + UNIPHIER_UART_DLR);
125+
int offset = UNIPHIER_UART_DLR << up->port.regshift;
126+
127+
writel(value, up->port.membase + offset);
124128
}
125129

126130
static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port,

0 commit comments

Comments
 (0)