powerpc/pci: Override pcibios_setup_bridge()
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Fri, 20 May 2016 06:41:26 +0000 (16:41 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 21 Jun 2016 05:30:52 +0000 (15:30 +1000)
This overrides pcibios_setup_bridge() that is called to update PCI
bridge windows when PCI resource assignment is completed, to assign
PE and setup various (resource) mapping for the PE in subsequent
patches.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/kernel/pci-common.c

index 467c0b05b6fb9df752826afef91eafde2fcac560..b5e88e4a171ab3e5bb005125373bc82050ae10ba 100644 (file)
@@ -33,6 +33,8 @@ struct pci_controller_ops {
        /* Called during PCI resource reassignment */
        resource_size_t (*window_alignment)(struct pci_bus *bus,
                                            unsigned long type);
+       void            (*setup_bridge)(struct pci_bus *bus,
+                                       unsigned long type);
        void            (*reset_secondary_bus)(struct pci_dev *pdev);
 
 #ifdef CONFIG_PCI_MSI
index 0f7a60f1e9f6292ceb9f1ade5c67d2617d1aefb9..40df3a551b1404ece4a85f0c3e533e30484b8561 100644 (file)
@@ -124,6 +124,14 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus,
        return 1;
 }
 
+void pcibios_setup_bridge(struct pci_bus *bus, unsigned long type)
+{
+       struct pci_controller *hose = pci_bus_to_host(bus);
+
+       if (hose->controller_ops.setup_bridge)
+               hose->controller_ops.setup_bridge(bus, type);
+}
+
 void pcibios_reset_secondary_bus(struct pci_dev *dev)
 {
        struct pci_controller *phb = pci_bus_to_host(dev->bus);