aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/celleb/pci.c
diff options
context:
space:
mode:
authorIshizaki Kou <kou.ishizaki@toshiba.co.jp>2008-04-24 05:24:13 -0400
committerPaul Mackerras <paulus@samba.org>2008-04-24 07:08:13 -0400
commit6ec859e1b21ab42bfc36bb3b51db275480165c8a (patch)
tree299d0729340598d795559084a11c2fdfc61ce199 /arch/powerpc/platforms/celleb/pci.c
parent7cfb62a2e820b6032c08835dbd996d8518af14a3 (diff)
[POWERPC] celleb: Consolidate io-workarounds code
Now, we can use generic io-workarounds mechanism and the workaround code for spider-pci. This changes Celleb PCI code to use spider-pci code. Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/celleb/pci.c')
-rw-r--r--arch/powerpc/platforms/celleb/pci.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index 51b390d34e4d..539d2cc59542 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -41,6 +41,7 @@
41#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
42#include <asm/ppc-pci.h> 42#include <asm/ppc-pci.h>
43 43
44#include "../cell/io-workarounds.h"
44#include "pci.h" 45#include "pci.h"
45#include "interrupt.h" 46#include "interrupt.h"
46 47
@@ -457,33 +458,39 @@ static int __init celleb_setup_fake_pci(struct device_node *dev,
457 return 0; 458 return 0;
458} 459}
459 460
460void __init fake_pci_workaround_init(struct pci_controller *phb) 461static struct celleb_phb_spec celleb_fake_pci_spec __initdata = {
461{ 462 .setup = celleb_setup_fake_pci,
462 /** 463};
463 * We will add fake pci bus to scc_pci_bus for the purpose to improve
464 * I/O Macro performance. But device-tree and device drivers
465 * are not ready to use address with a token.
466 */
467
468 /* celleb_pci_add_one(phb, NULL); */
469}
470 464
471static struct of_device_id celleb_phb_match[] __initdata = { 465static struct of_device_id celleb_phb_match[] __initdata = {
472 { 466 {
473 .name = "pci-pseudo", 467 .name = "pci-pseudo",
474 .data = celleb_setup_fake_pci, 468 .data = &celleb_fake_pci_spec,
475 }, { 469 }, {
476 .name = "epci", 470 .name = "epci",
477 .data = celleb_setup_epci, 471 .data = &celleb_epci_spec,
478 }, { 472 }, {
479 }, 473 },
480}; 474};
481 475
476static int __init celleb_io_workaround_init(struct pci_controller *phb,
477 struct celleb_phb_spec *phb_spec)
478{
479 if (phb_spec->ops) {
480 iowa_register_bus(phb, phb_spec->ops, phb_spec->iowa_init,
481 phb_spec->iowa_data);
482 io_workaround_init();
483 }
484
485 return 0;
486}
487
482int __init celleb_setup_phb(struct pci_controller *phb) 488int __init celleb_setup_phb(struct pci_controller *phb)
483{ 489{
484 struct device_node *dev = phb->dn; 490 struct device_node *dev = phb->dn;
485 const struct of_device_id *match; 491 const struct of_device_id *match;
486 int (*setup_func)(struct device_node *, struct pci_controller *); 492 struct celleb_phb_spec *phb_spec;
493 int rc;
487 494
488 match = of_match_node(celleb_phb_match, dev); 495 match = of_match_node(celleb_phb_match, dev);
489 if (!match) 496 if (!match)
@@ -492,8 +499,12 @@ int __init celleb_setup_phb(struct pci_controller *phb)
492 phb_set_bus_ranges(dev, phb); 499 phb_set_bus_ranges(dev, phb);
493 phb->buid = 1; 500 phb->buid = 1;
494 501
495 setup_func = match->data; 502 phb_spec = match->data;
496 return (*setup_func)(dev, phb); 503 rc = (*phb_spec->setup)(dev, phb);
504 if (rc)
505 return 1;
506
507 return celleb_io_workaround_init(phb, phb_spec);
497} 508}
498 509
499int celleb_pci_probe_mode(struct pci_bus *bus) 510int celleb_pci_probe_mode(struct pci_bus *bus)