aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv/pci-ioda.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/powernv/pci-ioda.c')
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 53d052e95cfc..8e90e8906df3 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -76,7 +76,7 @@ static struct pci_dn *pnv_ioda_get_pdn(struct pci_dev *dev)
76 return PCI_DN(np); 76 return PCI_DN(np);
77} 77}
78 78
79static int __devinit pnv_ioda_alloc_pe(struct pnv_phb *phb) 79static int pnv_ioda_alloc_pe(struct pnv_phb *phb)
80{ 80{
81 unsigned long pe; 81 unsigned long pe;
82 82
@@ -91,7 +91,7 @@ static int __devinit pnv_ioda_alloc_pe(struct pnv_phb *phb)
91 return pe; 91 return pe;
92} 92}
93 93
94static void __devinit pnv_ioda_free_pe(struct pnv_phb *phb, int pe) 94static void pnv_ioda_free_pe(struct pnv_phb *phb, int pe)
95{ 95{
96 WARN_ON(phb->ioda.pe_array[pe].pdev); 96 WARN_ON(phb->ioda.pe_array[pe].pdev);
97 97
@@ -103,7 +103,7 @@ static void __devinit pnv_ioda_free_pe(struct pnv_phb *phb, int pe)
103 * but in the meantime, we need to protect them to avoid warnings 103 * but in the meantime, we need to protect them to avoid warnings
104 */ 104 */
105#ifdef CONFIG_PCI_MSI 105#ifdef CONFIG_PCI_MSI
106static struct pnv_ioda_pe * __devinit pnv_ioda_get_pe(struct pci_dev *dev) 106static struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev)
107{ 107{
108 struct pci_controller *hose = pci_bus_to_host(dev->bus); 108 struct pci_controller *hose = pci_bus_to_host(dev->bus);
109 struct pnv_phb *phb = hose->private_data; 109 struct pnv_phb *phb = hose->private_data;
@@ -117,8 +117,7 @@ static struct pnv_ioda_pe * __devinit pnv_ioda_get_pe(struct pci_dev *dev)
117} 117}
118#endif /* CONFIG_PCI_MSI */ 118#endif /* CONFIG_PCI_MSI */
119 119
120static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb, 120static int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
121 struct pnv_ioda_pe *pe)
122{ 121{
123 struct pci_dev *parent; 122 struct pci_dev *parent;
124 uint8_t bcomp, dcomp, fcomp; 123 uint8_t bcomp, dcomp, fcomp;
@@ -207,8 +206,8 @@ static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb,
207 return 0; 206 return 0;
208} 207}
209 208
210static void __devinit pnv_ioda_link_pe_by_weight(struct pnv_phb *phb, 209static void pnv_ioda_link_pe_by_weight(struct pnv_phb *phb,
211 struct pnv_ioda_pe *pe) 210 struct pnv_ioda_pe *pe)
212{ 211{
213 struct pnv_ioda_pe *lpe; 212 struct pnv_ioda_pe *lpe;
214 213
@@ -246,7 +245,7 @@ static unsigned int pnv_ioda_dma_weight(struct pci_dev *dev)
246} 245}
247 246
248#if 0 247#if 0
249static struct pnv_ioda_pe * __devinit pnv_ioda_setup_dev_PE(struct pci_dev *dev) 248static struct pnv_ioda_pe *pnv_ioda_setup_dev_PE(struct pci_dev *dev)
250{ 249{
251 struct pci_controller *hose = pci_bus_to_host(dev->bus); 250 struct pci_controller *hose = pci_bus_to_host(dev->bus);
252 struct pnv_phb *phb = hose->private_data; 251 struct pnv_phb *phb = hose->private_data;
@@ -343,7 +342,7 @@ static void pnv_ioda_setup_same_PE(struct pci_bus *bus, struct pnv_ioda_pe *pe)
343 * subordinate PCI devices and buses. The second type of PE is normally 342 * subordinate PCI devices and buses. The second type of PE is normally
344 * orgiriated by PCIe-to-PCI bridge or PLX switch downstream ports. 343 * orgiriated by PCIe-to-PCI bridge or PLX switch downstream ports.
345 */ 344 */
346static void __devinit pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all) 345static void pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all)
347{ 346{
348 struct pci_controller *hose = pci_bus_to_host(bus); 347 struct pci_controller *hose = pci_bus_to_host(bus);
349 struct pnv_phb *phb = hose->private_data; 348 struct pnv_phb *phb = hose->private_data;
@@ -399,7 +398,7 @@ static void __devinit pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all)
399 pnv_ioda_link_pe_by_weight(phb, pe); 398 pnv_ioda_link_pe_by_weight(phb, pe);
400} 399}
401 400
402static void __devinit pnv_ioda_setup_PEs(struct pci_bus *bus) 401static void pnv_ioda_setup_PEs(struct pci_bus *bus)
403{ 402{
404 struct pci_dev *dev; 403 struct pci_dev *dev;
405 404
@@ -423,7 +422,7 @@ static void __devinit pnv_ioda_setup_PEs(struct pci_bus *bus)
423 * port to PE# here. The game rule here is expected to be changed 422 * port to PE# here. The game rule here is expected to be changed
424 * as soon as we can detected PLX bridge correctly. 423 * as soon as we can detected PLX bridge correctly.
425 */ 424 */
426static void __devinit pnv_pci_ioda_setup_PEs(void) 425static void pnv_pci_ioda_setup_PEs(void)
427{ 426{
428 struct pci_controller *hose, *tmp; 427 struct pci_controller *hose, *tmp;
429 428
@@ -432,14 +431,12 @@ static void __devinit pnv_pci_ioda_setup_PEs(void)
432 } 431 }
433} 432}
434 433
435static void __devinit pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, 434static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *dev)
436 struct pci_dev *dev)
437{ 435{
438 /* We delay DMA setup after we have assigned all PE# */ 436 /* We delay DMA setup after we have assigned all PE# */
439} 437}
440 438
441static void __devinit pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, 439static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus)
442 struct pci_bus *bus)
443{ 440{
444 struct pci_dev *dev; 441 struct pci_dev *dev;
445 442
@@ -450,10 +447,9 @@ static void __devinit pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe,
450 } 447 }
451} 448}
452 449
453static void __devinit pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb, 450static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
454 struct pnv_ioda_pe *pe, 451 struct pnv_ioda_pe *pe, unsigned int base,
455 unsigned int base, 452 unsigned int segs)
456 unsigned int segs)
457{ 453{
458 454
459 struct page *tce_mem = NULL; 455 struct page *tce_mem = NULL;
@@ -541,7 +537,7 @@ static void __devinit pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
541 __free_pages(tce_mem, get_order(TCE32_TABLE_SIZE * segs)); 537 __free_pages(tce_mem, get_order(TCE32_TABLE_SIZE * segs));
542} 538}
543 539
544static void __devinit pnv_ioda_setup_dma(struct pnv_phb *phb) 540static void pnv_ioda_setup_dma(struct pnv_phb *phb)
545{ 541{
546 struct pci_controller *hose = phb->hose; 542 struct pci_controller *hose = phb->hose;
547 unsigned int residual, remaining, segs, tw, base; 543 unsigned int residual, remaining, segs, tw, base;
@@ -684,8 +680,8 @@ static void pnv_pci_init_ioda_msis(struct pnv_phb *phb) { }
684 * to bottom style. So the the I/O or MMIO segment assigned to 680 * to bottom style. So the the I/O or MMIO segment assigned to
685 * parent PE could be overrided by its child PEs if necessary. 681 * parent PE could be overrided by its child PEs if necessary.
686 */ 682 */
687static void __devinit pnv_ioda_setup_pe_seg(struct pci_controller *hose, 683static void pnv_ioda_setup_pe_seg(struct pci_controller *hose,
688 struct pnv_ioda_pe *pe) 684 struct pnv_ioda_pe *pe)
689{ 685{
690 struct pnv_phb *phb = hose->private_data; 686 struct pnv_phb *phb = hose->private_data;
691 struct pci_bus_region region; 687 struct pci_bus_region region;
@@ -753,7 +749,7 @@ static void __devinit pnv_ioda_setup_pe_seg(struct pci_controller *hose,
753 } 749 }
754} 750}
755 751
756static void __devinit pnv_pci_ioda_setup_seg(void) 752static void pnv_pci_ioda_setup_seg(void)
757{ 753{
758 struct pci_controller *tmp, *hose; 754 struct pci_controller *tmp, *hose;
759 struct pnv_phb *phb; 755 struct pnv_phb *phb;
@@ -767,7 +763,7 @@ static void __devinit pnv_pci_ioda_setup_seg(void)
767 } 763 }
768} 764}
769 765
770static void __devinit pnv_pci_ioda_setup_DMA(void) 766static void pnv_pci_ioda_setup_DMA(void)
771{ 767{
772 struct pci_controller *hose, *tmp; 768 struct pci_controller *hose, *tmp;
773 struct pnv_phb *phb; 769 struct pnv_phb *phb;
@@ -781,7 +777,7 @@ static void __devinit pnv_pci_ioda_setup_DMA(void)
781 } 777 }
782} 778}
783 779
784static void __devinit pnv_pci_ioda_fixup(void) 780static void pnv_pci_ioda_fixup(void)
785{ 781{
786 pnv_pci_ioda_setup_PEs(); 782 pnv_pci_ioda_setup_PEs();
787 pnv_pci_ioda_setup_seg(); 783 pnv_pci_ioda_setup_seg();
@@ -829,7 +825,7 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus,
829/* Prevent enabling devices for which we couldn't properly 825/* Prevent enabling devices for which we couldn't properly
830 * assign a PE 826 * assign a PE
831 */ 827 */
832static int __devinit pnv_pci_enable_device_hook(struct pci_dev *dev) 828static int pnv_pci_enable_device_hook(struct pci_dev *dev)
833{ 829{
834 struct pci_controller *hose = pci_bus_to_host(dev->bus); 830 struct pci_controller *hose = pci_bus_to_host(dev->bus);
835 struct pnv_phb *phb = hose->private_data; 831 struct pnv_phb *phb = hose->private_data;