aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/of_device.c
diff options
context:
space:
mode:
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 {