Skip to content

Commit

Permalink
drivers: serial: sifive: fix configuration of rxcnt/txcnt
Browse files Browse the repository at this point in the history
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 29, 2019
1 parent 3085ce0 commit 52a4e4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/serial/uart_sifive.c
Expand Up @@ -332,8 +332,8 @@ static int uart_sifive_init(struct device *dev)
volatile struct uart_sifive_regs_t *uart = DEV_UART(dev); volatile struct uart_sifive_regs_t *uart = DEV_UART(dev);


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


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

0 comments on commit 52a4e4d

Please sign in to comment.