aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2005-09-28 00:40:40 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2005-09-28 00:40:40 -0400
commit252e75a51d40757928d692b3d339e66838294b4b (patch)
tree6ae6e08ae69f54320da58ac369cb98bdf097a7c2
parentc111d0bda8437d146ccf5101970801fe4ff23ed8 (diff)
ppc64 iSeries: use device_node instead of iSeries_Device_node
There needs to be more cleanup after this. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c29
-rw-r--r--arch/powerpc/platforms/iseries/pci.c91
-rw-r--r--arch/powerpc/platforms/iseries/vpdinfo.c2
-rw-r--r--arch/ppc64/kernel/pci_iommu.c6
-rw-r--r--include/asm-ppc64/iSeries/iSeries_pci.h30
-rw-r--r--include/asm-ppc64/iommu.h4
-rw-r--r--include/asm-ppc64/pci-bridge.h10
-rw-r--r--include/asm-ppc64/prom.h3
8 files changed, 88 insertions, 87 deletions
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index 65c76dd1d3de..9ac735d5b817 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -89,15 +89,17 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
89 */ 89 */
90static struct iommu_table *iommu_table_find(struct iommu_table * tbl) 90static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
91{ 91{
92 struct iSeries_Device_Node *dp; 92 struct device_node *dp;
93 93
94 list_for_each_entry(dp, &iSeries_Global_Device_List, Device_List) { 94 list_for_each_entry(dp, &iSeries_Global_Device_List, Device_List) {
95 if ((dp->iommu_table != NULL) && 95 struct iommu_table *it = PCI_DN(dp)->iommu_table;
96 (dp->iommu_table->it_type == TCE_PCI) && 96
97 (dp->iommu_table->it_offset == tbl->it_offset) && 97 if ((it != NULL) &&
98 (dp->iommu_table->it_index == tbl->it_index) && 98 (it->it_type == TCE_PCI) &&
99 (dp->iommu_table->it_size == tbl->it_size)) 99 (it->it_offset == tbl->it_offset) &&
100 return dp->iommu_table; 100 (it->it_index == tbl->it_index) &&
101 (it->it_size == tbl->it_size))
102 return it;
101 } 103 }
102 return NULL; 104 return NULL;
103} 105}
@@ -111,7 +113,7 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
111 * 2. TCE table per Bus. 113 * 2. TCE table per Bus.
112 * 3. TCE Table per IOA. 114 * 3. TCE Table per IOA.
113 */ 115 */
114static void iommu_table_getparms(struct iSeries_Device_Node* dn, 116static void iommu_table_getparms(struct device_node *dn,
115 struct iommu_table* tbl) 117 struct iommu_table* tbl)
116{ 118{
117 struct iommu_table_cb *parms; 119 struct iommu_table_cb *parms;
@@ -123,7 +125,7 @@ static void iommu_table_getparms(struct iSeries_Device_Node* dn,
123 memset(parms, 0, sizeof(*parms)); 125 memset(parms, 0, sizeof(*parms));
124 126
125 parms->itc_busno = ISERIES_BUS(dn); 127 parms->itc_busno = ISERIES_BUS(dn);
126 parms->itc_slotno = dn->LogicalSlot; 128 parms->itc_slotno = PCI_DN(dn)->LogicalSlot;
127 parms->itc_virtbus = 0; 129 parms->itc_virtbus = 0;
128 130
129 HvCallXm_getTceTableParms(ISERIES_HV_ADDR(parms)); 131 HvCallXm_getTceTableParms(ISERIES_HV_ADDR(parms));
@@ -143,18 +145,19 @@ static void iommu_table_getparms(struct iSeries_Device_Node* dn,
143} 145}
144 146
145 147
146void iommu_devnode_init_iSeries(struct iSeries_Device_Node *dn) 148void iommu_devnode_init_iSeries(struct device_node *dn)
147{ 149{
148 struct iommu_table *tbl; 150 struct iommu_table *tbl;
151 struct pci_dn *pdn = PCI_DN(dn);
149 152
150 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 153 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
151 154
152 iommu_table_getparms(dn, tbl); 155 iommu_table_getparms(dn, tbl);
153 156
154 /* Look for existing tce table */ 157 /* Look for existing tce table */
155 dn->iommu_table = iommu_table_find(tbl); 158 pdn->iommu_table = iommu_table_find(tbl);
156 if (dn->iommu_table == NULL) 159 if (pdn->iommu_table == NULL)
157 dn->iommu_table = iommu_init_table(tbl); 160 pdn->iommu_table = iommu_init_table(tbl);
158 else 161 else
159 kfree(tbl); 162 kfree(tbl);
160} 163}
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 61a857218bc8..501b1dcbfac5 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -48,7 +48,7 @@ extern unsigned long io_page_mask;
48/* 48/*
49 * Forward declares of prototypes. 49 * Forward declares of prototypes.
50 */ 50 */
51static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn); 51static struct device_node *find_Device_Node(int bus, int devfn);
52static void scan_PHB_slots(struct pci_controller *Phb); 52static void scan_PHB_slots(struct pci_controller *Phb);
53static void scan_EADS_bridge(HvBusNumber Bus, HvSubBusNumber SubBus, int IdSel); 53static void scan_EADS_bridge(HvBusNumber Bus, HvSubBusNumber SubBus, int IdSel);
54static int scan_bridge_slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo *Info); 54static int scan_bridge_slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo *Info);
@@ -85,7 +85,7 @@ static long current_iomm_table_entry;
85/* 85/*
86 * Lookup Tables. 86 * Lookup Tables.
87 */ 87 */
88static struct iSeries_Device_Node **iomm_table; 88static struct device_node **iomm_table;
89static u8 *iobar_table; 89static u8 *iobar_table;
90 90
91/* 91/*
@@ -199,29 +199,35 @@ static void pci_Log_Error(char *Error_Text, int Bus, int SubBus,
199/* 199/*
200 * build_device_node(u16 Bus, int SubBus, u8 DevFn) 200 * build_device_node(u16 Bus, int SubBus, u8 DevFn)
201 */ 201 */
202static struct iSeries_Device_Node *build_device_node(HvBusNumber Bus, 202static struct device_node *build_device_node(HvBusNumber Bus,
203 HvSubBusNumber SubBus, int AgentId, int Function) 203 HvSubBusNumber SubBus, int AgentId, int Function)
204{ 204{
205 struct iSeries_Device_Node *node; 205 struct device_node *node;
206 struct pci_dn *pdn;
206 207
207 PPCDBG(PPCDBG_BUSWALK, 208 PPCDBG(PPCDBG_BUSWALK,
208 "-build_device_node 0x%02X.%02X.%02X Function: %02X\n", 209 "-build_device_node 0x%02X.%02X.%02X Function: %02X\n",
209 Bus, SubBus, AgentId, Function); 210 Bus, SubBus, AgentId, Function);
210 211
211 node = kmalloc(sizeof(struct iSeries_Device_Node), GFP_KERNEL); 212 node = kmalloc(sizeof(struct device_node), GFP_KERNEL);
212 if (node == NULL) 213 if (node == NULL)
213 return NULL; 214 return NULL;
214 215 memset(node, 0, sizeof(struct device_node));
215 memset(node, 0, sizeof(struct iSeries_Device_Node)); 216 pdn = kzalloc(sizeof(*pdn), GFP_KERNEL);
217 if (pdn == NULL) {
218 kfree(node);
219 return NULL;
220 }
221 node->data = pdn;
216 list_add_tail(&node->Device_List, &iSeries_Global_Device_List); 222 list_add_tail(&node->Device_List, &iSeries_Global_Device_List);
217#if 0 223#if 0
218 node->DsaAddr = ((u64)Bus << 48) + ((u64)SubBus << 40) + ((u64)0x10 << 32); 224 pdn->DsaAddr = ((u64)Bus << 48) + ((u64)SubBus << 40) + ((u64)0x10 << 32);
219#endif 225#endif
220 node->DsaAddr.DsaAddr = 0; 226 pdn->DsaAddr.DsaAddr = 0;
221 node->DsaAddr.Dsa.busNumber = Bus; 227 pdn->DsaAddr.Dsa.busNumber = Bus;
222 node->DsaAddr.Dsa.subBusNumber = SubBus; 228 pdn->DsaAddr.Dsa.subBusNumber = SubBus;
223 node->DsaAddr.Dsa.deviceId = 0x10; 229 pdn->DsaAddr.Dsa.deviceId = 0x10;
224 node->DevFn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function); 230 pdn->devfn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function);
225 return node; 231 return node;
226} 232}
227 233
@@ -294,7 +300,7 @@ void iSeries_pcibios_init(void)
294void __init iSeries_pci_final_fixup(void) 300void __init iSeries_pci_final_fixup(void)
295{ 301{
296 struct pci_dev *pdev = NULL; 302 struct pci_dev *pdev = NULL;
297 struct iSeries_Device_Node *node; 303 struct device_node *node;
298 int DeviceCount = 0; 304 int DeviceCount = 0;
299 305
300 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n"); 306 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n");
@@ -311,7 +317,7 @@ void __init iSeries_pci_final_fixup(void)
311 if (node != NULL) { 317 if (node != NULL) {
312 ++DeviceCount; 318 ++DeviceCount;
313 pdev->sysdata = (void *)node; 319 pdev->sysdata = (void *)node;
314 node->PciDev = pdev; 320 PCI_DN(node)->pcidev = pdev;
315 PPCDBG(PPCDBG_BUSWALK, 321 PPCDBG(PPCDBG_BUSWALK,
316 "pdev 0x%p <==> DevNode 0x%p\n", 322 "pdev 0x%p <==> DevNode 0x%p\n",
317 pdev, node); 323 pdev, node);
@@ -321,7 +327,7 @@ void __init iSeries_pci_final_fixup(void)
321 } else 327 } else
322 printk("PCI: Device Tree not found for 0x%016lX\n", 328 printk("PCI: Device Tree not found for 0x%016lX\n",
323 (unsigned long)pdev); 329 (unsigned long)pdev);
324 pdev->irq = node->Irq; 330 pdev->irq = PCI_DN(node)->Irq;
325 } 331 }
326 iSeries_activate_IRQs(); 332 iSeries_activate_IRQs();
327 mf_display_src(0xC9000200); 333 mf_display_src(0xC9000200);
@@ -439,7 +445,7 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
439static int scan_bridge_slot(HvBusNumber Bus, 445static int scan_bridge_slot(HvBusNumber Bus,
440 struct HvCallPci_BridgeInfo *BridgeInfo) 446 struct HvCallPci_BridgeInfo *BridgeInfo)
441{ 447{
442 struct iSeries_Device_Node *node; 448 struct device_node *node;
443 HvSubBusNumber SubBus = BridgeInfo->subBusNumber; 449 HvSubBusNumber SubBus = BridgeInfo->subBusNumber;
444 u16 VendorId = 0; 450 u16 VendorId = 0;
445 int HvRc = 0; 451 int HvRc = 0;
@@ -489,8 +495,8 @@ static int scan_bridge_slot(HvBusNumber Bus,
489 495
490 ++DeviceCount; 496 ++DeviceCount;
491 node = build_device_node(Bus, SubBus, EADsIdSel, Function); 497 node = build_device_node(Bus, SubBus, EADsIdSel, Function);
492 node->Irq = Irq; 498 PCI_DN(node)->Irq = Irq;
493 node->LogicalSlot = BridgeInfo->logicalSlotNumber; 499 PCI_DN(node)->LogicalSlot = BridgeInfo->logicalSlotNumber;
494 500
495 } /* for (Function = 0; Function < 8; ++Function) */ 501 } /* for (Function = 0; Function < 8; ++Function) */
496 } /* for (IdSel = 1; IdSel <= MaxAgents; ++IdSel) */ 502 } /* for (IdSel = 1; IdSel <= MaxAgents; ++IdSel) */
@@ -540,15 +546,16 @@ EXPORT_SYMBOL(iSeries_memcpy_fromio);
540/* 546/*
541 * Look down the chain to find the matching Device Device 547 * Look down the chain to find the matching Device Device
542 */ 548 */
543static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn) 549static struct device_node *find_Device_Node(int bus, int devfn)
544{ 550{
545 struct list_head *pos; 551 struct list_head *pos;
546 552
547 list_for_each(pos, &iSeries_Global_Device_List) { 553 list_for_each(pos, &iSeries_Global_Device_List) {
548 struct iSeries_Device_Node *node = 554 struct device_node *node =
549 list_entry(pos, struct iSeries_Device_Node, Device_List); 555 list_entry(pos, struct device_node, Device_List);
550 556
551 if ((bus == ISERIES_BUS(node)) && (devfn == node->DevFn)) 557 if ((bus == ISERIES_BUS(node)) &&
558 (devfn == PCI_DN(node)->devfn))
552 return node; 559 return node;
553 } 560 }
554 return NULL; 561 return NULL;
@@ -560,12 +567,12 @@ static struct iSeries_Device_Node *find_Device_Node(int bus, int devfn)
560 * Sanity Check Node PciDev to passed pci_dev 567 * Sanity Check Node PciDev to passed pci_dev
561 * If none is found, returns a NULL which the client must handle. 568 * If none is found, returns a NULL which the client must handle.
562 */ 569 */
563static struct iSeries_Device_Node *get_Device_Node(struct pci_dev *pdev) 570static struct device_node *get_Device_Node(struct pci_dev *pdev)
564{ 571{
565 struct iSeries_Device_Node *node; 572 struct device_node *node;
566 573
567 node = pdev->sysdata; 574 node = pdev->sysdata;
568 if (node == NULL || node->PciDev != pdev) 575 if (node == NULL || PCI_DN(node)->pcidev != pdev)
569 node = find_Device_Node(pdev->bus->number, pdev->devfn); 576 node = find_Device_Node(pdev->bus->number, pdev->devfn);
570 return node; 577 return node;
571} 578}
@@ -593,7 +600,7 @@ static u64 hv_cfg_write_func[4] = {
593static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn, 600static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
594 int offset, int size, u32 *val) 601 int offset, int size, u32 *val)
595{ 602{
596 struct iSeries_Device_Node *node = find_Device_Node(bus->number, devfn); 603 struct device_node *node = find_Device_Node(bus->number, devfn);
597 u64 fn; 604 u64 fn;
598 struct HvCallPci_LoadReturn ret; 605 struct HvCallPci_LoadReturn ret;
599 606
@@ -605,7 +612,7 @@ static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
605 } 612 }
606 613
607 fn = hv_cfg_read_func[(size - 1) & 3]; 614 fn = hv_cfg_read_func[(size - 1) & 3];
608 HvCall3Ret16(fn, &ret, node->DsaAddr.DsaAddr, offset, 0); 615 HvCall3Ret16(fn, &ret, PCI_DN(node)->DsaAddr.DsaAddr, offset, 0);
609 616
610 if (ret.rc != 0) { 617 if (ret.rc != 0) {
611 *val = ~0; 618 *val = ~0;
@@ -623,7 +630,7 @@ static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
623static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn, 630static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
624 int offset, int size, u32 val) 631 int offset, int size, u32 val)
625{ 632{
626 struct iSeries_Device_Node *node = find_Device_Node(bus->number, devfn); 633 struct device_node *node = find_Device_Node(bus->number, devfn);
627 u64 fn; 634 u64 fn;
628 u64 ret; 635 u64 ret;
629 636
@@ -633,7 +640,7 @@ static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
633 return PCIBIOS_BAD_REGISTER_NUMBER; 640 return PCIBIOS_BAD_REGISTER_NUMBER;
634 641
635 fn = hv_cfg_write_func[(size - 1) & 3]; 642 fn = hv_cfg_write_func[(size - 1) & 3];
636 ret = HvCall4(fn, node->DsaAddr.DsaAddr, offset, val, 0); 643 ret = HvCall4(fn, PCI_DN(node)->DsaAddr.DsaAddr, offset, val, 0);
637 644
638 if (ret != 0) 645 if (ret != 0)
639 return PCIBIOS_DEVICE_NOT_FOUND; 646 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -655,14 +662,16 @@ static struct pci_ops iSeries_pci_ops = {
655 * PCI: Device 23.90 ReadL Retry( 1) 662 * PCI: Device 23.90 ReadL Retry( 1)
656 * PCI: Device 23.90 ReadL Retry Successful(1) 663 * PCI: Device 23.90 ReadL Retry Successful(1)
657 */ 664 */
658static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode, 665static int CheckReturnCode(char *TextHdr, struct device_node *DevNode,
659 int *retry, u64 ret) 666 int *retry, u64 ret)
660{ 667{
661 if (ret != 0) { 668 if (ret != 0) {
669 struct pci_dn *pdn = PCI_DN(DevNode);
670
662 ++Pci_Error_Count; 671 ++Pci_Error_Count;
663 (*retry)++; 672 (*retry)++;
664 printk("PCI: %s: Device 0x%04X:%02X I/O Error(%2d): 0x%04X\n", 673 printk("PCI: %s: Device 0x%04X:%02X I/O Error(%2d): 0x%04X\n",
665 TextHdr, DevNode->DsaAddr.Dsa.busNumber, DevNode->DevFn, 674 TextHdr, pdn->DsaAddr.Dsa.busNumber, pdn->devfn,
666 *retry, (int)ret); 675 *retry, (int)ret);
667 /* 676 /*
668 * Bump the retry and check for retry count exceeded. 677 * Bump the retry and check for retry count exceeded.
@@ -685,14 +694,14 @@ static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode,
685 * Note: Make sure the passed variable end up on the stack to avoid 694 * Note: Make sure the passed variable end up on the stack to avoid
686 * the exposure of being device global. 695 * the exposure of being device global.
687 */ 696 */
688static inline struct iSeries_Device_Node *xlate_iomm_address( 697static inline struct device_node *xlate_iomm_address(
689 const volatile void __iomem *IoAddress, 698 const volatile void __iomem *IoAddress,
690 u64 *dsaptr, u64 *BarOffsetPtr) 699 u64 *dsaptr, u64 *BarOffsetPtr)
691{ 700{
692 unsigned long OrigIoAddr; 701 unsigned long OrigIoAddr;
693 unsigned long BaseIoAddr; 702 unsigned long BaseIoAddr;
694 unsigned long TableIndex; 703 unsigned long TableIndex;
695 struct iSeries_Device_Node *DevNode; 704 struct device_node *DevNode;
696 705
697 OrigIoAddr = (unsigned long __force)IoAddress; 706 OrigIoAddr = (unsigned long __force)IoAddress;
698 if ((OrigIoAddr < BASE_IO_MEMORY) || (OrigIoAddr >= max_io_memory)) 707 if ((OrigIoAddr < BASE_IO_MEMORY) || (OrigIoAddr >= max_io_memory))
@@ -703,7 +712,7 @@ static inline struct iSeries_Device_Node *xlate_iomm_address(
703 712
704 if (DevNode != NULL) { 713 if (DevNode != NULL) {
705 int barnum = iobar_table[TableIndex]; 714 int barnum = iobar_table[TableIndex];
706 *dsaptr = DevNode->DsaAddr.DsaAddr | (barnum << 24); 715 *dsaptr = PCI_DN(DevNode)->DsaAddr.DsaAddr | (barnum << 24);
707 *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE; 716 *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE;
708 } else 717 } else
709 panic("PCI: Invalid PCI IoAddress detected!\n"); 718 panic("PCI: Invalid PCI IoAddress detected!\n");
@@ -725,7 +734,7 @@ u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
725 u64 dsa; 734 u64 dsa;
726 int retry = 0; 735 int retry = 0;
727 struct HvCallPci_LoadReturn ret; 736 struct HvCallPci_LoadReturn ret;
728 struct iSeries_Device_Node *DevNode = 737 struct device_node *DevNode =
729 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 738 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
730 739
731 if (DevNode == NULL) { 740 if (DevNode == NULL) {
@@ -755,7 +764,7 @@ u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
755 u64 dsa; 764 u64 dsa;
756 int retry = 0; 765 int retry = 0;
757 struct HvCallPci_LoadReturn ret; 766 struct HvCallPci_LoadReturn ret;
758 struct iSeries_Device_Node *DevNode = 767 struct device_node *DevNode =
759 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 768 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
760 769
761 if (DevNode == NULL) { 770 if (DevNode == NULL) {
@@ -786,7 +795,7 @@ u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
786 u64 dsa; 795 u64 dsa;
787 int retry = 0; 796 int retry = 0;
788 struct HvCallPci_LoadReturn ret; 797 struct HvCallPci_LoadReturn ret;
789 struct iSeries_Device_Node *DevNode = 798 struct device_node *DevNode =
790 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 799 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
791 800
792 if (DevNode == NULL) { 801 if (DevNode == NULL) {
@@ -824,7 +833,7 @@ void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
824 u64 dsa; 833 u64 dsa;
825 int retry = 0; 834 int retry = 0;
826 u64 rc; 835 u64 rc;
827 struct iSeries_Device_Node *DevNode = 836 struct device_node *DevNode =
828 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 837 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
829 838
830 if (DevNode == NULL) { 839 if (DevNode == NULL) {
@@ -852,7 +861,7 @@ void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
852 u64 dsa; 861 u64 dsa;
853 int retry = 0; 862 int retry = 0;
854 u64 rc; 863 u64 rc;
855 struct iSeries_Device_Node *DevNode = 864 struct device_node *DevNode =
856 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 865 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
857 866
858 if (DevNode == NULL) { 867 if (DevNode == NULL) {
@@ -880,7 +889,7 @@ void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
880 u64 dsa; 889 u64 dsa;
881 int retry = 0; 890 int retry = 0;
882 u64 rc; 891 u64 rc;
883 struct iSeries_Device_Node *DevNode = 892 struct device_node *DevNode =
884 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 893 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
885 894
886 if (DevNode == NULL) { 895 if (DevNode == NULL) {
diff --git a/arch/powerpc/platforms/iseries/vpdinfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c
index 8b62f3bf1d26..d8a6796924e2 100644
--- a/arch/powerpc/platforms/iseries/vpdinfo.c
+++ b/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -240,7 +240,7 @@ out_free:
240 */ 240 */
241void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) 241void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
242{ 242{
243 struct iSeries_Device_Node *DevNode = PciDev->sysdata; 243 struct device_node *DevNode = PciDev->sysdata;
244 u16 bus; 244 u16 bus;
245 u8 frame; 245 u8 frame;
246 char card[4]; 246 char card[4];
diff --git a/arch/ppc64/kernel/pci_iommu.c b/arch/ppc64/kernel/pci_iommu.c
index 19362ea11572..6c9dc67f59d8 100644
--- a/arch/ppc64/kernel/pci_iommu.c
+++ b/arch/ppc64/kernel/pci_iommu.c
@@ -61,13 +61,7 @@ static inline struct iommu_table *devnode_table(struct device *dev)
61 } else 61 } else
62 pdev = to_pci_dev(dev); 62 pdev = to_pci_dev(dev);
63 63
64#ifdef CONFIG_PPC_ISERIES
65 return ISERIES_DEVNODE(pdev)->iommu_table;
66#endif /* CONFIG_PPC_ISERIES */
67
68#ifdef CONFIG_PPC_MULTIPLATFORM
69 return PCI_DN(PCI_GET_DN(pdev))->iommu_table; 64 return PCI_DN(PCI_GET_DN(pdev))->iommu_table;
70#endif /* CONFIG_PPC_MULTIPLATFORM */
71} 65}
72 66
73 67
diff --git a/include/asm-ppc64/iSeries/iSeries_pci.h b/include/asm-ppc64/iSeries/iSeries_pci.h
index 575f611f8b33..a4d88b49fd9f 100644
--- a/include/asm-ppc64/iSeries/iSeries_pci.h
+++ b/include/asm-ppc64/iSeries/iSeries_pci.h
@@ -30,21 +30,19 @@
30 * End Change Activity 30 * End Change Activity
31 */ 31 */
32 32
33#include <asm/iSeries/HvCallPci.h>
34#include <asm/abs_addr.h> 33#include <asm/abs_addr.h>
34#include <asm/prom.h>
35#include <asm/pci-bridge.h>
35 36
36struct pci_dev; /* For Forward Reference */ 37struct pci_dev; /* For Forward Reference */
37struct iSeries_Device_Node;
38 38
39/* 39/*
40 * Gets iSeries Bus, SubBus, DevFn using iSeries_Device_Node structure 40 * Gets iSeries Bus, SubBus, DevFn using device_node structure
41 */ 41 */
42 42
43#define ISERIES_BUS(DevPtr) DevPtr->DsaAddr.Dsa.busNumber 43#define ISERIES_BUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.busNumber
44#define ISERIES_SUBBUS(DevPtr) DevPtr->DsaAddr.Dsa.subBusNumber 44#define ISERIES_SUBBUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.subBusNumber
45#define ISERIES_DEVICE(DevPtr) DevPtr->DsaAddr.Dsa.deviceId 45#define ISERIES_DEVNODE(PciDev) ((struct device_node *)PciDev->sysdata)
46#define ISERIES_DSA(DevPtr) DevPtr->DsaAddr.DsaAddr
47#define ISERIES_DEVNODE(PciDev) ((struct iSeries_Device_Node *)PciDev->sysdata)
48 46
49#define EADsMaxAgents 7 47#define EADsMaxAgents 7
50 48
@@ -67,22 +65,6 @@ struct iSeries_Device_Node;
67#define ISERIES_HV_ADDR(virtaddr) \ 65#define ISERIES_HV_ADDR(virtaddr) \
68 (0x8000000000000000 | virt_to_abs(virtaddr)) 66 (0x8000000000000000 | virt_to_abs(virtaddr))
69 67
70/*
71 * iSeries Device Information
72 */
73struct iSeries_Device_Node {
74 struct list_head Device_List;
75 struct pci_dev *PciDev;
76 union HvDsaMap DsaAddr; /* Direct Select Address */
77 /* busNumber, subBusNumber, */
78 /* deviceId, barNumber */
79 int DevFn; /* Linux devfn */
80 int Irq; /* Assigned IRQ */
81 int Flags; /* Possible flags(disable/bist)*/
82 u8 LogicalSlot; /* Hv Slot Index for Tces */
83 struct iommu_table *iommu_table;/* Device TCE Table */
84};
85
86extern void iSeries_Device_Information(struct pci_dev*, int); 68extern void iSeries_Device_Information(struct pci_dev*, int);
87 69
88#endif /* _ISERIES_64_PCI_H */ 70#endif /* _ISERIES_64_PCI_H */
diff --git a/include/asm-ppc64/iommu.h b/include/asm-ppc64/iommu.h
index a6a173d49506..d096faf4191e 100644
--- a/include/asm-ppc64/iommu.h
+++ b/include/asm-ppc64/iommu.h
@@ -49,6 +49,7 @@ struct iommu_table {
49}; 49};
50 50
51struct scatterlist; 51struct scatterlist;
52struct device_node;
52 53
53#ifdef CONFIG_PPC_MULTIPLATFORM 54#ifdef CONFIG_PPC_MULTIPLATFORM
54 55
@@ -70,9 +71,8 @@ extern void iommu_devnode_init_pSeries(struct device_node *dn);
70 71
71#ifdef CONFIG_PPC_ISERIES 72#ifdef CONFIG_PPC_ISERIES
72 73
73struct iSeries_Device_Node;
74/* Creates table for an individual device node */ 74/* Creates table for an individual device node */
75extern void iommu_devnode_init_iSeries(struct iSeries_Device_Node *dn); 75extern void iommu_devnode_init_iSeries(struct device_node *dn);
76 76
77#endif /* CONFIG_PPC_ISERIES */ 77#endif /* CONFIG_PPC_ISERIES */
78 78
diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h
index d8991389ab39..8ca5fce626bb 100644
--- a/include/asm-ppc64/pci-bridge.h
+++ b/include/asm-ppc64/pci-bridge.h
@@ -4,6 +4,8 @@
4 4
5#include <linux/pci.h> 5#include <linux/pci.h>
6 6
7#include <asm/iSeries/HvCallPci.h>
8
7/* 9/*
8 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
@@ -71,6 +73,14 @@ struct pci_dn {
71 struct iommu_table *iommu_table; /* for phb's or bridges */ 73 struct iommu_table *iommu_table; /* for phb's or bridges */
72 struct pci_dev *pcidev; /* back-pointer to the pci device */ 74 struct pci_dev *pcidev; /* back-pointer to the pci device */
73 struct device_node *node; /* back-pointer to the device_node */ 75 struct device_node *node; /* back-pointer to the device_node */
76#ifdef CONFIG_PPC_ISERIES
77 union HvDsaMap DsaAddr; /* Direct Select Address */
78 /* busNumber, subBusNumber, */
79 /* deviceId, barNumber */
80 int Irq; /* Assigned IRQ */
81 int Flags; /* Possible flags(disable/bist)*/
82 u8 LogicalSlot; /* Hv Slot Index for Tces */
83#endif
74 u32 config_space[16]; /* saved PCI config space */ 84 u32 config_space[16]; /* saved PCI config space */
75}; 85};
76 86
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index c02ec1d6b909..cf0284e081ea 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -137,6 +137,9 @@ struct device_node {
137 struct kref kref; 137 struct kref kref;
138 unsigned long _flags; 138 unsigned long _flags;
139 void *data; 139 void *data;
140#ifdef CONFIG_PPC_ISERIES
141 struct list_head Device_List;
142#endif
140}; 143};
141 144
142extern struct device_node *of_chosen; 145extern struct device_node *of_chosen;