diff options
Diffstat (limited to 'arch/sparc64/kernel/of_device.c')
-rw-r--r-- | arch/sparc64/kernel/of_device.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index d3dfb2a36d47..8cc14fc6b6f1 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 | ||
405 | static 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 | |
410 | static 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 | */ | ||
414 | static 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 | { |
@@ -846,7 +861,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp, | |||
846 | if (!parent) | 861 | if (!parent) |
847 | strcpy(op->dev.bus_id, "root"); | 862 | strcpy(op->dev.bus_id, "root"); |
848 | else | 863 | else |
849 | sprintf(op->dev.bus_id, "%s@%08x", dp->name, dp->node); | 864 | sprintf(op->dev.bus_id, "%08x", dp->node); |
850 | 865 | ||
851 | if (of_device_register(op)) { | 866 | if (of_device_register(op)) { |
852 | printk("%s: Could not register of device.\n", | 867 | printk("%s: Could not register of device.\n", |