aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2005-10-14 00:51:42 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2005-10-14 00:51:42 -0400
commit426c1a11a677e39a8c8ed744a521d0f4cb2e417e (patch)
treeefa10517ccd9469cfdf1b4390aeb776a8d3f1ddc /arch
parent190554db7bcd41935827f71d4f6f787673da208a (diff)
powerpc: move iSeries/iSeries_pci.h to platforms/iseries
The only real user of this file outside platforms/iseries was drivers/net/iseries_veth.c but all it wanted was ISERIES_HV_ADDR() so we move that to abs_addr.h (and lowercase it). Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c6
-rw-r--r--arch/powerpc/platforms/iseries/mf.c9
-rw-r--r--arch/powerpc/platforms/iseries/pci.c7
-rw-r--r--arch/powerpc/platforms/iseries/pci.h59
-rw-r--r--arch/powerpc/platforms/iseries/vpdinfo.c8
-rw-r--r--arch/ppc64/kernel/pci_iommu.c13
6 files changed, 81 insertions, 21 deletions
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index e40c50b7cefc..e6f4a4ab57b8 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -30,8 +30,10 @@
30#include <asm/iommu.h> 30#include <asm/iommu.h>
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/iSeries/HvCallXm.h> 34#include <asm/iSeries/HvCallXm.h>
34#include <asm/iSeries/iSeries_pci.h> 35
36#include "pci.h"
35 37
36extern struct list_head iSeries_Global_Device_List; 38extern struct list_head iSeries_Global_Device_List;
37 39
@@ -127,7 +129,7 @@ static void iommu_table_getparms(struct device_node *dn,
127 parms->itc_slotno = PCI_DN(dn)->LogicalSlot; 129 parms->itc_slotno = PCI_DN(dn)->LogicalSlot;
128 parms->itc_virtbus = 0; 130 parms->itc_virtbus = 0;
129 131
130 HvCallXm_getTceTableParms(ISERIES_HV_ADDR(parms)); 132 HvCallXm_getTceTableParms(iseries_hv_addr(parms));
131 133
132 if (parms->itc_size == 0) 134 if (parms->itc_size == 0)
133 panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms); 135 panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms);
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 82f5abab9afa..3f25f7fc79fc 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -36,6 +36,7 @@
36#include <asm/time.h> 36#include <asm/time.h>
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38#include <asm/paca.h> 38#include <asm/paca.h>
39#include <asm/abs_addr.h>
39#include <asm/iSeries/vio.h> 40#include <asm/iSeries/vio.h>
40#include <asm/iSeries/mf.h> 41#include <asm/iSeries/mf.h>
41#include <asm/iSeries/HvLpConfig.h> 42#include <asm/iSeries/HvLpConfig.h>
@@ -1064,10 +1065,10 @@ static void mf_getSrcHistory(char *buffer, int size)
1064 ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex(); 1065 ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
1065 ev->event.data.vsp_cmd.result_code = 0xFF; 1066 ev->event.data.vsp_cmd.result_code = 0xFF;
1066 ev->event.data.vsp_cmd.reserved = 0; 1067 ev->event.data.vsp_cmd.reserved = 0;
1067 ev->event.data.vsp_cmd.sub_data.page[0] = ISERIES_HV_ADDR(pages[0]); 1068 ev->event.data.vsp_cmd.sub_data.page[0] = iseries_hv_addr(pages[0]);
1068 ev->event.data.vsp_cmd.sub_data.page[1] = ISERIES_HV_ADDR(pages[1]); 1069 ev->event.data.vsp_cmd.sub_data.page[1] = iseries_hv_addr(pages[1]);
1069 ev->event.data.vsp_cmd.sub_data.page[2] = ISERIES_HV_ADDR(pages[2]); 1070 ev->event.data.vsp_cmd.sub_data.page[2] = iseries_hv_addr(pages[2]);
1070 ev->event.data.vsp_cmd.sub_data.page[3] = ISERIES_HV_ADDR(pages[3]); 1071 ev->event.data.vsp_cmd.sub_data.page[3] = iseries_hv_addr(pages[3]);
1071 mb(); 1072 mb();
1072 if (signal_event(ev) != 0) 1073 if (signal_event(ev) != 0)
1073 return; 1074 return;
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index f79c5982446b..fe34d1175818 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -34,15 +34,16 @@
34#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
35#include <asm/ppcdebug.h> 35#include <asm/ppcdebug.h>
36#include <asm/iommu.h> 36#include <asm/iommu.h>
37#include <asm/abs_addr.h>
37 38
38#include <asm/iSeries/HvCallPci.h> 39#include <asm/iSeries/HvCallPci.h>
39#include <asm/iSeries/HvCallXm.h> 40#include <asm/iSeries/HvCallXm.h>
40#include <asm/iSeries/iSeries_pci.h>
41#include <asm/iSeries/mf.h> 41#include <asm/iSeries/mf.h>
42 42
43#include <asm/ppc-pci.h> 43#include <asm/ppc-pci.h>
44 44
45#include "irq.h" 45#include "irq.h"
46#include "pci.h"
46 47
47extern unsigned long io_page_mask; 48extern unsigned long io_page_mask;
48 49
@@ -368,7 +369,7 @@ static void scan_PHB_slots(struct pci_controller *Phb)
368 */ 369 */
369 for (IdSel = 1; IdSel < MaxAgents; ++IdSel) { 370 for (IdSel = 1; IdSel < MaxAgents; ++IdSel) {
370 HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel, 371 HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel,
371 ISERIES_HV_ADDR(DevInfo), 372 iseries_hv_addr(DevInfo),
372 sizeof(struct HvCallPci_DeviceInfo)); 373 sizeof(struct HvCallPci_DeviceInfo));
373 if (HvRc == 0) { 374 if (HvRc == 0) {
374 if (DevInfo->deviceType == HvCallPci_NodeDevice) 375 if (DevInfo->deviceType == HvCallPci_NodeDevice)
@@ -409,7 +410,7 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
409 "PCI:Connect EADs: 0x%02X.%02X.%02X\n", 410 "PCI:Connect EADs: 0x%02X.%02X.%02X\n",
410 bus, SubBus, AgentId); 411 bus, SubBus, AgentId);
411 HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId, 412 HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId,
412 ISERIES_HV_ADDR(BridgeInfo), 413 iseries_hv_addr(BridgeInfo),
413 sizeof(struct HvCallPci_BridgeInfo)); 414 sizeof(struct HvCallPci_BridgeInfo));
414 if (HvRc == 0) { 415 if (HvRc == 0) {
415 printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n", 416 printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n",
diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h
new file mode 100644
index 000000000000..e7d92504cb05
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/pci.h
@@ -0,0 +1,59 @@
1#ifndef _PLATFORMS_ISERIES_PCI_H
2#define _PLATFORMS_ISERIES_PCI_H
3
4/*
5 * Created by Allan Trautman on Tue Feb 20, 2001.
6 *
7 * Define some useful macros for the iSeries pci routines.
8 * Copyright (C) 2001 Allan H Trautman, IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the:
22 * Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330,
24 * Boston, MA 02111-1307 USA
25 *
26 * Change Activity:
27 * Created Feb 20, 2001
28 * Added device reset, March 22, 2001
29 * Ported to ppc64, May 25, 2001
30 * End Change Activity
31 */
32
33#include <asm/pci-bridge.h>
34
35struct pci_dev; /* For Forward Reference */
36
37/*
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.
46 * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h
47 */
48
49#define ISERIES_PCI_AGENTID(idsel, func) \
50 (((idsel & 0x0F) << 4) | (func & 0x07))
51#define ISERIES_ENCODE_DEVICE(agentid) \
52 ((0x10) | ((agentid & 0x20) >> 2) | (agentid & 0x07))
53
54#define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7)
55#define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7)
56
57extern void iSeries_Device_Information(struct pci_dev*, int);
58
59#endif /* _PLATFORMS_ISERIES_PCI_H */
diff --git a/arch/powerpc/platforms/iseries/vpdinfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c
index d8a6796924e2..6bd8da4f17fe 100644
--- a/arch/powerpc/platforms/iseries/vpdinfo.c
+++ b/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -27,12 +27,14 @@
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/pci.h> 29#include <linux/pci.h>
30
30#include <asm/types.h> 31#include <asm/types.h>
31#include <asm/resource.h> 32#include <asm/resource.h>
32 33#include <asm/abs_addr.h>
33#include <asm/iSeries/HvCallPci.h> 34#include <asm/iSeries/HvCallPci.h>
34#include <asm/iSeries/HvTypes.h> 35#include <asm/iSeries/HvTypes.h>
35#include <asm/iSeries/iSeries_pci.h> 36
37#include "pci.h"
36 38
37/* 39/*
38 * Size of Bus VPD data 40 * Size of Bus VPD data
@@ -212,7 +214,7 @@ static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
212 printk("PCI: Bus VPD Buffer allocation failure.\n"); 214 printk("PCI: Bus VPD Buffer allocation failure.\n");
213 return; 215 return;
214 } 216 }
215 BusVpdLen = HvCallPci_getBusVpd(bus, ISERIES_HV_ADDR(BusVpdPtr), 217 BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr),
216 BUS_VPDSIZE); 218 BUS_VPDSIZE);
217 if (BusVpdLen == 0) { 219 if (BusVpdLen == 0) {
218 printk("PCI: Bus VPD Buffer zero length.\n"); 220 printk("PCI: Bus VPD Buffer zero length.\n");
diff --git a/arch/ppc64/kernel/pci_iommu.c b/arch/ppc64/kernel/pci_iommu.c
index 2114dc9c59b5..bdf15dbbf4f0 100644
--- a/arch/ppc64/kernel/pci_iommu.c
+++ b/arch/ppc64/kernel/pci_iommu.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/ppc64/kernel/pci_iommu.c 2 * arch/ppc64/kernel/pci_iommu.c
3 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation 3 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
4 * 4 *
5 * Rewrite, cleanup, new allocation schemes: 5 * Rewrite, cleanup, new allocation schemes:
6 * Copyright (C) 2004 Olof Johansson, IBM Corporation 6 * Copyright (C) 2004 Olof Johansson, IBM Corporation
7 * 7 *
8 * Dynamic DMA mapping support, platform-independent parts. 8 * Dynamic DMA mapping support, platform-independent parts.
@@ -11,19 +11,18 @@
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. 13 * (at your option) any later version.
14 * 14 *
15 * This program is distributed in the hope that it will be useful, 15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details. 18 * GNU General Public License for more details.
19 * 19 *
20 * You should have received a copy of the GNU General Public License 20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 23 */
24 24
25 25
26#include <linux/config.h>
27#include <linux/init.h> 26#include <linux/init.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/slab.h> 28#include <linux/slab.h>
@@ -39,10 +38,6 @@
39#include <asm/machdep.h> 38#include <asm/machdep.h>
40#include <asm/ppc-pci.h> 39#include <asm/ppc-pci.h>
41 40
42#ifdef CONFIG_PPC_ISERIES
43#include <asm/iSeries/iSeries_pci.h>
44#endif /* CONFIG_PPC_ISERIES */
45
46/* 41/*
47 * We can use ->sysdata directly and avoid the extra work in 42 * We can use ->sysdata directly and avoid the extra work in
48 * pci_device_to_OF_node since ->sysdata will have been initialised 43 * pci_device_to_OF_node since ->sysdata will have been initialised