diff options
| author | Daniel Axtens <dja@axtens.net> | 2015-03-31 01:00:56 -0400 |
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-04-11 06:49:18 -0400 |
| commit | 467efc2e4fdc44e6cd4be7dd4adf01c14b3d148e (patch) | |
| tree | d8702b30db2eedb190e82beb802ac30275af6ea7 /arch/powerpc/kernel | |
| parent | 9c1368fc50e78ff862a05d1a0995ce44413c49e2 (diff) | |
powerpc: Remove shims for pci_controller_ops operations
Remove shims, patch callsites to use pci_controller_ops
versions instead.
Also move back the probe mode defines, as explained in the patch
for pci_probe_mode.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel')
| -rw-r--r-- | arch/powerpc/kernel/pci-common.c | 43 | ||||
| -rw-r--r-- | arch/powerpc/kernel/pci-hotplug.c | 6 | ||||
| -rw-r--r-- | arch/powerpc/kernel/pci_of_scan.c | 6 |
3 files changed, 45 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 759eb1c87638..9052b4fbc41f 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
| @@ -109,12 +109,29 @@ void pcibios_free_controller(struct pci_controller *phb) | |||
| 109 | resource_size_t pcibios_window_alignment(struct pci_bus *bus, | 109 | resource_size_t pcibios_window_alignment(struct pci_bus *bus, |
| 110 | unsigned long type) | 110 | unsigned long type) |
| 111 | { | 111 | { |
| 112 | return pci_window_alignment(bus, type); | 112 | struct pci_controller *phb = pci_bus_to_host(bus); |
| 113 | |||
| 114 | if (phb->controller_ops.window_alignment) | ||
| 115 | return phb->controller_ops.window_alignment(bus, type); | ||
| 116 | |||
| 117 | /* | ||
| 118 | * PCI core will figure out the default | ||
| 119 | * alignment: 4KiB for I/O and 1MiB for | ||
| 120 | * memory window. | ||
| 121 | */ | ||
| 122 | return 1; | ||
| 113 | } | 123 | } |
| 114 | 124 | ||
| 115 | void pcibios_reset_secondary_bus(struct pci_dev *dev) | 125 | void pcibios_reset_secondary_bus(struct pci_dev *dev) |
| 116 | { | 126 | { |
| 117 | pcibios_reset_secondary_bus_shim(dev); | 127 | struct pci_controller *phb = pci_bus_to_host(dev->bus); |
| 128 | |||
| 129 | if (phb->controller_ops.reset_secondary_bus) { | ||
| 130 | phb->controller_ops.reset_secondary_bus(dev); | ||
| 131 | return; | ||
| 132 | } | ||
| 133 | |||
| 134 | pci_reset_secondary_bus(dev); | ||
| 118 | } | 135 | } |
| 119 | 136 | ||
| 120 | static resource_size_t pcibios_io_size(const struct pci_controller *hose) | 137 | static resource_size_t pcibios_io_size(const struct pci_controller *hose) |
| @@ -929,6 +946,8 @@ static void pcibios_fixup_bridge(struct pci_bus *bus) | |||
| 929 | 946 | ||
| 930 | void pcibios_setup_bus_self(struct pci_bus *bus) | 947 | void pcibios_setup_bus_self(struct pci_bus *bus) |
| 931 | { | 948 | { |
| 949 | struct pci_controller *phb; | ||
| 950 | |||
| 932 | /* Fix up the bus resources for P2P bridges */ | 951 | /* Fix up the bus resources for P2P bridges */ |
| 933 | if (bus->self != NULL) | 952 | if (bus->self != NULL) |
| 934 | pcibios_fixup_bridge(bus); | 953 | pcibios_fixup_bridge(bus); |
| @@ -940,11 +959,14 @@ void pcibios_setup_bus_self(struct pci_bus *bus) | |||
| 940 | ppc_md.pcibios_fixup_bus(bus); | 959 | ppc_md.pcibios_fixup_bus(bus); |
| 941 | 960 | ||
| 942 | /* Setup bus DMA mappings */ | 961 | /* Setup bus DMA mappings */ |
| 943 | pci_dma_bus_setup(bus); | 962 | phb = pci_bus_to_host(bus); |
| 963 | if (phb->controller_ops.dma_bus_setup) | ||
| 964 | phb->controller_ops.dma_bus_setup(bus); | ||
| 944 | } | 965 | } |
| 945 | 966 | ||
| 946 | static void pcibios_setup_device(struct pci_dev *dev) | 967 | static void pcibios_setup_device(struct pci_dev *dev) |
| 947 | { | 968 | { |
| 969 | struct pci_controller *phb; | ||
| 948 | /* Fixup NUMA node as it may not be setup yet by the generic | 970 | /* Fixup NUMA node as it may not be setup yet by the generic |
| 949 | * code and is needed by the DMA init | 971 | * code and is needed by the DMA init |
| 950 | */ | 972 | */ |
| @@ -955,7 +977,9 @@ static void pcibios_setup_device(struct pci_dev *dev) | |||
| 955 | set_dma_offset(&dev->dev, PCI_DRAM_OFFSET); | 977 | set_dma_offset(&dev->dev, PCI_DRAM_OFFSET); |
| 956 | 978 | ||
| 957 | /* Additional platform DMA/iommu setup */ | 979 | /* Additional platform DMA/iommu setup */ |
| 958 | pci_dma_dev_setup(dev); | 980 | phb = pci_bus_to_host(dev->bus); |
| 981 | if (phb->controller_ops.dma_dev_setup) | ||
| 982 | phb->controller_ops.dma_dev_setup(dev); | ||
| 959 | 983 | ||
| 960 | /* Read default IRQs and fixup if necessary */ | 984 | /* Read default IRQs and fixup if necessary */ |
| 961 | pci_read_irq_line(dev); | 985 | pci_read_irq_line(dev); |
| @@ -1435,8 +1459,11 @@ EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus); | |||
| 1435 | 1459 | ||
| 1436 | int pcibios_enable_device(struct pci_dev *dev, int mask) | 1460 | int pcibios_enable_device(struct pci_dev *dev, int mask) |
| 1437 | { | 1461 | { |
| 1438 | if (!pcibios_enable_device_hook(dev)) | 1462 | struct pci_controller *phb = pci_bus_to_host(dev->bus); |
| 1439 | return -EINVAL; | 1463 | |
| 1464 | if (phb->controller_ops.enable_device_hook) | ||
| 1465 | if (!phb->controller_ops.enable_device_hook(dev)) | ||
| 1466 | return -EINVAL; | ||
| 1440 | 1467 | ||
| 1441 | return pci_enable_resources(dev, mask); | 1468 | return pci_enable_resources(dev, mask); |
| 1442 | } | 1469 | } |
| @@ -1608,8 +1635,8 @@ void pcibios_scan_phb(struct pci_controller *hose) | |||
| 1608 | 1635 | ||
| 1609 | /* Get probe mode and perform scan */ | 1636 | /* Get probe mode and perform scan */ |
| 1610 | mode = PCI_PROBE_NORMAL; | 1637 | mode = PCI_PROBE_NORMAL; |
| 1611 | if (node) | 1638 | if (node && hose->controller_ops.probe_mode) |
| 1612 | mode = pci_probe_mode(bus); | 1639 | mode = hose->controller_ops.probe_mode(bus); |
| 1613 | pr_debug(" probe mode: %d\n", mode); | 1640 | pr_debug(" probe mode: %d\n", mode); |
| 1614 | if (mode == PCI_PROBE_DEVTREE) | 1641 | if (mode == PCI_PROBE_DEVTREE) |
| 1615 | of_scan_bus(node, bus); | 1642 | of_scan_bus(node, bus); |
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c index 27116b1b2d14..7ed85a69a9c2 100644 --- a/arch/powerpc/kernel/pci-hotplug.c +++ b/arch/powerpc/kernel/pci-hotplug.c | |||
| @@ -73,12 +73,16 @@ void pcibios_add_pci_devices(struct pci_bus * bus) | |||
| 73 | { | 73 | { |
| 74 | int slotno, mode, pass, max; | 74 | int slotno, mode, pass, max; |
| 75 | struct pci_dev *dev; | 75 | struct pci_dev *dev; |
| 76 | struct pci_controller *phb; | ||
| 76 | struct device_node *dn = pci_bus_to_OF_node(bus); | 77 | struct device_node *dn = pci_bus_to_OF_node(bus); |
| 77 | 78 | ||
| 78 | eeh_add_device_tree_early(PCI_DN(dn)); | 79 | eeh_add_device_tree_early(PCI_DN(dn)); |
| 79 | 80 | ||
| 81 | phb = pci_bus_to_host(bus); | ||
| 82 | |||
| 80 | mode = PCI_PROBE_NORMAL; | 83 | mode = PCI_PROBE_NORMAL; |
| 81 | mode = pci_probe_mode(bus); | 84 | if (phb->controller_ops.probe_mode) |
| 85 | mode = phb->controller_ops.probe_mode(bus); | ||
| 82 | 86 | ||
| 83 | if (mode == PCI_PROBE_DEVTREE) { | 87 | if (mode == PCI_PROBE_DEVTREE) { |
| 84 | /* use ofdt-based probe */ | 88 | /* use ofdt-based probe */ |
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c index 4ee63c4f077e..42e02a2d570b 100644 --- a/arch/powerpc/kernel/pci_of_scan.c +++ b/arch/powerpc/kernel/pci_of_scan.c | |||
| @@ -207,6 +207,7 @@ void of_scan_pci_bridge(struct pci_dev *dev) | |||
| 207 | { | 207 | { |
| 208 | struct device_node *node = dev->dev.of_node; | 208 | struct device_node *node = dev->dev.of_node; |
| 209 | struct pci_bus *bus; | 209 | struct pci_bus *bus; |
| 210 | struct pci_controller *phb; | ||
| 210 | const __be32 *busrange, *ranges; | 211 | const __be32 *busrange, *ranges; |
| 211 | int len, i, mode; | 212 | int len, i, mode; |
| 212 | struct pci_bus_region region; | 213 | struct pci_bus_region region; |
| @@ -286,8 +287,11 @@ void of_scan_pci_bridge(struct pci_dev *dev) | |||
| 286 | bus->number); | 287 | bus->number); |
| 287 | pr_debug(" bus name: %s\n", bus->name); | 288 | pr_debug(" bus name: %s\n", bus->name); |
| 288 | 289 | ||
| 290 | phb = pci_bus_to_host(bus); | ||
| 291 | |||
| 289 | mode = PCI_PROBE_NORMAL; | 292 | mode = PCI_PROBE_NORMAL; |
| 290 | mode = pci_probe_mode(bus); | 293 | if (phb->controller_ops.probe_mode) |
| 294 | mode = phb->controller_ops.probe_mode(bus); | ||
| 291 | pr_debug(" probe mode: %d\n", mode); | 295 | pr_debug(" probe mode: %d\n", mode); |
| 292 | 296 | ||
| 293 | if (mode == PCI_PROBE_DEVTREE) | 297 | if (mode == PCI_PROBE_DEVTREE) |
