aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.h (renamed from include/asm-ppc64/iSeries/iSeries_pci.h)19
-rw-r--r--arch/powerpc/platforms/iseries/vpdinfo.c8
-rw-r--r--arch/ppc64/kernel/pci_iommu.c13
-rw-r--r--drivers/net/iseries_veth.c11
-rw-r--r--include/asm-powerpc/iommu.h1
-rw-r--r--include/asm-powerpc/prom.h1
-rw-r--r--include/asm-ppc64/abs_addr.h7
-rw-r--r--include/asm-ppc64/pci-bridge.h1
-rw-r--r--include/asm-ppc64/prom.h1
12 files changed, 43 insertions, 41 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/include/asm-ppc64/iSeries/iSeries_pci.h b/arch/powerpc/platforms/iseries/pci.h
index a4d88b49fd9f..e7d92504cb05 100644
--- a/include/asm-ppc64/iSeries/iSeries_pci.h
+++ b/arch/powerpc/platforms/iseries/pci.h
@@ -1,8 +1,8 @@
1#ifndef _ISERIES_64_PCI_H 1#ifndef _PLATFORMS_ISERIES_PCI_H
2#define _ISERIES_64_PCI_H 2#define _PLATFORMS_ISERIES_PCI_H
3 3
4/* 4/*
5 * File iSeries_pci.h created by Allan Trautman on Tue Feb 20, 2001. 5 * Created by Allan Trautman on Tue Feb 20, 2001.
6 * 6 *
7 * Define some useful macros for the iSeries pci routines. 7 * Define some useful macros for the iSeries pci routines.
8 * Copyright (C) 2001 Allan H Trautman, IBM Corporation 8 * Copyright (C) 2001 Allan H Trautman, IBM Corporation
@@ -30,8 +30,6 @@
30 * End Change Activity 30 * End Change Activity
31 */ 31 */
32 32
33#include <asm/abs_addr.h>
34#include <asm/prom.h>
35#include <asm/pci-bridge.h> 33#include <asm/pci-bridge.h>
36 34
37struct pci_dev; /* For Forward Reference */ 35struct pci_dev; /* For Forward Reference */
@@ -42,9 +40,6 @@ struct pci_dev; /* For Forward Reference */
42 40
43#define ISERIES_BUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.busNumber 41#define ISERIES_BUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.busNumber
44#define ISERIES_SUBBUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.subBusNumber 42#define ISERIES_SUBBUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.subBusNumber
45#define ISERIES_DEVNODE(PciDev) ((struct device_node *)PciDev->sysdata)
46
47#define EADsMaxAgents 7
48 43
49/* 44/*
50 * Decodes Linux DevFn to iSeries DevFn, bridge device, or function. 45 * Decodes Linux DevFn to iSeries DevFn, bridge device, or function.
@@ -59,12 +54,6 @@ struct pci_dev; /* For Forward Reference */
59#define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7) 54#define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7)
60#define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7) 55#define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7)
61 56
62/*
63 * Converts Virtual Address to Real Address for Hypervisor calls
64 */
65#define ISERIES_HV_ADDR(virtaddr) \
66 (0x8000000000000000 | virt_to_abs(virtaddr))
67
68extern void iSeries_Device_Information(struct pci_dev*, int); 57extern void iSeries_Device_Information(struct pci_dev*, int);
69 58
70#endif /* _ISERIES_64_PCI_H */ 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
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 3d56cf5a4e23..db3bc2f6f0fa 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -70,8 +70,9 @@
70#include <linux/delay.h> 70#include <linux/delay.h>
71#include <linux/mm.h> 71#include <linux/mm.h>
72#include <linux/ethtool.h> 72#include <linux/ethtool.h>
73
74#include <asm/abs_addr.h>
73#include <asm/iSeries/mf.h> 75#include <asm/iSeries/mf.h>
74#include <asm/iSeries/iSeries_pci.h>
75#include <asm/uaccess.h> 76#include <asm/uaccess.h>
76 77
77#include <asm/iSeries/HvLpConfig.h> 78#include <asm/iSeries/HvLpConfig.h>
@@ -1397,13 +1398,13 @@ static inline void veth_build_dma_list(struct dma_chunk *list,
1397 * it just at the granularity of iSeries real->absolute 1398 * it just at the granularity of iSeries real->absolute
1398 * mapping? Indeed, given the way the allocator works, can we 1399 * mapping? Indeed, given the way the allocator works, can we
1399 * count on them being absolutely contiguous? */ 1400 * count on them being absolutely contiguous? */
1400 list[0].addr = ISERIES_HV_ADDR(p); 1401 list[0].addr = iseries_hv_addr(p);
1401 list[0].size = min(length, 1402 list[0].size = min(length,
1402 PAGE_SIZE - ((unsigned long)p & ~PAGE_MASK)); 1403 PAGE_SIZE - ((unsigned long)p & ~PAGE_MASK));
1403 1404
1404 done = list[0].size; 1405 done = list[0].size;
1405 while (done < length) { 1406 while (done < length) {
1406 list[i].addr = ISERIES_HV_ADDR(p + done); 1407 list[i].addr = iseries_hv_addr(p + done);
1407 list[i].size = min(length-done, PAGE_SIZE); 1408 list[i].size = min(length-done, PAGE_SIZE);
1408 done += list[i].size; 1409 done += list[i].size;
1409 i++; 1410 i++;
@@ -1496,8 +1497,8 @@ static void veth_receive(struct veth_lpar_connection *cnx,
1496 cnx->dst_inst, 1497 cnx->dst_inst,
1497 HvLpDma_AddressType_RealAddress, 1498 HvLpDma_AddressType_RealAddress,
1498 HvLpDma_AddressType_TceIndex, 1499 HvLpDma_AddressType_TceIndex,
1499 ISERIES_HV_ADDR(&local_list), 1500 iseries_hv_addr(&local_list),
1500 ISERIES_HV_ADDR(&remote_list), 1501 iseries_hv_addr(&remote_list),
1501 length); 1502 length);
1502 if (rc != HvLpDma_Rc_Good) { 1503 if (rc != HvLpDma_Rc_Good) {
1503 dev_kfree_skb_irq(skb); 1504 dev_kfree_skb_irq(skb);
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index f80ec8daf122..9d91bdd667ae 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -21,6 +21,7 @@
21#ifndef _ASM_IOMMU_H 21#ifndef _ASM_IOMMU_H
22#define _ASM_IOMMU_H 22#define _ASM_IOMMU_H
23 23
24#include <linux/config.h>
24#include <asm/types.h> 25#include <asm/types.h>
25#include <linux/spinlock.h> 26#include <linux/spinlock.h>
26#include <linux/device.h> 27#include <linux/device.h>
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index efc40980cb48..8a21791c7cae 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -15,6 +15,7 @@
15 * as published by the Free Software Foundation; either version 15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version. 16 * 2 of the License, or (at your option) any later version.
17 */ 17 */
18#include <linux/config.h>
18#include <linux/types.h> 19#include <linux/types.h>
19#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
20#include <asm/atomic.h> 21#include <asm/atomic.h>
diff --git a/include/asm-ppc64/abs_addr.h b/include/asm-ppc64/abs_addr.h
index 84c24d4cdb71..dc3fc3fefef2 100644
--- a/include/asm-ppc64/abs_addr.h
+++ b/include/asm-ppc64/abs_addr.h
@@ -63,4 +63,11 @@ static inline unsigned long phys_to_abs(unsigned long pa)
63#define virt_to_abs(va) phys_to_abs(__pa(va)) 63#define virt_to_abs(va) phys_to_abs(__pa(va))
64#define abs_to_virt(aa) __va(aa) 64#define abs_to_virt(aa) __va(aa)
65 65
66/*
67 * Converts Virtual Address to Real Address for
68 * Legacy iSeries Hypervisor calls
69 */
70#define iseries_hv_addr(virtaddr) \
71 (0x8000000000000000 | virt_to_abs(virtaddr))
72
66#endif /* _ABS_ADDR_H */ 73#endif /* _ABS_ADDR_H */
diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h
index 56863df18232..01bffca61f89 100644
--- a/include/asm-ppc64/pci-bridge.h
+++ b/include/asm-ppc64/pci-bridge.h
@@ -2,6 +2,7 @@
2#ifndef _ASM_PCI_BRIDGE_H 2#ifndef _ASM_PCI_BRIDGE_H
3#define _ASM_PCI_BRIDGE_H 3#define _ASM_PCI_BRIDGE_H
4 4
5#include <linux/config.h>
5#include <linux/pci.h> 6#include <linux/pci.h>
6#include <linux/list.h> 7#include <linux/list.h>
7 8
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index cf0284e081ea..e8d0d2ab4c0f 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -14,6 +14,7 @@
14 * as published by the Free Software Foundation; either version 14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 */ 16 */
17#include <linux/config.h>
17#include <linux/proc_fs.h> 18#include <linux/proc_fs.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19 20