Skip to content
Permalink
Browse files

drivers: serial: sifive: fix configuration of rxcnt/txcnt

The values were swapped meaning the configured value for rxcnt was used
for txcnt and vice versa.

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
  • Loading branch information...
nmeum authored and nashif committed May 23, 2019
1 parent 3085ce0 commit 52a4e4d8408eee04e0d4b3af48a88e9203a664dd
Showing with 2 additions and 2 deletions.
  1. +2 −2 drivers/serial/uart_sifive.c
@@ -332,8 +332,8 @@ static int uart_sifive_init(struct device *dev)
volatile struct uart_sifive_regs_t *uart = DEV_UART(dev);

/* Enable TX and RX channels */
uart->txctrl = TXCTRL_TXEN | CTRL_CNT(cfg->rxcnt_irq);
uart->rxctrl = RXCTRL_RXEN | CTRL_CNT(cfg->txcnt_irq);
uart->txctrl = TXCTRL_TXEN | CTRL_CNT(cfg->txcnt_irq);
uart->rxctrl = RXCTRL_RXEN | CTRL_CNT(cfg->rxcnt_irq);

/* Set baud rate */
uart->div = cfg->sys_clk_freq / cfg->baud_rate - 1;

0 comments on commit 52a4e4d

Please sign in to comment.
You can’t perform that action at this time.