]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sh: SCBRR calculation fixes for early printk()
authorPaul Mundt <paul.mundt@nokia.com>
Mon, 18 Oct 2004 15:59:19 +0000 (08:59 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 18 Oct 2004 15:59:19 +0000 (08:59 -0700)
The early printk() code was using a fixed PCLK value that was only sane in the
SH7750 case.  This updates the SCBRR value calculation to use
CONFIG_SH_PCLK_FREQ instead and thus works on other subtypes as well (tested
on SH4-202).

Signed-off-by: Paul Mundt <paul.mundt@nokia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/sh/kernel/early_printk.c

index 8c2769c0d9ff63d59fbd5c576033bd8fda4f117d..1378db375e175c9905f583382ab02bacbec9d54d 100644 (file)
@@ -3,6 +3,7 @@
  *
  *  Copyright (C) 1999, 2000  Niibe Yutaka
  *  Copyright (C) 2002  M. R. Brown
+ *  Copyright (C) 2004  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -109,7 +110,8 @@ void scif_sercon_init(int baud)
        ctrl_outw(0, SCIF_REG);
 
        /* Set baud rate */
-       ctrl_outb((50000000 / (32 * baud)) - 1, SCIF_REG + 4);
+       ctrl_outb((CONFIG_SH_PCLK_FREQ + 16 * baud) /
+                 (32 * baud) - 1, SCIF_REG + 4);
 
        ctrl_outw(12, SCIF_REG + 24);
        ctrl_outw(8, SCIF_REG + 24);