aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2015-03-31 01:00:55 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-11 06:49:17 -0400
commit9c1368fc50e78ff862a05d1a0995ce44413c49e2 (patch)
tree9b72f2b83df1272cef305f81727558bb00df18a7
parent97884e00e29ad6654b8b6939bb805b9d6303427c (diff)
powerpc/cell: Move controller ops from ppc_md to controller_ops
This moves the Cell 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>
-rw-r--r--arch/powerpc/platforms/cell/cell.h24
-rw-r--r--arch/powerpc/platforms/cell/iommu.c7
-rw-r--r--arch/powerpc/platforms/cell/setup.c5
3 files changed, 33 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/cell.h b/arch/powerpc/platforms/cell/cell.h
new file mode 100644
index 000000000000..ef143dfee068
--- /dev/null
+++ b/arch/powerpc/platforms/cell/cell.h
@@ -0,0 +1,24 @@
1/*
2 * Cell Platform common data structures
3 *
4 * Copyright 2015, Daniel Axtens, IBM Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef CELL_H
18#define CELL_H
19
20#include <asm/pci-bridge.h>
21
22extern struct pci_controller_ops cell_pci_controller_ops;
23
24#endif
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index ee53344277e0..21b502398bf3 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -39,6 +39,7 @@
39#include <asm/firmware.h> 39#include <asm/firmware.h>
40#include <asm/cell-regs.h> 40#include <asm/cell-regs.h>
41 41
42#include "cell.h"
42#include "interrupt.h" 43#include "interrupt.h"
43 44
44/* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages 45/* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages
@@ -857,7 +858,7 @@ static int __init cell_iommu_init_disabled(void)
857 cell_dma_direct_offset += base; 858 cell_dma_direct_offset += base;
858 859
859 if (cell_dma_direct_offset != 0) 860 if (cell_dma_direct_offset != 0)
860 ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup; 861 cell_pci_controller_ops.dma_dev_setup = cell_pci_dma_dev_setup;
861 862
862 printk("iommu: disabled, direct DMA offset is 0x%lx\n", 863 printk("iommu: disabled, direct DMA offset is 0x%lx\n",
863 cell_dma_direct_offset); 864 cell_dma_direct_offset);
@@ -1197,8 +1198,8 @@ static int __init cell_iommu_init(void)
1197 if (cell_iommu_init_disabled() == 0) 1198 if (cell_iommu_init_disabled() == 0)
1198 goto bail; 1199 goto bail;
1199 1200
1200 /* Setup various ppc_md. callbacks */ 1201 /* Setup various callbacks */
1201 ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup; 1202 cell_pci_controller_ops.dma_dev_setup = cell_pci_dma_dev_setup;
1202 ppc_md.dma_get_required_mask = cell_dma_get_required_mask; 1203 ppc_md.dma_get_required_mask = cell_dma_get_required_mask;
1203 ppc_md.tce_build = tce_build_cell; 1204 ppc_md.tce_build = tce_build_cell;
1204 ppc_md.tce_free = tce_free_cell; 1205 ppc_md.tce_free = tce_free_cell;
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index d62aa982d530..d1be268b1e6e 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -54,6 +54,7 @@
54#include <asm/cell-regs.h> 54#include <asm/cell-regs.h>
55#include <asm/io-workarounds.h> 55#include <asm/io-workarounds.h>
56 56
57#include "cell.h"
57#include "interrupt.h" 58#include "interrupt.h"
58#include "pervasive.h" 59#include "pervasive.h"
59#include "ras.h" 60#include "ras.h"
@@ -131,6 +132,8 @@ static int cell_setup_phb(struct pci_controller *phb)
131 if (model == NULL || strcmp(np->name, "pci")) 132 if (model == NULL || strcmp(np->name, "pci"))
132 return 0; 133 return 0;
133 134
135 phb->controller_ops = cell_pci_controller_ops;
136
134 /* Setup workarounds for spider */ 137 /* Setup workarounds for spider */
135 if (strcmp(model, "Spider")) 138 if (strcmp(model, "Spider"))
136 return 0; 139 return 0;
@@ -279,3 +282,5 @@ define_machine(cell) {
279 .init_IRQ = cell_init_irq, 282 .init_IRQ = cell_init_irq,
280 .pci_setup_phb = cell_setup_phb, 283 .pci_setup_phb = cell_setup_phb,
281}; 284};
285
286struct pci_controller_ops cell_pci_controller_ops;