Skip to content

Commit

Permalink
powerpc/pasemi: Move controller ops from ppc_md to controller_ops
Browse files Browse the repository at this point in the history
This moves the PaSemi platform to use the pci_controller_ops
structure rather than ppc_md for PCI controller operations.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Daniel Axtens authored and Michael Ellerman committed Apr 11, 2015
1 parent 65ebf4b commit d28a0d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/powerpc/platforms/pasemi/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <asm/machdep.h>
#include <asm/firmware.h>

#include "pasemi.h"

#define IOBMAP_PAGE_SHIFT 12
#define IOBMAP_PAGE_SIZE (1 << IOBMAP_PAGE_SHIFT)
#define IOBMAP_PAGE_MASK (IOBMAP_PAGE_SIZE - 1)
Expand Down Expand Up @@ -248,8 +250,8 @@ void __init iommu_init_early_pasemi(void)

iob_init(NULL);

ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pasemi;
ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pasemi;
pasemi_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pasemi;
pasemi_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pasemi;
ppc_md.tce_build = iobmap_build;
ppc_md.tce_free = iobmap_free;
set_pci_dma_ops(&dma_iommu_ops);
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/pasemi/pasemi.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ static inline void restore_astate(int cpu)
}
#endif

extern struct pci_controller_ops pasemi_pci_controller_ops;

#endif /* _PASEMI_PASEMI_H */
5 changes: 5 additions & 0 deletions arch/powerpc/platforms/pasemi/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#include <asm/ppc-pci.h>

#include "pasemi.h"

#define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))

static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
Expand Down Expand Up @@ -199,6 +201,7 @@ static int __init pas_add_bridge(struct device_node *dev)

hose->first_busno = 0;
hose->last_busno = 0xff;
hose->controller_ops = pasemi_pci_controller_ops;

setup_pa_pxp(hose);

Expand Down Expand Up @@ -239,3 +242,5 @@ void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)

return (void __iomem *)pa_pxp_cfg_addr(hose, dev->bus->number, dev->devfn, offset);
}

struct pci_controller_ops pasemi_pci_controller_ops;

0 comments on commit d28a0d9

Please sign in to comment.