linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][SSB] Read the UART divisor instead of setting it
@ 2007-08-09 23:09 Aurelien Jarno
  0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2007-08-09 23:09 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless

I finally have one more patch for the SSB bus driver. I have ported the
BCM947xx code to the CFE API that is already in the kernel, and I have
seen that when the chip common driver initializes the serial port, it
breaks the CFE console (used as an early console until the serial port
is initialized). This is due to the change of the UART clock in 
ssb_chipco_serial_init().

The patch below reads the current UART divisor value and use it to 
compute baud_base instead of forcing a fixed divisor value. This limits
the maximum speed of the serial port, but don't forget the SSB bus runs 
at around 100MHz. CFE initializes the divisor so that baud_base equals 
1.8432MHz, which is already fast for a serial port.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

--- a/drivers/ssb/driver_chipcommon.c
+++ b/drivers/ssb/driver_chipcommon.c
@@ -375,10 +375,8 @@
 		} else if (cc->dev->id.revision >= 3) {
 			/* Internal backplane clock */
 			baud_base = ssb_clockspeed(bus);
-			div = 2; /* Minimum divisor */
-			chipco_write32(cc, SSB_CHIPCO_CLKDIV,
-				       (chipco_read32(cc, SSB_CHIPCO_CLKDIV)
-					& ~SSB_CHIPCO_CLKDIV_UART) | div);
+			div = chipco_read32(cc, SSB_CHIPCO_CLKDIV) 
+			      & SSB_CHIPCO_CLKDIV_UART;
 		} else {
 			/* Fixed internal backplane clock */
 			baud_base = 88000000;

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

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

only message in thread, other threads:[~2007-08-09 23:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-09 23:09 [PATCH][SSB] Read the UART divisor instead of setting it Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).