diff options
Diffstat (limited to 'src/lib/uart8250.c')
-rw-r--r-- | src/lib/uart8250.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/uart8250.c b/src/lib/uart8250.c index ceb4e4aa86..67b0a95cfb 100644 --- a/src/lib/uart8250.c +++ b/src/lib/uart8250.c @@ -58,3 +58,19 @@ void uart8250_init(unsigned base_port, unsigned divisor, unsigned lcs) outb((divisor >> 8) & 0xFF, base_port + UART_DLM); outb(lcs, base_port + UART_LCR); } + +/* Initialize a generic uart */ +void init_uart8250(unsigned base_port, struct uart8250 *uart) +{ + int divisor; + int lcs; + divisor = 115200/(uart->baud ? uart->baud: 1); + lcs = 3; + if (base_port == TTYS0_BASE) { + /* Don't reinitialize the console serial port, + * This is espeically nasty in SMP. + */ + return; + } + uart8250_init(base_port, divisor, lcs); +} |