diff options
author | Jamie Lenehan <lenehan@twibble.org> | 2006-12-18 22:16:06 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-02-12 20:54:44 -0500 |
commit | 703404ea441fc198d03ca3e9edbac6e09b5415f4 (patch) | |
tree | 5af8761c302b7b794ec3db67a9b623cd55858fb2 /arch | |
parent | 106dac130d6fb6670a0bbfa8c714054990b41b03 (diff) |
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 <lenehan@twibble.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | 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 560b91cdd15c..9048c0326d87 100644 --- a/arch/sh/kernel/early_printk.c +++ b/arch/sh/kernel/early_printk.c | |||
@@ -106,12 +106,32 @@ static struct console scif_console = { | |||
106 | }; | 106 | }; |
107 | 107 | ||
108 | #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_STANDARD_BIOS) | 108 | #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_STANDARD_BIOS) |
109 | #define DEFAULT_BAUD 115200 | ||
109 | /* | 110 | /* |
110 | * Simple SCIF init, primarily aimed at SH7750 and other similar SH-4 | 111 | * Simple SCIF init, primarily aimed at SH7750 and other similar SH-4 |
111 | * devices that aren't using sh-ipl+g. | 112 | * devices that aren't using sh-ipl+g. |
112 | */ | 113 | */ |
113 | static void scif_sercon_init(int baud) | 114 | static void scif_sercon_init(char *s) |
114 | { | 115 | { |
116 | unsigned baud = DEFAULT_BAUD; | ||
117 | char *e; | ||
118 | |||
119 | if (*s == ',') | ||
120 | ++s; | ||
121 | |||
122 | if (*s) { | ||
123 | /* ignore ioport/device name */ | ||
124 | s += strcspn(s, ","); | ||
125 | if (*s == ',') | ||
126 | s++; | ||
127 | } | ||
128 | |||
129 | if (*s) { | ||
130 | baud = simple_strtoul(s, &e, 0); | ||
131 | if (baud == 0 || s == e) | ||
132 | baud = DEFAULT_BAUD; | ||
133 | } | ||
134 | |||
115 | ctrl_outw(0, scif_port.mapbase + 8); | 135 | ctrl_outw(0, scif_port.mapbase + 8); |
116 | ctrl_outw(0, scif_port.mapbase); | 136 | ctrl_outw(0, scif_port.mapbase); |
117 | 137 | ||
@@ -167,7 +187,7 @@ int __init setup_early_printk(char *buf) | |||
167 | early_console = &scif_console; | 187 | early_console = &scif_console; |
168 | 188 | ||
169 | #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_STANDARD_BIOS) | 189 | #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_STANDARD_BIOS) |
170 | scif_sercon_init(115200); | 190 | scif_sercon_init(buf + 6); |
171 | #endif | 191 | #endif |
172 | } | 192 | } |
173 | #endif | 193 | #endif |