diff options
Diffstat (limited to 'arch/sh/kernel/early_printk.c')
-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 |