diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-06-08 00:59:44 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-06-08 00:59:44 -0400 |
commit | 8c2786cfa6d15c474ec7030e8161c88e9b5c597d (patch) | |
tree | 403d0c6a52361717a54d3dbaa15d6db87f3627e5 /arch/sparc64/kernel/of_device.c | |
parent | ea1ff19ce0146a3982a6ded4274122e6d0a91bed (diff) |
[SPARC64]: Handle PCI bridges without 'ranges' property.
This fixes the IDE controller not showing up on Netra-T1
systems.
Just like Simba bridges, some PCI bridges can lack the
'ranges' OBP property. So we handle this similarly to
the existing Simba code:
1) In of_device register address resolving, we push the
translation to the parent.
2) In PCI device scanning, we interrogate the PCI config
space registers of the PCI bus device in order to resolve
the resources, just like the generic Linux PCI probing
code does.
With much help and testing from Fabio, who also reported
the initial problem.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Fabio Massimo Di Nitto <fabbione@ubuntu.com>
Diffstat (limited to 'arch/sparc64/kernel/of_device.c')
-rw-r--r-- | arch/sparc64/kernel/of_device.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index 16cc46a71872..6676b93219dc 100644 --- a/arch/sparc64/kernel/of_device.c +++ b/arch/sparc64/kernel/of_device.c | |||
@@ -343,6 +343,15 @@ static int of_bus_simba_match(struct device_node *np) | |||
343 | 343 | ||
344 | if (model && !strcmp(model, "SUNW,simba")) | 344 | if (model && !strcmp(model, "SUNW,simba")) |
345 | return 1; | 345 | return 1; |
346 | |||
347 | /* Treat PCI busses lacking ranges property just like | ||
348 | * simba. | ||
349 | */ | ||
350 | if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) { | ||
351 | if (!of_find_property(np, "ranges", NULL)) | ||
352 | return 1; | ||
353 | } | ||
354 | |||
346 | return 0; | 355 | return 0; |
347 | } | 356 | } |
348 | 357 | ||
@@ -549,8 +558,6 @@ static int __init build_one_resource(struct device_node *parent, | |||
549 | 558 | ||
550 | static int __init use_1to1_mapping(struct device_node *pp) | 559 | static int __init use_1to1_mapping(struct device_node *pp) |
551 | { | 560 | { |
552 | const char *model; | ||
553 | |||
554 | /* If this is on the PMU bus, don't try to translate it even | 561 | /* If this is on the PMU bus, don't try to translate it even |
555 | * if a ranges property exists. | 562 | * if a ranges property exists. |
556 | */ | 563 | */ |
@@ -567,9 +574,11 @@ static int __init use_1to1_mapping(struct device_node *pp) | |||
567 | if (!strcmp(pp->name, "dma")) | 574 | if (!strcmp(pp->name, "dma")) |
568 | return 0; | 575 | return 0; |
569 | 576 | ||
570 | /* Similarly for Simba PCI bridges. */ | 577 | /* Similarly for all PCI bridges, if we get this far |
571 | model = of_get_property(pp, "model", NULL); | 578 | * it lacks a ranges property, and this will include |
572 | if (model && !strcmp(model, "SUNW,simba")) | 579 | * cases like Simba. |
580 | */ | ||
581 | if (!strcmp(pp->type, "pci") || !strcmp(pp->type, "pciex")) | ||
573 | return 0; | 582 | return 0; |
574 | 583 | ||
575 | return 1; | 584 | return 1; |