diff options
-rw-r--r-- | arch/ppc64/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/iSeries_pci_reset.c | 104 | ||||
-rw-r--r-- | include/asm-ppc64/iSeries/iSeries_pci.h | 3 |
3 files changed, 1 insertions, 108 deletions
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index 96d90b0c5119..9132d927171f 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile | |||
@@ -16,7 +16,7 @@ obj-y += vdso32/ vdso64/ | |||
16 | 16 | ||
17 | obj-$(CONFIG_PPC_OF) += of_device.o | 17 | obj-$(CONFIG_PPC_OF) += of_device.o |
18 | 18 | ||
19 | pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_pci_reset.o | 19 | pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o |
20 | pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o | 20 | pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o |
21 | 21 | ||
22 | obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) | 22 | obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) |
diff --git a/arch/ppc64/kernel/iSeries_pci_reset.c b/arch/ppc64/kernel/iSeries_pci_reset.c deleted file mode 100644 index 0f785e4584f7..000000000000 --- a/arch/ppc64/kernel/iSeries_pci_reset.c +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | #define PCIFR(...) | ||
2 | /************************************************************************/ | ||
3 | /* File iSeries_pci_reset.c created by Allan Trautman on Mar 21 2001. */ | ||
4 | /************************************************************************/ | ||
5 | /* This code supports the pci interface on the IBM iSeries systems. */ | ||
6 | /* Copyright (C) 20yy <Allan H Trautman> <IBM Corp> */ | ||
7 | /* */ | ||
8 | /* This program is free software; you can redistribute it and/or modify */ | ||
9 | /* it under the terms of the GNU General Public License as published by */ | ||
10 | /* the Free Software Foundation; either version 2 of the License, or */ | ||
11 | /* (at your option) any later version. */ | ||
12 | /* */ | ||
13 | /* This program is distributed in the hope that it will be useful, */ | ||
14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | ||
15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | ||
16 | /* GNU General Public License for more details. */ | ||
17 | /* */ | ||
18 | /* You should have received a copy of the GNU General Public License */ | ||
19 | /* along with this program; if not, write to the: */ | ||
20 | /* Free Software Foundation, Inc., */ | ||
21 | /* 59 Temple Place, Suite 330, */ | ||
22 | /* Boston, MA 02111-1307 USA */ | ||
23 | /************************************************************************/ | ||
24 | /* Change Activity: */ | ||
25 | /* Created, March 20, 2001 */ | ||
26 | /* April 30, 2001, Added return codes on functions. */ | ||
27 | /* September 10, 2001, Ported to ppc64. */ | ||
28 | /* End Change Activity */ | ||
29 | /************************************************************************/ | ||
30 | #include <linux/kernel.h> | ||
31 | #include <linux/init.h> | ||
32 | #include <linux/module.h> | ||
33 | #include <linux/pci.h> | ||
34 | #include <linux/irq.h> | ||
35 | #include <linux/delay.h> | ||
36 | |||
37 | #include <asm/io.h> | ||
38 | #include <asm/iSeries/HvCallPci.h> | ||
39 | #include <asm/iSeries/HvTypes.h> | ||
40 | #include <asm/iSeries/mf.h> | ||
41 | #include <asm/pci.h> | ||
42 | |||
43 | #include <asm/iSeries/iSeries_pci.h> | ||
44 | #include "pci.h" | ||
45 | |||
46 | /* | ||
47 | * Interface to toggle the reset line | ||
48 | * Time is in .1 seconds, need for seconds. | ||
49 | */ | ||
50 | int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime, | ||
51 | int DelayTime) | ||
52 | { | ||
53 | unsigned int AssertDelay, WaitDelay; | ||
54 | struct iSeries_Device_Node *DeviceNode = | ||
55 | (struct iSeries_Device_Node *)PciDev->sysdata; | ||
56 | |||
57 | if (DeviceNode == NULL) { | ||
58 | printk("PCI: Pci Reset Failed, Device Node not found for pci_dev %p\n", | ||
59 | PciDev); | ||
60 | return -1; | ||
61 | } | ||
62 | /* | ||
63 | * Set defaults, Assert is .5 second, Wait is 3 seconds. | ||
64 | */ | ||
65 | if (AssertTime == 0) | ||
66 | AssertDelay = 500; | ||
67 | else | ||
68 | AssertDelay = AssertTime * 100; | ||
69 | |||
70 | if (DelayTime == 0) | ||
71 | WaitDelay = 3000; | ||
72 | else | ||
73 | WaitDelay = DelayTime * 100; | ||
74 | |||
75 | /* | ||
76 | * Assert reset | ||
77 | */ | ||
78 | DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), | ||
79 | 0x00, DeviceNode->AgentId, 1); | ||
80 | if (DeviceNode->ReturnCode == 0) { | ||
81 | msleep(AssertDelay); /* Sleep for the time */ | ||
82 | DeviceNode->ReturnCode = | ||
83 | HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), | ||
84 | 0x00, DeviceNode->AgentId, 0); | ||
85 | |||
86 | /* | ||
87 | * Wait for device to reset | ||
88 | */ | ||
89 | msleep(WaitDelay); | ||
90 | } | ||
91 | if (DeviceNode->ReturnCode == 0) | ||
92 | PCIFR("Slot 0x%04X.%02 Reset\n", ISERIES_BUS(DeviceNode), | ||
93 | DeviceNode->AgentId); | ||
94 | else { | ||
95 | printk("PCI: Slot 0x%04X.%02X Reset Failed, RCode: %04X\n", | ||
96 | ISERIES_BUS(DeviceNode), DeviceNode->AgentId, | ||
97 | DeviceNode->ReturnCode); | ||
98 | PCIFR("Slot 0x%04X.%02X Reset Failed, RCode: %04X\n", | ||
99 | ISERIES_BUS(DeviceNode), DeviceNode->AgentId, | ||
100 | DeviceNode->ReturnCode); | ||
101 | } | ||
102 | return DeviceNode->ReturnCode; | ||
103 | } | ||
104 | EXPORT_SYMBOL(iSeries_Device_ToggleReset); | ||
diff --git a/include/asm-ppc64/iSeries/iSeries_pci.h b/include/asm-ppc64/iSeries/iSeries_pci.h index f45cd8a2e7be..4313a6684023 100644 --- a/include/asm-ppc64/iSeries/iSeries_pci.h +++ b/include/asm-ppc64/iSeries/iSeries_pci.h | |||
@@ -92,7 +92,6 @@ struct iSeries_Device_Node { | |||
92 | int DevFn; /* Linux devfn */ | 92 | int DevFn; /* Linux devfn */ |
93 | int BarOffset; | 93 | int BarOffset; |
94 | int Irq; /* Assigned IRQ */ | 94 | int Irq; /* Assigned IRQ */ |
95 | int ReturnCode; /* Return Code Holder */ | ||
96 | int IoRetry; /* Current Retry Count */ | 95 | int IoRetry; /* Current Retry Count */ |
97 | int Flags; /* Possible flags(disable/bist)*/ | 96 | int Flags; /* Possible flags(disable/bist)*/ |
98 | u16 Vendor; /* Vendor ID */ | 97 | u16 Vendor; /* Vendor ID */ |
@@ -107,7 +106,5 @@ struct iSeries_Device_Node { | |||
107 | 106 | ||
108 | extern int iSeries_Device_Information(struct pci_dev*, char*, int); | 107 | extern int iSeries_Device_Information(struct pci_dev*, char*, int); |
109 | extern void iSeries_Get_Location_Code(struct iSeries_Device_Node*); | 108 | extern void iSeries_Get_Location_Code(struct iSeries_Device_Node*); |
110 | extern int iSeries_Device_ToggleReset(struct pci_dev* PciDev, | ||
111 | int AssertTime, int DelayTime); | ||
112 | 109 | ||
113 | #endif /* _ISERIES_64_PCI_H */ | 110 | #endif /* _ISERIES_64_PCI_H */ |