Skip to content

Commit

Permalink
[POWERPC] celleb: Consolidate io-workarounds code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ishizaki Kou authored and Paul Mackerras committed Apr 24, 2008
1 parent 7cfb62a commit 6ec859e
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 357 deletions.
6 changes: 6 additions & 0 deletions arch/powerpc/platforms/cell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \
spufs/

obj-$(CONFIG_PCI_MSI) += axon_msi.o


# celleb stuff
ifeq ($(CONFIG_PPC_CELLEB),y)
obj-y += io-workarounds.o spider-pci.o
endif
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/celleb/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
obj-y += interrupt.o iommu.o setup.o \
htab.o beat.o hvCall.o pci.o \
scc_epci.o scc_uhc.o \
io-workarounds.o
scc_epci.o scc_uhc.o

obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_PPC_UDBG_BEAT) += udbg_beat.o
Expand Down
280 changes: 0 additions & 280 deletions arch/powerpc/platforms/celleb/io-workarounds.c

This file was deleted.

41 changes: 26 additions & 15 deletions arch/powerpc/platforms/celleb/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <asm/pci-bridge.h>
#include <asm/ppc-pci.h>

#include "../cell/io-workarounds.h"
#include "pci.h"
#include "interrupt.h"

Expand Down Expand Up @@ -457,33 +458,39 @@ static int __init celleb_setup_fake_pci(struct device_node *dev,
return 0;
}

void __init fake_pci_workaround_init(struct pci_controller *phb)
{
/**
* We will add fake pci bus to scc_pci_bus for the purpose to improve
* I/O Macro performance. But device-tree and device drivers
* are not ready to use address with a token.
*/

/* celleb_pci_add_one(phb, NULL); */
}
static struct celleb_phb_spec celleb_fake_pci_spec __initdata = {
.setup = celleb_setup_fake_pci,
};

static struct of_device_id celleb_phb_match[] __initdata = {
{
.name = "pci-pseudo",
.data = celleb_setup_fake_pci,
.data = &celleb_fake_pci_spec,
}, {
.name = "epci",
.data = celleb_setup_epci,
.data = &celleb_epci_spec,
}, {
},
};

static int __init celleb_io_workaround_init(struct pci_controller *phb,
struct celleb_phb_spec *phb_spec)
{
if (phb_spec->ops) {
iowa_register_bus(phb, phb_spec->ops, phb_spec->iowa_init,
phb_spec->iowa_data);
io_workaround_init();
}

return 0;
}

int __init celleb_setup_phb(struct pci_controller *phb)
{
struct device_node *dev = phb->dn;
const struct of_device_id *match;
int (*setup_func)(struct device_node *, struct pci_controller *);
struct celleb_phb_spec *phb_spec;
int rc;

match = of_match_node(celleb_phb_match, dev);
if (!match)
Expand All @@ -492,8 +499,12 @@ int __init celleb_setup_phb(struct pci_controller *phb)
phb_set_bus_ranges(dev, phb);
phb->buid = 1;

setup_func = match->data;
return (*setup_func)(dev, phb);
phb_spec = match->data;
rc = (*phb_spec->setup)(dev, phb);
if (rc)
return 1;

return celleb_io_workaround_init(phb, phb_spec);
}

int celleb_pci_probe_mode(struct pci_bus *bus)
Expand Down
Loading

0 comments on commit 6ec859e

Please sign in to comment.