[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>
This commit is contained in:
Benjamin Herrenschmidt
2005-11-23 17:57:25 +11:00
committed by Paul Mackerras
parent 463ce0e103
commit 51d3082fe6
29 changed files with 627 additions and 720 deletions

View File

@@ -127,39 +127,34 @@ struct adb_driver via_cuda_driver = {
#endif /* CONFIG_ADB */
#ifdef CONFIG_PPC
int __init
find_via_cuda(void)
int __init find_via_cuda(void)
{
int err;
struct adb_request req;
phys_addr_t taddr;
u32 *reg;
int err;
if (vias != 0)
return 1;
vias = find_devices("via-cuda");
vias = of_find_node_by_name(NULL, "via-cuda");
if (vias == 0)
return 0;
if (vias->next != 0)
printk(KERN_WARNING "Warning: only using 1st via-cuda\n");
#if 0
{ int i;
printk("find_via_cuda: node = %p, addrs =", vias->node);
for (i = 0; i < vias->n_addrs; ++i)
printk(" %x(%x)", vias->addrs[i].address, vias->addrs[i].size);
printk(", intrs =");
for (i = 0; i < vias->n_intrs; ++i)
printk(" %x", vias->intrs[i].line);
printk("\n"); }
#endif
if (vias->n_addrs != 1 || vias->n_intrs != 1) {
printk(KERN_ERR "via-cuda: expecting 1 address (%d) and 1 interrupt (%d)\n",
vias->n_addrs, vias->n_intrs);
if (vias->n_addrs < 1 || vias->n_intrs < 1)
return 0;
reg = (u32 *)get_property(vias, "reg", NULL);
if (reg == NULL) {
printk(KERN_ERR "via-cuda: No \"reg\" property !\n");
goto fail;
}
taddr = of_translate_address(vias, reg);
if (taddr == 0) {
printk(KERN_ERR "via-cuda: Can't translate address !\n");
goto fail;
}
via = ioremap(taddr, 0x2000);
if (via == NULL) {
printk(KERN_ERR "via-cuda: Can't map address !\n");
goto fail;
}
via = ioremap(vias->addrs->address, 0x2000);
cuda_state = idle;
sys_ctrler = SYS_CTRLER_CUDA;
@@ -185,6 +180,11 @@ find_via_cuda(void)
cuda_poll();
return 1;
fail:
of_node_put(vias);
vias = NULL;
return 0;
}
#endif /* CONFIG_PPC */