aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/via-cuda.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-23 01:57:25 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 22:49:54 -0500
commit51d3082fe6e55aecfa17113dbe98077c749f724c (patch)
tree9a1e2355d5988d8cc1ca511d53c1bb24b0baa17f /drivers/macintosh/via-cuda.c
parent463ce0e103f419f51b1769111e73fe8bb305d0ec (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 'drivers/macintosh/via-cuda.c')
-rw-r--r--drivers/macintosh/via-cuda.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index d843a6c9c6df..18ff770ea668 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -127,39 +127,34 @@ struct adb_driver via_cuda_driver = {
127#endif /* CONFIG_ADB */ 127#endif /* CONFIG_ADB */
128 128
129#ifdef CONFIG_PPC 129#ifdef CONFIG_PPC
130int __init 130int __init find_via_cuda(void)
131find_via_cuda(void)
132{ 131{
133 int err;
134 struct adb_request req; 132 struct adb_request req;
133 phys_addr_t taddr;
134 u32 *reg;
135 int err;
135 136
136 if (vias != 0) 137 if (vias != 0)
137 return 1; 138 return 1;
138 vias = find_devices("via-cuda"); 139 vias = of_find_node_by_name(NULL, "via-cuda");
139 if (vias == 0) 140 if (vias == 0)
140 return 0; 141 return 0;
141 if (vias->next != 0)
142 printk(KERN_WARNING "Warning: only using 1st via-cuda\n");
143
144#if 0
145 { int i;
146
147 printk("find_via_cuda: node = %p, addrs =", vias->node);
148 for (i = 0; i < vias->n_addrs; ++i)
149 printk(" %x(%x)", vias->addrs[i].address, vias->addrs[i].size);
150 printk(", intrs =");
151 for (i = 0; i < vias->n_intrs; ++i)
152 printk(" %x", vias->intrs[i].line);
153 printk("\n"); }
154#endif
155 142
156 if (vias->n_addrs != 1 || vias->n_intrs != 1) { 143 reg = (u32 *)get_property(vias, "reg", NULL);
157 printk(KERN_ERR "via-cuda: expecting 1 address (%d) and 1 interrupt (%d)\n", 144 if (reg == NULL) {
158 vias->n_addrs, vias->n_intrs); 145 printk(KERN_ERR "via-cuda: No \"reg\" property !\n");
159 if (vias->n_addrs < 1 || vias->n_intrs < 1) 146 goto fail;
160 return 0; 147 }
148 taddr = of_translate_address(vias, reg);
149 if (taddr == 0) {
150 printk(KERN_ERR "via-cuda: Can't translate address !\n");
151 goto fail;
152 }
153 via = ioremap(taddr, 0x2000);
154 if (via == NULL) {
155 printk(KERN_ERR "via-cuda: Can't map address !\n");
156 goto fail;
161 } 157 }
162 via = ioremap(vias->addrs->address, 0x2000);
163 158
164 cuda_state = idle; 159 cuda_state = idle;
165 sys_ctrler = SYS_CTRLER_CUDA; 160 sys_ctrler = SYS_CTRLER_CUDA;
@@ -185,6 +180,11 @@ find_via_cuda(void)
185 cuda_poll(); 180 cuda_poll();
186 181
187 return 1; 182 return 1;
183
184 fail:
185 of_node_put(vias);
186 vias = NULL;
187 return 0;
188} 188}
189#endif /* CONFIG_PPC */ 189#endif /* CONFIG_PPC */
190 190