Skip to contentSkip to conversation

powerpc: Fix default clock for udbg_16550

PATCH New Benjamin Herrenschmidt 1 participant 1 message Jul 4, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix default clock for udbg_16550

This patch makes it possible to provide 0 as the clock value for udbg_16550, making it default to the standard 1.8432Mhz clock

arch/powerpc/kernel/udbg_16550.c +5 -1
Index: linux-irq-work/arch/powerpc/kernel/udbg_16550.c
===================================================================
@@ -81,10 +81,14 @@
 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) {