Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=703404ea441fc198d03ca3e9edbac6e09b5415f4
Commit:     703404ea441fc198d03ca3e9edbac6e09b5415f4
Parent:     106dac130d6fb6670a0bbfa8c714054990b41b03
Author:     Jamie Lenehan <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 19 12:16:06 2006 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Tue Feb 13 10:54:44 2007 +0900

    sh: allow earlyprintk baud rate to be set via command line
    
    This allows the baud rate for earlyprintk for sh4 without the
    standard BIOS to be set via the command line. This uses the same
    format as i386 and x86_64, which is:
    
        earlyprintk=serial,ttySC1,38400
    
    The second parameter (ttySC1 above) is usually the console device
    name or the io address of the serial port. I allow that to be
    specified but ignore it in order to keep the format the same as
    i386/x86_64.
    
    Signed-off-by: Jamie Lenehan <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh/kernel/early_printk.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c
index 560b91c..9048c03 100644
--- a/arch/sh/kernel/early_printk.c
+++ b/arch/sh/kernel/early_printk.c
@@ -106,12 +106,32 @@ static struct console scif_console = {
 };
 
 #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_STANDARD_BIOS)
+#define DEFAULT_BAUD 115200
 /*
  * Simple SCIF init, primarily aimed at SH7750 and other similar SH-4
  * devices that aren't using sh-ipl+g.
  */
-static void scif_sercon_init(int baud)
+static void scif_sercon_init(char *s)
 {
+       unsigned baud = DEFAULT_BAUD;
+       char *e;
+
+       if (*s == ',')
+               ++s;
+
+       if (*s) {
+               /* ignore ioport/device name */
+               s += strcspn(s, ",");
+               if (*s == ',')
+                       s++;
+       }
+
+       if (*s) {
+               baud = simple_strtoul(s, &e, 0);
+               if (baud == 0 || s == e)
+                       baud = DEFAULT_BAUD;
+       }
+
        ctrl_outw(0, scif_port.mapbase + 8);
        ctrl_outw(0, scif_port.mapbase);
 
@@ -167,7 +187,7 @@ int __init setup_early_printk(char *buf)
                early_console = &scif_console;
 
 #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_STANDARD_BIOS)
-               scif_sercon_init(115200);
+               scif_sercon_init(buf + 6);
 #endif
        }
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to