- Moved hlt() to it's own header.
[coreboot.git] / src / lib / uart8250.c
index ceb4e4aa86d44002b5f955ebdec22aa50bebdd39..67b0a95cfb30f81a669a3733b3cce8fee5637f18 100644 (file)
@@ -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);
+}