diff options
author | Olaf Hering <olaf@aepfle.de> | 2007-03-31 11:08:23 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-12 13:55:17 -0400 |
commit | 9414715a7bbb45450015e9bc2676d85d919d08d4 (patch) | |
tree | 084dfaa3a591f17aa1debb0e3b33a31ed10b13ec /arch/powerpc/platforms/52xx | |
parent | 02cc51149f99e3c6c106e1e16dcc2e016b1bc3b5 (diff) |
[POWERPC] Autodetect serial console on efika
Efika boards have to be booted with console=ttyPSC0 unless there is a
graphics card plugged in. Detect if the firmware stdout is the serial
connector.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/52xx')
-rw-r--r-- | arch/powerpc/platforms/52xx/efika.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c index 8de034116681..31a2a8ca1de7 100644 --- a/arch/powerpc/platforms/52xx/efika.c +++ b/arch/powerpc/platforms/52xx/efika.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/initrd.h> | 21 | #include <linux/initrd.h> |
22 | #include <linux/timer.h> | 22 | #include <linux/timer.h> |
23 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
24 | #include <linux/console.h> | ||
24 | 25 | ||
25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
26 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
@@ -221,12 +222,37 @@ static int __init efika_probe(void) | |||
221 | return 1; | 222 | return 1; |
222 | } | 223 | } |
223 | 224 | ||
225 | static void __init efika_init_early(void) | ||
226 | { | ||
227 | #ifdef CONFIG_SERIAL_MPC52xx | ||
228 | struct device_node *stdout_node; | ||
229 | const char *device_type; | ||
230 | |||
231 | if (strstr(cmd_line, "console=")) | ||
232 | return; | ||
233 | /* find the boot console from /chosen/stdout */ | ||
234 | if (!of_chosen) | ||
235 | return; | ||
236 | device_type = get_property(of_chosen, "linux,stdout-path", NULL); | ||
237 | if (!device_type) | ||
238 | return; | ||
239 | stdout_node = of_find_node_by_path(device_type); | ||
240 | if (stdout_node) { | ||
241 | device_type = get_property(stdout_node, "device_type", NULL); | ||
242 | if (device_type && strcmp(device_type, "serial") == 0) | ||
243 | add_preferred_console("ttyPSC", 0, NULL); | ||
244 | of_node_put(stdout_node); | ||
245 | } | ||
246 | #endif | ||
247 | } | ||
248 | |||
224 | define_machine(efika) | 249 | define_machine(efika) |
225 | { | 250 | { |
226 | .name = EFIKA_PLATFORM_NAME, | 251 | .name = EFIKA_PLATFORM_NAME, |
227 | .probe = efika_probe, | 252 | .probe = efika_probe, |
228 | .setup_arch = efika_setup_arch, | 253 | .setup_arch = efika_setup_arch, |
229 | .init = mpc52xx_declare_of_platform_devices, | 254 | .init = mpc52xx_declare_of_platform_devices, |
255 | .init_early = efika_init_early, | ||
230 | .show_cpuinfo = efika_show_cpuinfo, | 256 | .show_cpuinfo = efika_show_cpuinfo, |
231 | .init_IRQ = mpc52xx_init_irq, | 257 | .init_IRQ = mpc52xx_init_irq, |
232 | .get_irq = mpc52xx_get_irq, | 258 | .get_irq = mpc52xx_get_irq, |