diff options
author | Daniel Axtens <dja@axtens.net> | 2015-03-31 01:00:50 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-04-11 06:49:15 -0400 |
commit | 38ae9ec40f06f3aef5c25314f432113cf2c1340a (patch) | |
tree | 9cf109959f4f610287c44071021bef0874424776 | |
parent | e63f26d3757fb8c00116b7f7c75d2a2e15bb5549 (diff) |
powerpc/pseries: Move controller ops from ppc_md to controller_ops
This moves the pSeries 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/pseries/iommu.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/pci_dlpar.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/pseries.h | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 6 |
4 files changed, 15 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 7803a19adb31..61d5a17f45c0 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <asm/mmzone.h> | 49 | #include <asm/mmzone.h> |
50 | #include <asm/plpar_wrappers.h> | 50 | #include <asm/plpar_wrappers.h> |
51 | 51 | ||
52 | #include "pseries.h" | ||
52 | 53 | ||
53 | static void tce_invalidate_pSeries_sw(struct iommu_table *tbl, | 54 | static void tce_invalidate_pSeries_sw(struct iommu_table *tbl, |
54 | __be64 *startp, __be64 *endp) | 55 | __be64 *startp, __be64 *endp) |
@@ -1307,16 +1308,16 @@ void iommu_init_early_pSeries(void) | |||
1307 | ppc_md.tce_free = tce_free_pSeriesLP; | 1308 | ppc_md.tce_free = tce_free_pSeriesLP; |
1308 | } | 1309 | } |
1309 | ppc_md.tce_get = tce_get_pSeriesLP; | 1310 | ppc_md.tce_get = tce_get_pSeriesLP; |
1310 | ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeriesLP; | 1311 | pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeriesLP; |
1311 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeriesLP; | 1312 | pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeriesLP; |
1312 | ppc_md.dma_set_mask = dma_set_mask_pSeriesLP; | 1313 | ppc_md.dma_set_mask = dma_set_mask_pSeriesLP; |
1313 | ppc_md.dma_get_required_mask = dma_get_required_mask_pSeriesLP; | 1314 | ppc_md.dma_get_required_mask = dma_get_required_mask_pSeriesLP; |
1314 | } else { | 1315 | } else { |
1315 | ppc_md.tce_build = tce_build_pSeries; | 1316 | ppc_md.tce_build = tce_build_pSeries; |
1316 | ppc_md.tce_free = tce_free_pSeries; | 1317 | ppc_md.tce_free = tce_free_pSeries; |
1317 | ppc_md.tce_get = tce_get_pseries; | 1318 | ppc_md.tce_get = tce_get_pseries; |
1318 | ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeries; | 1319 | pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeries; |
1319 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeries; | 1320 | pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeries; |
1320 | } | 1321 | } |
1321 | 1322 | ||
1322 | 1323 | ||
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index f735f4fee48c..5d4a3df59d0c 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <asm/firmware.h> | 32 | #include <asm/firmware.h> |
33 | #include <asm/eeh.h> | 33 | #include <asm/eeh.h> |
34 | 34 | ||
35 | #include "pseries.h" | ||
36 | |||
35 | static struct pci_bus * | 37 | static struct pci_bus * |
36 | find_bus_among_children(struct pci_bus *bus, | 38 | find_bus_among_children(struct pci_bus *bus, |
37 | struct device_node *dn) | 39 | struct device_node *dn) |
@@ -75,6 +77,7 @@ struct pci_controller *init_phb_dynamic(struct device_node *dn) | |||
75 | return NULL; | 77 | return NULL; |
76 | rtas_setup_phb(phb); | 78 | rtas_setup_phb(phb); |
77 | pci_process_bridge_OF_ranges(phb, dn, 0); | 79 | pci_process_bridge_OF_ranges(phb, dn, 0); |
80 | phb->controller_ops = pseries_pci_controller_ops; | ||
78 | 81 | ||
79 | pci_devs_phb_init_dynamic(phb); | 82 | pci_devs_phb_init_dynamic(phb); |
80 | 83 | ||
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h index 1796c5438cc6..cd64672e24f8 100644 --- a/arch/powerpc/platforms/pseries/pseries.h +++ b/arch/powerpc/platforms/pseries/pseries.h | |||
@@ -65,6 +65,8 @@ extern int dlpar_detach_node(struct device_node *); | |||
65 | struct pci_host_bridge; | 65 | struct pci_host_bridge; |
66 | int pseries_root_bridge_prepare(struct pci_host_bridge *bridge); | 66 | int pseries_root_bridge_prepare(struct pci_host_bridge *bridge); |
67 | 67 | ||
68 | extern struct pci_controller_ops pseries_pci_controller_ops; | ||
69 | |||
68 | unsigned long pseries_memory_block_size(void); | 70 | unsigned long pseries_memory_block_size(void); |
69 | 71 | ||
70 | #endif /* _PSERIES_PSERIES_H */ | 72 | #endif /* _PSERIES_PSERIES_H */ |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index bcc6d24c77aa..1044b8b4da71 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -478,6 +478,7 @@ static void __init find_and_init_phbs(void) | |||
478 | rtas_setup_phb(phb); | 478 | rtas_setup_phb(phb); |
479 | pci_process_bridge_OF_ranges(phb, node, 0); | 479 | pci_process_bridge_OF_ranges(phb, node, 0); |
480 | isa_bridge_find_early(phb); | 480 | isa_bridge_find_early(phb); |
481 | phb->controller_ops = pseries_pci_controller_ops; | ||
481 | } | 482 | } |
482 | 483 | ||
483 | of_node_put(root); | 484 | of_node_put(root); |
@@ -840,6 +841,10 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus) | |||
840 | void pSeries_final_fixup(void) { } | 841 | void pSeries_final_fixup(void) { } |
841 | #endif | 842 | #endif |
842 | 843 | ||
844 | struct pci_controller_ops pseries_pci_controller_ops = { | ||
845 | .probe_mode = pSeries_pci_probe_mode, | ||
846 | }; | ||
847 | |||
843 | define_machine(pseries) { | 848 | define_machine(pseries) { |
844 | .name = "pSeries", | 849 | .name = "pSeries", |
845 | .probe = pSeries_probe, | 850 | .probe = pSeries_probe, |
@@ -848,7 +853,6 @@ define_machine(pseries) { | |||
848 | .show_cpuinfo = pSeries_show_cpuinfo, | 853 | .show_cpuinfo = pSeries_show_cpuinfo, |
849 | .log_error = pSeries_log_error, | 854 | .log_error = pSeries_log_error, |
850 | .pcibios_fixup = pSeries_final_fixup, | 855 | .pcibios_fixup = pSeries_final_fixup, |
851 | .pci_probe_mode = pSeries_pci_probe_mode, | ||
852 | .restart = rtas_restart, | 856 | .restart = rtas_restart, |
853 | .halt = rtas_halt, | 857 | .halt = rtas_halt, |
854 | .panic = rtas_os_term, | 858 | .panic = rtas_os_term, |