Commit 7be047e0 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Greg Kroah-Hartman

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: 1a8d2903 ("serial: 8250_uniphier: add UniPhier serial driver")
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 527e9316
...@@ -115,12 +115,16 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value) ...@@ -115,12 +115,16 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value)
*/ */
static int uniphier_serial_dl_read(struct uart_8250_port *up) static int uniphier_serial_dl_read(struct uart_8250_port *up)
{ {
return readl(up->port.membase + UNIPHIER_UART_DLR); int offset = UNIPHIER_UART_DLR << up->port.regshift;
return readl(up->port.membase + offset);
} }
static void uniphier_serial_dl_write(struct uart_8250_port *up, int value) static void uniphier_serial_dl_write(struct uart_8250_port *up, int value)
{ {
writel(value, up->port.membase + UNIPHIER_UART_DLR); int offset = UNIPHIER_UART_DLR << up->port.regshift;
writel(value, up->port.membase + offset);
} }
static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port, static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment