aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2005-10-14 02:49:58 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2005-10-14 02:49:58 -0400
commit20f48ccfa015d8b8391bbf07fc27618453f44969 (patch)
tree0a38839fb3c8899fe1eb3026a29daaabec65babc /arch
parentbffa8fc3835b0d3c4a59af8aceeea3aba823b032 (diff)
powerpc: eliminate DsaAddr from pci_dn
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c2
-rw-r--r--arch/powerpc/platforms/iseries/pci.c20
-rw-r--r--arch/powerpc/platforms/iseries/pci.h13
-rw-r--r--arch/powerpc/platforms/iseries/vpdinfo.c4
4 files changed, 23 insertions, 16 deletions
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index 533d9b467402..1db26d8be640 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -124,7 +124,7 @@ static void iommu_table_getparms(struct pci_dn *pdn,
124 124
125 memset(parms, 0, sizeof(*parms)); 125 memset(parms, 0, sizeof(*parms));
126 126
127 parms->itc_busno = pdn->DsaAddr.Dsa.busNumber; 127 parms->itc_busno = pdn->busno;
128 parms->itc_slotno = pdn->LogicalSlot; 128 parms->itc_slotno = pdn->LogicalSlot;
129 parms->itc_virtbus = 0; 129 parms->itc_virtbus = 0;
130 130
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");
diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h
index 94b4bfdceadf..33a8489fde54 100644
--- a/arch/powerpc/platforms/iseries/pci.h
+++ b/arch/powerpc/platforms/iseries/pci.h
@@ -30,6 +30,8 @@
30 * End Change Activity 30 * End Change Activity
31 */ 31 */
32 32
33#include <asm/pci-bridge.h>
34
33struct pci_dev; /* For Forward Reference */ 35struct pci_dev; /* For Forward Reference */
34 36
35/* 37/*
@@ -45,6 +47,17 @@ struct pci_dev; /* For Forward Reference */
45#define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7) 47#define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7)
46#define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7) 48#define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7)
47 49
50/*
51 * Generate a Direct Select Address for the Hypervisor
52 */
53static inline u64 iseries_ds_addr(struct device_node *node)
54{
55 struct pci_dn *pdn = PCI_DN(node);
56
57 return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
58 + ((u64)0x10 << 32);
59}
60
48extern void iSeries_Device_Information(struct pci_dev*, int); 61extern void iSeries_Device_Information(struct pci_dev*, int);
49 62
50#endif /* _PLATFORMS_ISERIES_PCI_H */ 63#endif /* _PLATFORMS_ISERIES_PCI_H */
diff --git a/arch/powerpc/platforms/iseries/vpdinfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c
index dcdac995565c..a03984e19c13 100644
--- a/arch/powerpc/platforms/iseries/vpdinfo.c
+++ b/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -258,8 +258,8 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
258 } 258 }
259 259
260 pdn = PCI_DN(DevNode); 260 pdn = PCI_DN(DevNode);
261 bus = pdn->DsaAddr.Dsa.busNumber; 261 bus = pdn->busno;
262 subbus = pdn->DsaAddr.Dsa.subBusNumber; 262 subbus = pdn->bussubno;
263 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus), 263 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
264 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)); 264 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
265 iSeries_Get_Location_Code(bus, agent, &frame, card); 265 iSeries_Get_Location_Code(bus, agent, &frame, card);