diff options
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, |