diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-27 23:49:15 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-28 02:30:53 -0400 |
commit | 025d7917a5ede982a5669c6735ef73a227b9827e (patch) | |
tree | b921600f898523c63cefa79effdc4f917b1cf4ab /arch/powerpc/kernel/legacy_serial.c | |
parent | f023bf0f91f1f1b926ec8f5cf0ee24be134bf024 (diff) |
powerpc/powermac: Fixup default serial port device for pmac_zilog
This removes the non-working code in legacy_serial that tried to handle
the powermac SCC ports, and instead add a (now working) function to the
powermac platform code to find the default serial console if any.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/legacy_serial.c')
-rw-r--r-- | arch/powerpc/kernel/legacy_serial.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 4d96e1db55ee..9ddfaef1a184 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -493,18 +493,18 @@ static int __init serial_dev_init(void) | |||
493 | device_initcall(serial_dev_init); | 493 | device_initcall(serial_dev_init); |
494 | 494 | ||
495 | 495 | ||
496 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
496 | /* | 497 | /* |
497 | * This is called very early, as part of console_init() (typically just after | 498 | * This is called very early, as part of console_init() (typically just after |
498 | * time_init()). This function is respondible for trying to find a good | 499 | * time_init()). This function is respondible for trying to find a good |
499 | * default console on serial ports. It tries to match the open firmware | 500 | * default console on serial ports. It tries to match the open firmware |
500 | * default output with one of the available serial console drivers, either | 501 | * default output with one of the available serial console drivers that have |
501 | * one of the platform serial ports that have been probed earlier by | 502 | * been probed earlier by find_legacy_serial_ports() |
502 | * find_legacy_serial_ports() or some more platform specific ones. | ||
503 | */ | 503 | */ |
504 | static int __init check_legacy_serial_console(void) | 504 | static int __init check_legacy_serial_console(void) |
505 | { | 505 | { |
506 | struct device_node *prom_stdout = NULL; | 506 | struct device_node *prom_stdout = NULL; |
507 | int speed = 0, offset = 0; | 507 | int i, speed = 0, offset = 0; |
508 | const char *name; | 508 | const char *name; |
509 | const u32 *spd; | 509 | const u32 *spd; |
510 | 510 | ||
@@ -548,31 +548,20 @@ static int __init check_legacy_serial_console(void) | |||
548 | if (spd) | 548 | if (spd) |
549 | speed = *spd; | 549 | speed = *spd; |
550 | 550 | ||
551 | if (0) | 551 | if (strcmp(name, "serial") != 0) |
552 | ; | 552 | goto not_found; |
553 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 553 | |
554 | else if (strcmp(name, "serial") == 0) { | 554 | /* Look for it in probed array */ |
555 | int i; | 555 | for (i = 0; i < legacy_serial_count; i++) { |
556 | /* Look for it in probed array */ | 556 | if (prom_stdout != legacy_serial_infos[i].np) |
557 | for (i = 0; i < legacy_serial_count; i++) { | 557 | continue; |
558 | if (prom_stdout != legacy_serial_infos[i].np) | 558 | offset = i; |
559 | continue; | 559 | speed = legacy_serial_infos[i].speed; |
560 | offset = i; | 560 | break; |
561 | speed = legacy_serial_infos[i].speed; | ||
562 | break; | ||
563 | } | ||
564 | if (i >= legacy_serial_count) | ||
565 | goto not_found; | ||
566 | } | 561 | } |
567 | #endif /* CONFIG_SERIAL_8250_CONSOLE */ | 562 | if (i >= legacy_serial_count) |
568 | #ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE | ||
569 | else if (strcmp(name, "ch-a") == 0) | ||
570 | offset = 0; | ||
571 | else if (strcmp(name, "ch-b") == 0) | ||
572 | offset = 1; | ||
573 | #endif /* CONFIG_SERIAL_PMACZILOG_CONSOLE */ | ||
574 | else | ||
575 | goto not_found; | 563 | goto not_found; |
564 | |||
576 | of_node_put(prom_stdout); | 565 | of_node_put(prom_stdout); |
577 | 566 | ||
578 | DBG("Found serial console at ttyS%d\n", offset); | 567 | DBG("Found serial console at ttyS%d\n", offset); |
@@ -591,3 +580,4 @@ static int __init check_legacy_serial_console(void) | |||
591 | } | 580 | } |
592 | console_initcall(check_legacy_serial_console); | 581 | console_initcall(check_legacy_serial_console); |
593 | 582 | ||
583 | #endif /* CONFIG_SERIAL_8250_CONSOLE */ | ||