Skip to content

Commit b0ad20a

Browse files
committed
serial: 8250_dw: Add StarFive JH7100 quirk
On the StarFive JH7100 RISC-V SoC the UART core clocks can't be set to exactly 16 * 115200Hz and many other common bitrates. Trying this will only result in a higher input clock, but low enough that the UART's internal divisor can't come close enough to the baud rate target. So rather than try to set the input clock it's better to skip the clk_set_rate call and rely solely on the UART's internal divisor. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
1 parent d0b65b1 commit b0ad20a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/tty/serial/8250/8250_dw.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
414414

415415
if (of_device_is_compatible(np, "marvell,armada-38x-uart"))
416416
p->serial_out = dw8250_serial_out38x;
417+
if (of_device_is_compatible(np, "starfive,jh7100-uart"))
418+
p->set_termios = dw8250_do_set_termios;
417419

418420
} else if (acpi_dev_present("APMC0D08", NULL, -1)) {
419421
p->iotype = UPIO_MEM32;
@@ -696,6 +698,7 @@ static const struct of_device_id dw8250_of_match[] = {
696698
{ .compatible = "cavium,octeon-3860-uart" },
697699
{ .compatible = "marvell,armada-38x-uart" },
698700
{ .compatible = "renesas,rzn1-uart" },
701+
{ .compatible = "starfive,jh7100-uart" },
699702
{ /* Sentinel */ }
700703
};
701704
MODULE_DEVICE_TABLE(of, dw8250_of_match);

0 commit comments

Comments
 (0)