diff options
author | Mark A. Greer <mgreer@mvista.com> | 2007-06-06 20:38:00 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-06-25 03:02:09 -0400 |
commit | 542c98c06712fdbbbfe6b9e92a8d0023cf45102a (patch) | |
tree | f87ea85550270e0c8bb1dea1d32cabd0a061c1da /arch/powerpc/sysdev/mv64x60_dev.c | |
parent | e3855fa5540617877907ca61c36d28e18d0f2473 (diff) |
[POWERPC] Call add_preferred_console when MPSC is console
When a Marvell MPSC (serial controller) port is the specified
/chosen/stdout-path device, call 'add_preferred_console()' so the user
doesn't have to specify a 'console=ttyMMx' cmdline argument.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev/mv64x60_dev.c')
-rw-r--r-- | arch/powerpc/sysdev/mv64x60_dev.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c index 4b0a9c88eeb3..b618fa60aef3 100644 --- a/arch/powerpc/sysdev/mv64x60_dev.c +++ b/arch/powerpc/sysdev/mv64x60_dev.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/stddef.h> | 12 | #include <linux/stddef.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/console.h> | ||
15 | #include <linux/mv643xx.h> | 16 | #include <linux/mv643xx.h> |
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | 18 | ||
@@ -420,3 +421,30 @@ error: | |||
420 | return err; | 421 | return err; |
421 | } | 422 | } |
422 | arch_initcall(mv64x60_device_setup); | 423 | arch_initcall(mv64x60_device_setup); |
424 | |||
425 | static int __init mv64x60_add_mpsc_console(void) | ||
426 | { | ||
427 | struct device_node *np = NULL; | ||
428 | const char *prop; | ||
429 | |||
430 | prop = of_get_property(of_chosen, "linux,stdout-path", NULL); | ||
431 | if (prop == NULL) | ||
432 | goto not_mpsc; | ||
433 | |||
434 | np = of_find_node_by_path(prop); | ||
435 | if (!np) | ||
436 | goto not_mpsc; | ||
437 | |||
438 | if (!of_device_is_compatible(np, "marvell,mpsc")) | ||
439 | goto not_mpsc; | ||
440 | |||
441 | prop = of_get_property(np, "block-index", NULL); | ||
442 | if (!prop) | ||
443 | goto not_mpsc; | ||
444 | |||
445 | add_preferred_console("ttyMM", *(int *)prop, NULL); | ||
446 | |||
447 | not_mpsc: | ||
448 | return 0; | ||
449 | } | ||
450 | console_initcall(mv64x60_add_mpsc_console); | ||