[POWERPC] Fix default clock for udbg_16550
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 4 Jul 2006 04:11:23 +0000 (14:11 +1000)
committerPaul Mackerras <paulus@samba.org>
Fri, 7 Jul 2006 10:19:15 +0000 (20:19 +1000)
This patch makes it possible to provide 0 as the clock value for
udbg_16550, making it default to the standard 1.8432Mhz clock

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/udbg_16550.c

index 0835b4841dea41d8157fde5a7faa37f68a7aab12..2d17f2b8eda73323444208ed4744c0f04104e6e8 100644 (file)
@@ -81,10 +81,14 @@ static int udbg_550_getc(void)
 void udbg_init_uart(void __iomem *comport, unsigned int speed,
                    unsigned int clock)
 {
-       unsigned int dll, base_bauds = clock / 16;
+       unsigned int dll, base_bauds;
 
+       if (clock == 0)
+               clock = 1843200;
        if (speed == 0)
                speed = 9600;
+
+       base_bauds = clock / 16;
        dll = base_bauds / speed;
 
        if (comport) {