aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2005-10-14 01:06:10 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2005-10-14 01:06:10 -0400
commitbffa8fc3835b0d3c4a59af8aceeea3aba823b032 (patch)
tree53f46e4aef2f9b6afdaa55f82136d67b66de7dec /arch
parent426c1a11a677e39a8c8ed744a521d0f4cb2e417e (diff)
powerpc: remove ISERIES_[SUB]BUS macros
This allows us to simplify a couple of things. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c11
-rw-r--r--arch/powerpc/platforms/iseries/pci.h9
-rw-r--r--arch/powerpc/platforms/iseries/vpdinfo.c7
3 files changed, 10 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index e6f4a4ab57b8..533d9b467402 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -31,10 +31,9 @@
31#include <asm/tce.h> 31#include <asm/tce.h>
32#include <asm/machdep.h> 32#include <asm/machdep.h>
33#include <asm/abs_addr.h> 33#include <asm/abs_addr.h>
34#include <asm/pci-bridge.h>
34#include <asm/iSeries/HvCallXm.h> 35#include <asm/iSeries/HvCallXm.h>
35 36
36#include "pci.h"
37
38extern struct list_head iSeries_Global_Device_List; 37extern struct list_head iSeries_Global_Device_List;
39 38
40 39
@@ -114,7 +113,7 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
114 * 2. TCE table per Bus. 113 * 2. TCE table per Bus.
115 * 3. TCE Table per IOA. 114 * 3. TCE Table per IOA.
116 */ 115 */
117static void iommu_table_getparms(struct device_node *dn, 116static void iommu_table_getparms(struct pci_dn *pdn,
118 struct iommu_table* tbl) 117 struct iommu_table* tbl)
119{ 118{
120 struct iommu_table_cb *parms; 119 struct iommu_table_cb *parms;
@@ -125,8 +124,8 @@ static void iommu_table_getparms(struct device_node *dn,
125 124
126 memset(parms, 0, sizeof(*parms)); 125 memset(parms, 0, sizeof(*parms));
127 126
128 parms->itc_busno = ISERIES_BUS(dn); 127 parms->itc_busno = pdn->DsaAddr.Dsa.busNumber;
129 parms->itc_slotno = PCI_DN(dn)->LogicalSlot; 128 parms->itc_slotno = pdn->LogicalSlot;
130 parms->itc_virtbus = 0; 129 parms->itc_virtbus = 0;
131 130
132 HvCallXm_getTceTableParms(iseries_hv_addr(parms)); 131 HvCallXm_getTceTableParms(iseries_hv_addr(parms));
@@ -153,7 +152,7 @@ void iommu_devnode_init_iSeries(struct device_node *dn)
153 152
154 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 153 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
155 154
156 iommu_table_getparms(dn, tbl); 155 iommu_table_getparms(pdn, tbl);
157 156
158 /* Look for existing tce table */ 157 /* Look for existing tce table */
159 pdn->iommu_table = iommu_table_find(tbl); 158 pdn->iommu_table = iommu_table_find(tbl);
diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h
index e7d92504cb05..94b4bfdceadf 100644
--- a/arch/powerpc/platforms/iseries/pci.h
+++ b/arch/powerpc/platforms/iseries/pci.h
@@ -30,18 +30,9 @@
30 * End Change Activity 30 * End Change Activity
31 */ 31 */
32 32
33#include <asm/pci-bridge.h>
34
35struct pci_dev; /* For Forward Reference */ 33struct pci_dev; /* For Forward Reference */
36 34
37/* 35/*
38 * Gets iSeries Bus, SubBus, DevFn using device_node structure
39 */
40
41#define ISERIES_BUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.busNumber
42#define ISERIES_SUBBUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.subBusNumber
43
44/*
45 * Decodes Linux DevFn to iSeries DevFn, bridge device, or function. 36 * Decodes Linux DevFn to iSeries DevFn, bridge device, or function.
46 * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h 37 * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h
47 */ 38 */
diff --git a/arch/powerpc/platforms/iseries/vpdinfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c
index 6bd8da4f17fe..dcdac995565c 100644
--- a/arch/powerpc/platforms/iseries/vpdinfo.c
+++ b/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -31,6 +31,7 @@
31#include <asm/types.h> 31#include <asm/types.h>
32#include <asm/resource.h> 32#include <asm/resource.h>
33#include <asm/abs_addr.h> 33#include <asm/abs_addr.h>
34#include <asm/pci-bridge.h>
34#include <asm/iSeries/HvCallPci.h> 35#include <asm/iSeries/HvCallPci.h>
35#include <asm/iSeries/HvTypes.h> 36#include <asm/iSeries/HvTypes.h>
36 37
@@ -243,6 +244,7 @@ out_free:
243void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) 244void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
244{ 245{
245 struct device_node *DevNode = PciDev->sysdata; 246 struct device_node *DevNode = PciDev->sysdata;
247 struct pci_dn *pdn;
246 u16 bus; 248 u16 bus;
247 u8 frame; 249 u8 frame;
248 char card[4]; 250 char card[4];
@@ -255,8 +257,9 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
255 return; 257 return;
256 } 258 }
257 259
258 bus = ISERIES_BUS(DevNode); 260 pdn = PCI_DN(DevNode);
259 subbus = ISERIES_SUBBUS(DevNode); 261 bus = pdn->DsaAddr.Dsa.busNumber;
262 subbus = pdn->DsaAddr.Dsa.subBusNumber;
260 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus), 263 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
261 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)); 264 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
262 iSeries_Get_Location_Code(bus, agent, &frame, card); 265 iSeries_Get_Location_Code(bus, agent, &frame, card);