]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
powerpc/pseries: Move controller ops from ppc_md to controller_ops
authorDaniel Axtens <dja@axtens.net>
Tue, 31 Mar 2015 05:00:50 +0000 (16:00 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 11 Apr 2015 10:49:15 +0000 (20:49 +1000)
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>
arch/powerpc/platforms/pseries/iommu.c
arch/powerpc/platforms/pseries/pci_dlpar.c
arch/powerpc/platforms/pseries/pseries.h
arch/powerpc/platforms/pseries/setup.c

index 7803a19adb31822fbe1c679160ff7655ec5c5411..61d5a17f45c0b5dff8265dc8b1606ef7c08b2ce5 100644 (file)
@@ -49,6 +49,7 @@
 #include <asm/mmzone.h>
 #include <asm/plpar_wrappers.h>
 
+#include "pseries.h"
 
 static void tce_invalidate_pSeries_sw(struct iommu_table *tbl,
                                      __be64 *startp, __be64 *endp)
@@ -1307,16 +1308,16 @@ void iommu_init_early_pSeries(void)
                        ppc_md.tce_free  = tce_free_pSeriesLP;
                }
                ppc_md.tce_get   = tce_get_pSeriesLP;
-               ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeriesLP;
-               ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeriesLP;
+               pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeriesLP;
+               pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeriesLP;
                ppc_md.dma_set_mask = dma_set_mask_pSeriesLP;
                ppc_md.dma_get_required_mask = dma_get_required_mask_pSeriesLP;
        } else {
                ppc_md.tce_build = tce_build_pSeries;
                ppc_md.tce_free  = tce_free_pSeries;
                ppc_md.tce_get   = tce_get_pseries;
-               ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pSeries;
-               ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_pSeries;
+               pseries_pci_controller_ops.dma_bus_setup = pci_dma_bus_setup_pSeries;
+               pseries_pci_controller_ops.dma_dev_setup = pci_dma_dev_setup_pSeries;
        }
 
 
index f735f4fee48ce1fe289a2bd7897ef3b3f1622ea8..5d4a3df59d0c95fedaa7c2235bb7dbc034d7d9f6 100644 (file)
@@ -32,6 +32,8 @@
 #include <asm/firmware.h>
 #include <asm/eeh.h>
 
+#include "pseries.h"
+
 static struct pci_bus *
 find_bus_among_children(struct pci_bus *bus,
                         struct device_node *dn)
@@ -75,6 +77,7 @@ struct pci_controller *init_phb_dynamic(struct device_node *dn)
                return NULL;
        rtas_setup_phb(phb);
        pci_process_bridge_OF_ranges(phb, dn, 0);
+       phb->controller_ops = pseries_pci_controller_ops;
 
        pci_devs_phb_init_dynamic(phb);
 
index 1796c5438cc661d22a3e026dae6000891f9773d7..cd64672e24f83e32ce8eea02f4eb946a9135500d 100644 (file)
@@ -65,6 +65,8 @@ extern int dlpar_detach_node(struct device_node *);
 struct pci_host_bridge;
 int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
 
+extern struct pci_controller_ops pseries_pci_controller_ops;
+
 unsigned long pseries_memory_block_size(void);
 
 #endif /* _PSERIES_PSERIES_H */
index bcc6d24c77aa559c2d2bbe72b34741fcb723f704..1044b8b4da71e53648e86babb8ff4e06c89819dc 100644 (file)
@@ -478,6 +478,7 @@ static void __init find_and_init_phbs(void)
                rtas_setup_phb(phb);
                pci_process_bridge_OF_ranges(phb, node, 0);
                isa_bridge_find_early(phb);
+               phb->controller_ops = pseries_pci_controller_ops;
        }
 
        of_node_put(root);
@@ -840,6 +841,10 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
 void pSeries_final_fixup(void) { }
 #endif
 
+struct pci_controller_ops pseries_pci_controller_ops = {
+       .probe_mode             = pSeries_pci_probe_mode,
+};
+
 define_machine(pseries) {
        .name                   = "pSeries",
        .probe                  = pSeries_probe,
@@ -848,7 +853,6 @@ define_machine(pseries) {
        .show_cpuinfo           = pSeries_show_cpuinfo,
        .log_error              = pSeries_log_error,
        .pcibios_fixup          = pSeries_final_fixup,
-       .pci_probe_mode         = pSeries_pci_probe_mode,
        .restart                = rtas_restart,
        .halt                   = rtas_halt,
        .panic                  = rtas_os_term,