LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix default clock for udbg_16550
@ 2006-07-04  4:11 Benjamin Herrenschmidt
  0 siblings, 0 replies; only message in thread
From: Benjamin Herrenschmidt @ 2006-07-04  4:11 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

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>

Index: linux-irq-work/arch/powerpc/kernel/udbg_16550.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/kernel/udbg_16550.c	2006-07-04 13:01:13.000000000 +1000
+++ linux-irq-work/arch/powerpc/kernel/udbg_16550.c	2006-07-04 13:05:59.000000000 +1000
@@ -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) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-04  4:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-04  4:11 [PATCH] powerpc: Fix default clock for udbg_16550 Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox