aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/of_device.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-10-26 01:31:06 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-10-26 01:39:15 -0400
commit4130a4b206e7c628482aa12ec30949382c8cdc5e (patch)
treebae99205682ec6db943fc8271dddc980646254d8 /arch/sparc64/kernel/of_device.c
parent291b58d663862c3d42d2e8092f8b0dd3f15a94f8 (diff)
[SPARC64]: Fix central/FHC bus handling on Ex000 systems.
1) probe_other_fhcs() wants to see only non-central FHC busses, so skip FHCs that don't sit off the root 2) Like SBUS, FHC can lack the appropriate address and size cell count properties, so add an of_busses[] entry and handlers for that. 3) Central FHC irq translator probing was buggy. We were trying to use dp->child in irq_trans_init but that linkage is not setup at this point. So instead, pass in the parent of "dp" and look for the child "fhc" with parent "central". Thanks to the tireless assistence of Ben Collins in tracking down these problems and testing out these fixes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/of_device.c')
-rw-r--r--arch/sparc64/kernel/of_device.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index d3dfb2a36d47..983ca5f485cf 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -402,16 +402,22 @@ static void of_bus_sbus_count_cells(struct device_node *child,
402 *sizec = 1; 402 *sizec = 1;
403} 403}
404 404
405static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna) 405/*
406{ 406 * FHC/Central bus specific translator.
407 return of_bus_default_map(addr, range, na, ns, pna); 407 *
408} 408 * This is just needed to hard-code the address and size cell
409 409 * counts. 'fhc' and 'central' nodes lack the #address-cells and
410static unsigned int of_bus_sbus_get_flags(u32 *addr) 410 * #size-cells properties, and if you walk to the root on such
411 * Enterprise boxes all you'll get is a #size-cells of 2 which is
412 * not what we want to use.
413 */
414static int of_bus_fhc_match(struct device_node *np)
411{ 415{
412 return IORESOURCE_MEM; 416 return !strcmp(np->name, "fhc") ||
417 !strcmp(np->name, "central");
413} 418}
414 419
420#define of_bus_fhc_count_cells of_bus_sbus_count_cells
415 421
416/* 422/*
417 * Array of bus specific translators 423 * Array of bus specific translators
@@ -433,8 +439,17 @@ static struct of_bus of_busses[] = {
433 .addr_prop_name = "reg", 439 .addr_prop_name = "reg",
434 .match = of_bus_sbus_match, 440 .match = of_bus_sbus_match,
435 .count_cells = of_bus_sbus_count_cells, 441 .count_cells = of_bus_sbus_count_cells,
436 .map = of_bus_sbus_map, 442 .map = of_bus_default_map,
437 .get_flags = of_bus_sbus_get_flags, 443 .get_flags = of_bus_default_get_flags,
444 },
445 /* FHC */
446 {
447 .name = "fhc",
448 .addr_prop_name = "reg",
449 .match = of_bus_fhc_match,
450 .count_cells = of_bus_fhc_count_cells,
451 .map = of_bus_default_map,
452 .get_flags = of_bus_default_get_flags,
438 }, 453 },
439 /* Default */ 454 /* Default */
440 { 455 {