diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-11-23 01:57:25 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-08 22:49:54 -0500 |
commit | 51d3082fe6e55aecfa17113dbe98077c749f724c (patch) | |
tree | 9a1e2355d5988d8cc1ca511d53c1bb24b0baa17f /arch/powerpc/platforms/powermac/setup.c | |
parent | 463ce0e103f419f51b1769111e73fe8bb305d0ec (diff) |
[PATCH] powerpc: Unify udbg (#2)
This patch unifies udbg for both ppc32 and ppc64 when building the
merged achitecture. xmon now has a single "back end". The powermac udbg
stuff gets enriched with some ADB capabilities and btext output. In
addition, the early_init callback is now called on ppc32 as well,
approx. in the same order as ppc64 regarding device-tree manipulations.
The init sequences of ppc32 and ppc64 are getting closer, I'll unify
them in a later patch.
For now, you can force udbg to the scc using "sccdbg" or to btext using
"btextdbg" on powermacs. I'll implement a cleaner way of forcing udbg
output to something else than the autodetected OF output device in a
later patch.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac/setup.c')
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 3b7a492d9b68..6ee620fe5195 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -77,6 +77,7 @@ | |||
77 | #include <asm/pmc.h> | 77 | #include <asm/pmc.h> |
78 | #include <asm/mpic.h> | 78 | #include <asm/mpic.h> |
79 | #include <asm/lmb.h> | 79 | #include <asm/lmb.h> |
80 | #include <asm/udbg.h> | ||
80 | 81 | ||
81 | #include "pmac.h" | 82 | #include "pmac.h" |
82 | 83 | ||
@@ -322,16 +323,6 @@ void __init pmac_setup_arch(void) | |||
322 | l2cr_init(); | 323 | l2cr_init(); |
323 | #endif /* CONFIG_PPC32 */ | 324 | #endif /* CONFIG_PPC32 */ |
324 | 325 | ||
325 | #ifdef CONFIG_PPC64 | ||
326 | /* Probe motherboard chipset */ | ||
327 | /* this is done earlier in setup_arch for 32-bit */ | ||
328 | pmac_feature_init(); | ||
329 | |||
330 | /* We can NAP */ | ||
331 | powersave_nap = 1; | ||
332 | printk(KERN_INFO "Using native/NAP idle loop\n"); | ||
333 | #endif | ||
334 | |||
335 | #ifdef CONFIG_KGDB | 326 | #ifdef CONFIG_KGDB |
336 | zs_kgdb_hook(0); | 327 | zs_kgdb_hook(0); |
337 | #endif | 328 | #endif |
@@ -622,13 +613,26 @@ static void __init pmac_init_early(void) | |||
622 | * and call ioremap | 613 | * and call ioremap |
623 | */ | 614 | */ |
624 | hpte_init_native(); | 615 | hpte_init_native(); |
616 | #endif | ||
625 | 617 | ||
626 | /* Init SCC */ | 618 | /* Enable early btext debug if requested */ |
627 | if (strstr(cmd_line, "sccdbg")) { | 619 | if (strstr(cmd_line, "btextdbg")) { |
628 | sccdbg = 1; | 620 | udbg_adb_init_early(); |
629 | udbg_init_scc(NULL); | 621 | register_early_udbg_console(); |
630 | } | 622 | } |
631 | 623 | ||
624 | /* Probe motherboard chipset */ | ||
625 | pmac_feature_init(); | ||
626 | |||
627 | /* We can NAP */ | ||
628 | powersave_nap = 1; | ||
629 | printk(KERN_INFO "Using native/NAP idle loop\n"); | ||
630 | |||
631 | /* Initialize debug stuff */ | ||
632 | udbg_scc_init(!!strstr(cmd_line, "sccdbg")); | ||
633 | udbg_adb_init(!!strstr(cmd_line, "btextdbg")); | ||
634 | |||
635 | #ifdef CONFIG_PPC64 | ||
632 | /* Setup interrupt mapping options */ | 636 | /* Setup interrupt mapping options */ |
633 | ppc64_interrupt_controller = IC_OPEN_PIC; | 637 | ppc64_interrupt_controller = IC_OPEN_PIC; |
634 | 638 | ||
@@ -638,19 +642,8 @@ static void __init pmac_init_early(void) | |||
638 | 642 | ||
639 | static void __init pmac_progress(char *s, unsigned short hex) | 643 | static void __init pmac_progress(char *s, unsigned short hex) |
640 | { | 644 | { |
641 | #ifdef CONFIG_PPC64 | 645 | udbg_puts(s); |
642 | if (sccdbg) { | 646 | udbg_puts("\n"); |
643 | udbg_puts(s); | ||
644 | udbg_puts("\n"); | ||
645 | return; | ||
646 | } | ||
647 | #endif | ||
648 | #ifdef CONFIG_BOOTX_TEXT | ||
649 | if (boot_text_mapped) { | ||
650 | btext_drawstring(s); | ||
651 | btext_drawchar('\n'); | ||
652 | } | ||
653 | #endif /* CONFIG_BOOTX_TEXT */ | ||
654 | } | 647 | } |
655 | 648 | ||
656 | /* | 649 | /* |
@@ -735,7 +728,8 @@ static int __init pmac_probe(int platform) | |||
735 | } | 728 | } |
736 | 729 | ||
737 | #ifdef CONFIG_PPC64 | 730 | #ifdef CONFIG_PPC64 |
738 | static int pmac_probe_mode(struct pci_bus *bus) | 731 | /* Move that to pci.c */ |
732 | static int pmac_pci_probe_mode(struct pci_bus *bus) | ||
739 | { | 733 | { |
740 | struct device_node *node = bus->sysdata; | 734 | struct device_node *node = bus->sysdata; |
741 | 735 | ||
@@ -771,7 +765,7 @@ struct machdep_calls __initdata pmac_md = { | |||
771 | .check_legacy_ioport = pmac_check_legacy_ioport, | 765 | .check_legacy_ioport = pmac_check_legacy_ioport, |
772 | .progress = pmac_progress, | 766 | .progress = pmac_progress, |
773 | #ifdef CONFIG_PPC64 | 767 | #ifdef CONFIG_PPC64 |
774 | .pci_probe_mode = pmac_probe_mode, | 768 | .pci_probe_mode = pmac_pci_probe_mode, |
775 | .idle_loop = native_idle, | 769 | .idle_loop = native_idle, |
776 | .enable_pmcs = power4_enable_pmcs, | 770 | .enable_pmcs = power4_enable_pmcs, |
777 | #ifdef CONFIG_KEXEC | 771 | #ifdef CONFIG_KEXEC |