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/feature.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/feature.c')
-rw-r--r-- | arch/powerpc/platforms/powermac/feature.c | 68 |
1 files changed, 43 insertions, 25 deletions
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index f6e22da2a5da..52a9d0c1b8b8 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -2607,6 +2607,8 @@ found: | |||
2607 | */ | 2607 | */ |
2608 | static void __init probe_uninorth(void) | 2608 | static void __init probe_uninorth(void) |
2609 | { | 2609 | { |
2610 | u32 *addrp; | ||
2611 | phys_addr_t address; | ||
2610 | unsigned long actrl; | 2612 | unsigned long actrl; |
2611 | 2613 | ||
2612 | /* Locate core99 Uni-N */ | 2614 | /* Locate core99 Uni-N */ |
@@ -2616,20 +2618,23 @@ static void __init probe_uninorth(void) | |||
2616 | uninorth_node = of_find_node_by_name(NULL, "u3"); | 2618 | uninorth_node = of_find_node_by_name(NULL, "u3"); |
2617 | uninorth_u3 = 1; | 2619 | uninorth_u3 = 1; |
2618 | } | 2620 | } |
2619 | if (uninorth_node && uninorth_node->n_addrs > 0) { | 2621 | if (uninorth_node == NULL) |
2620 | unsigned long address = uninorth_node->addrs[0].address; | ||
2621 | uninorth_base = ioremap(address, 0x40000); | ||
2622 | uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); | ||
2623 | if (uninorth_u3) | ||
2624 | u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); | ||
2625 | } else | ||
2626 | uninorth_node = NULL; | ||
2627 | |||
2628 | if (!uninorth_node) | ||
2629 | return; | 2622 | return; |
2630 | 2623 | ||
2631 | printk(KERN_INFO "Found %s memory controller & host bridge, revision: %d\n", | 2624 | addrp = (u32 *)get_property(uninorth_node, "reg", NULL); |
2632 | uninorth_u3 ? "U3" : "UniNorth", uninorth_rev); | 2625 | if (addrp == NULL) |
2626 | return; | ||
2627 | address = of_translate_address(uninorth_node, addrp); | ||
2628 | if (address == 0) | ||
2629 | return; | ||
2630 | uninorth_base = ioremap(address, 0x40000); | ||
2631 | uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); | ||
2632 | if (uninorth_u3) | ||
2633 | u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); | ||
2634 | |||
2635 | printk(KERN_INFO "Found %s memory controller & host bridge," | ||
2636 | " revision: %d\n", uninorth_u3 ? "U3" : "UniNorth", | ||
2637 | uninorth_rev); | ||
2633 | printk(KERN_INFO "Mapped at 0x%08lx\n", (unsigned long)uninorth_base); | 2638 | printk(KERN_INFO "Mapped at 0x%08lx\n", (unsigned long)uninorth_base); |
2634 | 2639 | ||
2635 | /* Set the arbitrer QAck delay according to what Apple does | 2640 | /* Set the arbitrer QAck delay according to what Apple does |
@@ -2653,18 +2658,17 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2653 | { | 2658 | { |
2654 | struct device_node* node; | 2659 | struct device_node* node; |
2655 | int i; | 2660 | int i; |
2656 | volatile u32 __iomem * base; | 2661 | volatile u32 __iomem *base; |
2657 | u32* revp; | 2662 | u32 *addrp, *revp; |
2663 | phys_addr_t addr; | ||
2664 | u64 size; | ||
2658 | 2665 | ||
2659 | node = find_devices(name); | 2666 | for (node = NULL; (node = of_find_node_by_name(node, name)) != NULL;) { |
2660 | if (!node || !node->n_addrs) | 2667 | if (!compat) |
2661 | return; | 2668 | break; |
2662 | if (compat) | 2669 | if (device_is_compatible(node, compat)) |
2663 | do { | 2670 | break; |
2664 | if (device_is_compatible(node, compat)) | 2671 | } |
2665 | break; | ||
2666 | node = node->next; | ||
2667 | } while (node); | ||
2668 | if (!node) | 2672 | if (!node) |
2669 | return; | 2673 | return; |
2670 | for(i=0; i<MAX_MACIO_CHIPS; i++) { | 2674 | for(i=0; i<MAX_MACIO_CHIPS; i++) { |
@@ -2673,14 +2677,28 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2673 | if (macio_chips[i].of_node == node) | 2677 | if (macio_chips[i].of_node == node) |
2674 | return; | 2678 | return; |
2675 | } | 2679 | } |
2680 | |||
2676 | if (i >= MAX_MACIO_CHIPS) { | 2681 | if (i >= MAX_MACIO_CHIPS) { |
2677 | printk(KERN_ERR "pmac_feature: Please increase MAX_MACIO_CHIPS !\n"); | 2682 | printk(KERN_ERR "pmac_feature: Please increase MAX_MACIO_CHIPS !\n"); |
2678 | printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name); | 2683 | printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name); |
2679 | return; | 2684 | return; |
2680 | } | 2685 | } |
2681 | base = ioremap(node->addrs[0].address, node->addrs[0].size); | 2686 | addrp = of_get_pci_address(node, 0, &size); |
2687 | if (addrp == NULL) { | ||
2688 | printk(KERN_ERR "pmac_feature: %s: can't find base !\n", | ||
2689 | node->full_name); | ||
2690 | return; | ||
2691 | } | ||
2692 | addr = of_translate_address(node, addrp); | ||
2693 | if (addr == 0) { | ||
2694 | printk(KERN_ERR "pmac_feature: %s, can't translate base !\n", | ||
2695 | node->full_name); | ||
2696 | return; | ||
2697 | } | ||
2698 | base = ioremap(addr, (unsigned long)size); | ||
2682 | if (!base) { | 2699 | if (!base) { |
2683 | printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n"); | 2700 | printk(KERN_ERR "pmac_feature: %s, can't map mac-io chip !\n", |
2701 | node->full_name); | ||
2684 | return; | 2702 | return; |
2685 | } | 2703 | } |
2686 | if (type == macio_keylargo) { | 2704 | if (type == macio_keylargo) { |