MCPcopy Create free account
hub / github.com/coreboot/coreboot / sifive_uart_init

Function sifive_uart_init

src/drivers/uart/sifive.c:36–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#define IP_RXWM BIT(1)
35
36static void sifive_uart_init(struct sifive_uart_registers *regs, int div)
37{
38 /* Configure the divisor */
39 write32(&regs->div, div);
40
41 /* Enable transmission, one stop bit, transmit watermark at 1 */
42 write32(&regs->txctrl, TXCTRL_TXEN|TXCTRL_NSTOP(1)|TXCTRL_TXCNT(1));
43
44 /* Enable reception, receive watermark at 0 */
45 write32(&regs->rxctrl, RXCTRL_RXEN|RXCTRL_RXCNT(0));
46}
47
48void uart_init(unsigned int idx)
49{

Callers 1

uart_initFunction · 0.85

Calls 1

write32Function · 0.50

Tested by

no test coverage detected