pci-common.c (976e3645923bdd2fe7893aae33fd7a21098bfb28) pci-common.c (30d87ef8b38d471ab5c0f1226926ebd856da8647)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Contains common pci routines for ALL ppc platform
4 * (based on pci_32.c and pci_64.c)
5 *
6 * Port for PPC64 David Engebretsen, IBM Corp.
7 * Contains common pci routines for ppc64 platform, pSeries and iSeries brands.
8 *

--- 247 unchanged lines hidden (view full) ---

256 if (ppc_md.pcibios_sriov_disable)
257 return ppc_md.pcibios_sriov_disable(pdev);
258
259 return 0;
260}
261
262#endif /* CONFIG_PCI_IOV */
263
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Contains common pci routines for ALL ppc platform
4 * (based on pci_32.c and pci_64.c)
5 *
6 * Port for PPC64 David Engebretsen, IBM Corp.
7 * Contains common pci routines for ppc64 platform, pSeries and iSeries brands.
8 *

--- 247 unchanged lines hidden (view full) ---

256 if (ppc_md.pcibios_sriov_disable)
257 return ppc_md.pcibios_sriov_disable(pdev);
258
259 return 0;
260}
261
262#endif /* CONFIG_PCI_IOV */
263
264void pcibios_bus_add_device(struct pci_dev *pdev)
265{
266 if (ppc_md.pcibios_bus_add_device)
267 ppc_md.pcibios_bus_add_device(pdev);
268}
269
270static resource_size_t pcibios_io_size(const struct pci_controller *hose)
271{
272#ifdef CONFIG_PPC64
273 return hose->pci_io_size;
274#else
275 return resource_size(&hose->io_resource);
276#endif
277}

--- 704 unchanged lines hidden (view full) ---

982 phb->controller_ops.dma_dev_setup(dev);
983
984 /* Read default IRQs and fixup if necessary */
985 pci_read_irq_line(dev);
986 if (ppc_md.pci_irq_fixup)
987 ppc_md.pci_irq_fixup(dev);
988}
989
264static resource_size_t pcibios_io_size(const struct pci_controller *hose)
265{
266#ifdef CONFIG_PPC64
267 return hose->pci_io_size;
268#else
269 return resource_size(&hose->io_resource);
270#endif
271}

--- 704 unchanged lines hidden (view full) ---

976 phb->controller_ops.dma_dev_setup(dev);
977
978 /* Read default IRQs and fixup if necessary */
979 pci_read_irq_line(dev);
980 if (ppc_md.pci_irq_fixup)
981 ppc_md.pci_irq_fixup(dev);
982}
983
990int pcibios_add_device(struct pci_dev *dev)
984void pcibios_bus_add_device(struct pci_dev *pdev)
991{
985{
992 /*
993 * We can only call pcibios_setup_device() after bus setup is complete,
994 * since some of the platform specific DMA setup code depends on it.
995 */
996 if (dev->bus->is_added)
997 pcibios_setup_device(dev);
986 /* Perform platform-specific device setup */
987 pcibios_setup_device(pdev);
998
988
989 if (ppc_md.pcibios_bus_add_device)
990 ppc_md.pcibios_bus_add_device(pdev);
991}
992
993int pcibios_add_device(struct pci_dev *dev)
994{
999#ifdef CONFIG_PCI_IOV
1000 if (ppc_md.pcibios_fixup_sriov)
1001 ppc_md.pcibios_fixup_sriov(dev);
1002#endif /* CONFIG_PCI_IOV */
1003
1004 return 0;
1005}
1006

--- 25 unchanged lines hidden (view full) ---

1032 /* When called from the generic PCI probe, read PCI<->PCI bridge
1033 * bases. This is -not- called when generating the PCI tree from
1034 * the OF device-tree.
1035 */
1036 pci_read_bridge_bases(bus);
1037
1038 /* Now fixup the bus bus */
1039 pcibios_setup_bus_self(bus);
995#ifdef CONFIG_PCI_IOV
996 if (ppc_md.pcibios_fixup_sriov)
997 ppc_md.pcibios_fixup_sriov(dev);
998#endif /* CONFIG_PCI_IOV */
999
1000 return 0;
1001}
1002

--- 25 unchanged lines hidden (view full) ---

1028 /* When called from the generic PCI probe, read PCI<->PCI bridge
1029 * bases. This is -not- called when generating the PCI tree from
1030 * the OF device-tree.
1031 */
1032 pci_read_bridge_bases(bus);
1033
1034 /* Now fixup the bus bus */
1035 pcibios_setup_bus_self(bus);
1040
1041 /* Now fixup devices on that bus */
1042 pcibios_setup_bus_devices(bus);
1043}
1044EXPORT_SYMBOL(pcibios_fixup_bus);
1045
1046void pci_fixup_cardbus(struct pci_bus *bus)
1047{
1048 /* Now fixup devices on that bus */
1049 pcibios_setup_bus_devices(bus);
1050}

--- 621 unchanged lines hidden ---
1036}
1037EXPORT_SYMBOL(pcibios_fixup_bus);
1038
1039void pci_fixup_cardbus(struct pci_bus *bus)
1040{
1041 /* Now fixup devices on that bus */
1042 pcibios_setup_bus_devices(bus);
1043}

--- 621 unchanged lines hidden ---