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

Function uart8250_mem_init

src/drivers/uart/uart8250mem.c:80–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static void uart8250_mem_init(void *base, unsigned int divisor)
81{
82 /* Disable interrupts */
83 uart8250_write(base, UART8250_IER, 0x0);
84 /* Enable FIFOs */
85 uart8250_write(base, UART8250_FCR, UART8250_FCR_FIFO_EN);
86
87 /* Assert DTR and RTS so the other end is happy */
88 uart8250_write(base, UART8250_MCR, UART8250_MCR_DTR | UART8250_MCR_RTS);
89
90 /* DLAB on */
91 uart8250_write(base, UART8250_LCR, UART8250_LCR_DLAB | CONFIG_TTYS0_LCS);
92
93 uart8250_write(base, UART8250_DLL, divisor & 0xFF);
94 uart8250_write(base, UART8250_DLM, (divisor >> 8) & 0xFF);
95
96 /* Set to 3 for 8N1 */
97 uart8250_write(base, UART8250_LCR, CONFIG_TTYS0_LCS);
98}
99
100void uart_init(unsigned int idx)
101{

Callers 1

uart_initFunction · 0.85

Calls 1

uart8250_writeFunction · 0.85

Tested by

no test coverage detected