aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/iseries/pci.c')
-rw-r--r--arch/powerpc/platforms/iseries/pci.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index fe34d1175818..d14e9d9d7797 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -223,13 +223,8 @@ static struct device_node *build_device_node(HvBusNumber Bus,
223 node->data = pdn; 223 node->data = pdn;
224 pdn->node = node; 224 pdn->node = node;
225 list_add_tail(&pdn->Device_List, &iSeries_Global_Device_List); 225 list_add_tail(&pdn->Device_List, &iSeries_Global_Device_List);
226#if 0 226 pdn->busno = Bus;
227 pdn->DsaAddr = ((u64)Bus << 48) + ((u64)SubBus << 40) + ((u64)0x10 << 32); 227 pdn->bussubno = SubBus;
228#endif
229 pdn->DsaAddr.DsaAddr = 0;
230 pdn->DsaAddr.Dsa.busNumber = Bus;
231 pdn->DsaAddr.Dsa.subBusNumber = SubBus;
232 pdn->DsaAddr.Dsa.deviceId = 0x10;
233 pdn->devfn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function); 228 pdn->devfn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function);
234 return node; 229 return node;
235} 230}
@@ -554,8 +549,7 @@ static struct device_node *find_Device_Node(int bus, int devfn)
554 struct pci_dn *pdn; 549 struct pci_dn *pdn;
555 550
556 list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) { 551 list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) {
557 if ((bus == pdn->DsaAddr.Dsa.busNumber) && 552 if ((bus == pdn->busno) && (devfn == pdn->devfn))
558 (devfn == pdn->devfn))
559 return pdn->node; 553 return pdn->node;
560 } 554 }
561 return NULL; 555 return NULL;
@@ -612,7 +606,7 @@ static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
612 } 606 }
613 607
614 fn = hv_cfg_read_func[(size - 1) & 3]; 608 fn = hv_cfg_read_func[(size - 1) & 3];
615 HvCall3Ret16(fn, &ret, PCI_DN(node)->DsaAddr.DsaAddr, offset, 0); 609 HvCall3Ret16(fn, &ret, iseries_ds_addr(node), offset, 0);
616 610
617 if (ret.rc != 0) { 611 if (ret.rc != 0) {
618 *val = ~0; 612 *val = ~0;
@@ -640,7 +634,7 @@ static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
640 return PCIBIOS_BAD_REGISTER_NUMBER; 634 return PCIBIOS_BAD_REGISTER_NUMBER;
641 635
642 fn = hv_cfg_write_func[(size - 1) & 3]; 636 fn = hv_cfg_write_func[(size - 1) & 3];
643 ret = HvCall4(fn, PCI_DN(node)->DsaAddr.DsaAddr, offset, val, 0); 637 ret = HvCall4(fn, iseries_ds_addr(node), offset, val, 0);
644 638
645 if (ret != 0) 639 if (ret != 0)
646 return PCIBIOS_DEVICE_NOT_FOUND; 640 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -671,7 +665,7 @@ static int CheckReturnCode(char *TextHdr, struct device_node *DevNode,
671 ++Pci_Error_Count; 665 ++Pci_Error_Count;
672 (*retry)++; 666 (*retry)++;
673 printk("PCI: %s: Device 0x%04X:%02X I/O Error(%2d): 0x%04X\n", 667 printk("PCI: %s: Device 0x%04X:%02X I/O Error(%2d): 0x%04X\n",
674 TextHdr, pdn->DsaAddr.Dsa.busNumber, pdn->devfn, 668 TextHdr, pdn->busno, pdn->devfn,
675 *retry, (int)ret); 669 *retry, (int)ret);
676 /* 670 /*
677 * Bump the retry and check for retry count exceeded. 671 * Bump the retry and check for retry count exceeded.
@@ -712,7 +706,7 @@ static inline struct device_node *xlate_iomm_address(
712 706
713 if (DevNode != NULL) { 707 if (DevNode != NULL) {
714 int barnum = iobar_table[TableIndex]; 708 int barnum = iobar_table[TableIndex];
715 *dsaptr = PCI_DN(DevNode)->DsaAddr.DsaAddr | (barnum << 24); 709 *dsaptr = iseries_ds_addr(DevNode) | (barnum << 24);
716 *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE; 710 *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE;
717 } else 711 } else
718 panic("PCI: Invalid PCI IoAddress detected!\n"); 712 panic("PCI: Invalid PCI IoAddress detected!\n");