diff options
Diffstat (limited to 'include/asm-ppc64/iSeries')
30 files changed, 3641 insertions, 0 deletions
diff --git a/include/asm-ppc64/iSeries/HvCall.h b/include/asm-ppc64/iSeries/HvCall.h new file mode 100644 index 000000000000..d9a2e74e2399 --- /dev/null +++ b/include/asm-ppc64/iSeries/HvCall.h | |||
@@ -0,0 +1,205 @@ | |||
1 | /* | ||
2 | * HvCall.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | //=========================================================================== | ||
21 | // | ||
22 | // This file contains the "hypervisor call" interface which is used to | ||
23 | // drive the hypervisor from the OS. | ||
24 | // | ||
25 | //=========================================================================== | ||
26 | #ifndef _HVCALL_H | ||
27 | #define _HVCALL_H | ||
28 | |||
29 | //------------------------------------------------------------------- | ||
30 | // Standard Includes | ||
31 | //------------------------------------------------------------------- | ||
32 | #include <asm/iSeries/HvCallSc.h> | ||
33 | #include <asm/iSeries/HvTypes.h> | ||
34 | #include <asm/paca.h> | ||
35 | |||
36 | /* | ||
37 | enum HvCall_ReturnCode | ||
38 | { | ||
39 | HvCall_Good = 0, | ||
40 | HvCall_Partial = 1, | ||
41 | HvCall_NotOwned = 2, | ||
42 | HvCall_NotFreed = 3, | ||
43 | HvCall_UnspecifiedError = 4 | ||
44 | }; | ||
45 | |||
46 | enum HvCall_TypeOfSIT | ||
47 | { | ||
48 | HvCall_ReduceOnly = 0, | ||
49 | HvCall_Unconditional = 1 | ||
50 | }; | ||
51 | |||
52 | enum HvCall_TypeOfYield | ||
53 | { | ||
54 | HvCall_YieldTimed = 0, // Yield until specified time | ||
55 | HvCall_YieldToActive = 1, // Yield until all active procs have run | ||
56 | HvCall_YieldToProc = 2 // Yield until the specified processor has run | ||
57 | }; | ||
58 | |||
59 | enum HvCall_InterruptMasks | ||
60 | { | ||
61 | HvCall_MaskIPI = 0x00000001, | ||
62 | HvCall_MaskLpEvent = 0x00000002, | ||
63 | HvCall_MaskLpProd = 0x00000004, | ||
64 | HvCall_MaskTimeout = 0x00000008 | ||
65 | }; | ||
66 | |||
67 | enum HvCall_VaryOffChunkRc | ||
68 | { | ||
69 | HvCall_VaryOffSucceeded = 0, | ||
70 | HvCall_VaryOffWithdrawn = 1, | ||
71 | HvCall_ChunkInLoadArea = 2, | ||
72 | HvCall_ChunkInHPT = 3, | ||
73 | HvCall_ChunkNotAccessible = 4, | ||
74 | HvCall_ChunkInUse = 5 | ||
75 | }; | ||
76 | */ | ||
77 | |||
78 | /* Type of yield for HvCallBaseYieldProcessor */ | ||
79 | #define HvCall_YieldTimed 0 // Yield until specified time (tb) | ||
80 | #define HvCall_YieldToActive 1 // Yield until all active procs have run | ||
81 | #define HvCall_YieldToProc 2 // Yield until the specified processor has run | ||
82 | |||
83 | /* interrupt masks for setEnabledInterrupts */ | ||
84 | #define HvCall_MaskIPI 0x00000001 | ||
85 | #define HvCall_MaskLpEvent 0x00000002 | ||
86 | #define HvCall_MaskLpProd 0x00000004 | ||
87 | #define HvCall_MaskTimeout 0x00000008 | ||
88 | |||
89 | /* Log buffer formats */ | ||
90 | #define HvCall_LogBuffer_ASCII 0 | ||
91 | #define HvCall_LogBuffer_EBCDIC 1 | ||
92 | |||
93 | #define HvCallBaseAckDeferredInts HvCallBase + 0 | ||
94 | #define HvCallBaseCpmPowerOff HvCallBase + 1 | ||
95 | #define HvCallBaseGetHwPatch HvCallBase + 2 | ||
96 | #define HvCallBaseReIplSpAttn HvCallBase + 3 | ||
97 | #define HvCallBaseSetASR HvCallBase + 4 | ||
98 | #define HvCallBaseSetASRAndRfi HvCallBase + 5 | ||
99 | #define HvCallBaseSetIMR HvCallBase + 6 | ||
100 | #define HvCallBaseSendIPI HvCallBase + 7 | ||
101 | #define HvCallBaseTerminateMachine HvCallBase + 8 | ||
102 | #define HvCallBaseTerminateMachineSrc HvCallBase + 9 | ||
103 | #define HvCallBaseProcessPlicInterrupts HvCallBase + 10 | ||
104 | #define HvCallBaseIsPrimaryCpmOrMsdIpl HvCallBase + 11 | ||
105 | #define HvCallBaseSetVirtualSIT HvCallBase + 12 | ||
106 | #define HvCallBaseVaryOffThisProcessor HvCallBase + 13 | ||
107 | #define HvCallBaseVaryOffMemoryChunk HvCallBase + 14 | ||
108 | #define HvCallBaseVaryOffInteractivePercentage HvCallBase + 15 | ||
109 | #define HvCallBaseSendLpProd HvCallBase + 16 | ||
110 | #define HvCallBaseSetEnabledInterrupts HvCallBase + 17 | ||
111 | #define HvCallBaseYieldProcessor HvCallBase + 18 | ||
112 | #define HvCallBaseVaryOffSharedProcUnits HvCallBase + 19 | ||
113 | #define HvCallBaseSetVirtualDecr HvCallBase + 20 | ||
114 | #define HvCallBaseClearLogBuffer HvCallBase + 21 | ||
115 | #define HvCallBaseGetLogBufferCodePage HvCallBase + 22 | ||
116 | #define HvCallBaseGetLogBufferFormat HvCallBase + 23 | ||
117 | #define HvCallBaseGetLogBufferLength HvCallBase + 24 | ||
118 | #define HvCallBaseReadLogBuffer HvCallBase + 25 | ||
119 | #define HvCallBaseSetLogBufferFormatAndCodePage HvCallBase + 26 | ||
120 | #define HvCallBaseWriteLogBuffer HvCallBase + 27 | ||
121 | #define HvCallBaseRouter28 HvCallBase + 28 | ||
122 | #define HvCallBaseRouter29 HvCallBase + 29 | ||
123 | #define HvCallBaseRouter30 HvCallBase + 30 | ||
124 | #define HvCallBaseSetDebugBus HvCallBase + 31 | ||
125 | |||
126 | #define HvCallCcSetDABR HvCallCc + 7 | ||
127 | |||
128 | //===================================================================================== | ||
129 | static inline void HvCall_setVirtualDecr(void) | ||
130 | { | ||
131 | /* Ignore any error return codes - most likely means that the target value for the | ||
132 | * LP has been increased and this vary off would bring us below the new target. */ | ||
133 | HvCall0(HvCallBaseSetVirtualDecr); | ||
134 | } | ||
135 | //===================================================================== | ||
136 | static inline void HvCall_yieldProcessor(unsigned typeOfYield, u64 yieldParm) | ||
137 | { | ||
138 | HvCall2( HvCallBaseYieldProcessor, typeOfYield, yieldParm ); | ||
139 | } | ||
140 | //===================================================================== | ||
141 | static inline void HvCall_setEnabledInterrupts(u64 enabledInterrupts) | ||
142 | { | ||
143 | HvCall1(HvCallBaseSetEnabledInterrupts,enabledInterrupts); | ||
144 | } | ||
145 | |||
146 | //===================================================================== | ||
147 | static inline void HvCall_clearLogBuffer(HvLpIndex lpindex) | ||
148 | { | ||
149 | HvCall1(HvCallBaseClearLogBuffer,lpindex); | ||
150 | } | ||
151 | |||
152 | //===================================================================== | ||
153 | static inline u32 HvCall_getLogBufferCodePage(HvLpIndex lpindex) | ||
154 | { | ||
155 | u32 retVal = HvCall1(HvCallBaseGetLogBufferCodePage,lpindex); | ||
156 | return retVal; | ||
157 | } | ||
158 | |||
159 | //===================================================================== | ||
160 | static inline int HvCall_getLogBufferFormat(HvLpIndex lpindex) | ||
161 | { | ||
162 | int retVal = HvCall1(HvCallBaseGetLogBufferFormat,lpindex); | ||
163 | return retVal; | ||
164 | } | ||
165 | |||
166 | //===================================================================== | ||
167 | static inline u32 HvCall_getLogBufferLength(HvLpIndex lpindex) | ||
168 | { | ||
169 | u32 retVal = HvCall1(HvCallBaseGetLogBufferLength,lpindex); | ||
170 | return retVal; | ||
171 | } | ||
172 | |||
173 | //===================================================================== | ||
174 | static inline void HvCall_setLogBufferFormatAndCodepage(int format, u32 codePage) | ||
175 | { | ||
176 | HvCall2(HvCallBaseSetLogBufferFormatAndCodePage,format, codePage); | ||
177 | } | ||
178 | |||
179 | //===================================================================== | ||
180 | int HvCall_readLogBuffer(HvLpIndex lpindex, void *buffer, u64 bufLen); | ||
181 | void HvCall_writeLogBuffer(const void *buffer, u64 bufLen); | ||
182 | |||
183 | //===================================================================== | ||
184 | static inline void HvCall_sendIPI(struct paca_struct * targetPaca) | ||
185 | { | ||
186 | HvCall1( HvCallBaseSendIPI, targetPaca->paca_index ); | ||
187 | } | ||
188 | |||
189 | //===================================================================== | ||
190 | static inline void HvCall_terminateMachineSrc(void) | ||
191 | { | ||
192 | HvCall0( HvCallBaseTerminateMachineSrc ); | ||
193 | } | ||
194 | |||
195 | static inline void HvCall_setDABR(unsigned long val) | ||
196 | { | ||
197 | HvCall1(HvCallCcSetDABR, val); | ||
198 | } | ||
199 | |||
200 | static inline void HvCall_setDebugBus(unsigned long val) | ||
201 | { | ||
202 | HvCall1(HvCallBaseSetDebugBus, val); | ||
203 | } | ||
204 | |||
205 | #endif /* _HVCALL_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallCfg.h b/include/asm-ppc64/iSeries/HvCallCfg.h new file mode 100644 index 000000000000..9f40f16de533 --- /dev/null +++ b/include/asm-ppc64/iSeries/HvCallCfg.h | |||
@@ -0,0 +1,213 @@ | |||
1 | /* | ||
2 | * HvCallCfg.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | //===================================================================================== | ||
21 | // | ||
22 | // This file contains the "hypervisor call" interface which is used to | ||
23 | // drive the hypervisor from the OS. | ||
24 | // | ||
25 | //===================================================================================== | ||
26 | #ifndef _HVCALLCFG_H | ||
27 | #define _HVCALLCFG_H | ||
28 | |||
29 | //------------------------------------------------------------------- | ||
30 | // Standard Includes | ||
31 | //------------------------------------------------------------------- | ||
32 | #include <asm/iSeries/HvCallSc.h> | ||
33 | #include <asm/iSeries/HvTypes.h> | ||
34 | |||
35 | //------------------------------------------------------------------------------------- | ||
36 | // Constants | ||
37 | //------------------------------------------------------------------------------------- | ||
38 | |||
39 | enum HvCallCfg_ReqQual | ||
40 | { | ||
41 | HvCallCfg_Cur = 0, | ||
42 | HvCallCfg_Init = 1, | ||
43 | HvCallCfg_Max = 2, | ||
44 | HvCallCfg_Min = 3 | ||
45 | }; | ||
46 | |||
47 | #define HvCallCfgGetLps HvCallCfg + 0 | ||
48 | #define HvCallCfgGetActiveLpMap HvCallCfg + 1 | ||
49 | #define HvCallCfgGetLpVrmIndex HvCallCfg + 2 | ||
50 | #define HvCallCfgGetLpMinSupportedPlicVrmIndex HvCallCfg + 3 | ||
51 | #define HvCallCfgGetLpMinCompatablePlicVrmIndex HvCallCfg + 4 | ||
52 | #define HvCallCfgGetLpVrmName HvCallCfg + 5 | ||
53 | #define HvCallCfgGetSystemPhysicalProcessors HvCallCfg + 6 | ||
54 | #define HvCallCfgGetPhysicalProcessors HvCallCfg + 7 | ||
55 | #define HvCallCfgGetSystemMsChunks HvCallCfg + 8 | ||
56 | #define HvCallCfgGetMsChunks HvCallCfg + 9 | ||
57 | #define HvCallCfgGetInteractivePercentage HvCallCfg + 10 | ||
58 | #define HvCallCfgIsBusDedicated HvCallCfg + 11 | ||
59 | #define HvCallCfgGetBusOwner HvCallCfg + 12 | ||
60 | #define HvCallCfgGetBusAllocation HvCallCfg + 13 | ||
61 | #define HvCallCfgGetBusUnitOwner HvCallCfg + 14 | ||
62 | #define HvCallCfgGetBusUnitAllocation HvCallCfg + 15 | ||
63 | #define HvCallCfgGetVirtualBusPool HvCallCfg + 16 | ||
64 | #define HvCallCfgGetBusUnitInterruptProc HvCallCfg + 17 | ||
65 | #define HvCallCfgGetConfiguredBusUnitsForIntProc HvCallCfg + 18 | ||
66 | #define HvCallCfgGetRioSanBusPool HvCallCfg + 19 | ||
67 | #define HvCallCfgGetSharedPoolIndex HvCallCfg + 20 | ||
68 | #define HvCallCfgGetSharedProcUnits HvCallCfg + 21 | ||
69 | #define HvCallCfgGetNumProcsInSharedPool HvCallCfg + 22 | ||
70 | #define HvCallCfgRouter23 HvCallCfg + 23 | ||
71 | #define HvCallCfgRouter24 HvCallCfg + 24 | ||
72 | #define HvCallCfgRouter25 HvCallCfg + 25 | ||
73 | #define HvCallCfgRouter26 HvCallCfg + 26 | ||
74 | #define HvCallCfgRouter27 HvCallCfg + 27 | ||
75 | #define HvCallCfgGetMinRuntimeMsChunks HvCallCfg + 28 | ||
76 | #define HvCallCfgSetMinRuntimeMsChunks HvCallCfg + 29 | ||
77 | #define HvCallCfgGetVirtualLanIndexMap HvCallCfg + 30 | ||
78 | #define HvCallCfgGetLpExecutionMode HvCallCfg + 31 | ||
79 | #define HvCallCfgGetHostingLpIndex HvCallCfg + 32 | ||
80 | |||
81 | //==================================================================== | ||
82 | static inline HvLpIndex HvCallCfg_getLps(void) | ||
83 | { | ||
84 | HvLpIndex retVal = HvCall0(HvCallCfgGetLps); | ||
85 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
86 | return retVal; | ||
87 | } | ||
88 | //==================================================================== | ||
89 | static inline int HvCallCfg_isBusDedicated(u64 busIndex) | ||
90 | { | ||
91 | int retVal = HvCall1(HvCallCfgIsBusDedicated,busIndex); | ||
92 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
93 | return retVal; | ||
94 | } | ||
95 | //==================================================================== | ||
96 | static inline HvLpIndex HvCallCfg_getBusOwner(u64 busIndex) | ||
97 | { | ||
98 | HvLpIndex retVal = HvCall1(HvCallCfgGetBusOwner,busIndex); | ||
99 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
100 | return retVal; | ||
101 | } | ||
102 | //==================================================================== | ||
103 | static inline HvLpIndexMap HvCallCfg_getBusAllocation(u64 busIndex) | ||
104 | { | ||
105 | HvLpIndexMap retVal = HvCall1(HvCallCfgGetBusAllocation,busIndex); | ||
106 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
107 | return retVal; | ||
108 | } | ||
109 | //==================================================================== | ||
110 | static inline HvLpIndexMap HvCallCfg_getActiveLpMap(void) | ||
111 | { | ||
112 | HvLpIndexMap retVal = HvCall0(HvCallCfgGetActiveLpMap); | ||
113 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
114 | return retVal; | ||
115 | } | ||
116 | //==================================================================== | ||
117 | static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap(HvLpIndex lp) | ||
118 | { | ||
119 | // This is a new function in V5R1 so calls to this on older | ||
120 | // hypervisors will return -1 | ||
121 | u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp); | ||
122 | if(retVal == -1) | ||
123 | retVal = 0; | ||
124 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
125 | return retVal; | ||
126 | } | ||
127 | //=================================================================== | ||
128 | static inline u64 HvCallCfg_getSystemMsChunks(void) | ||
129 | { | ||
130 | u64 retVal = HvCall0(HvCallCfgGetSystemMsChunks); | ||
131 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
132 | return retVal; | ||
133 | } | ||
134 | //=================================================================== | ||
135 | static inline u64 HvCallCfg_getMsChunks(HvLpIndex lp,enum HvCallCfg_ReqQual qual) | ||
136 | { | ||
137 | u64 retVal = HvCall2(HvCallCfgGetMsChunks,lp,qual); | ||
138 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
139 | return retVal; | ||
140 | } | ||
141 | //=================================================================== | ||
142 | static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp) | ||
143 | { | ||
144 | // NOTE: This function was added in v5r1 so older hypervisors will return a -1 value | ||
145 | u64 retVal = HvCall1(HvCallCfgGetMinRuntimeMsChunks,lp); | ||
146 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
147 | return retVal; | ||
148 | } | ||
149 | //=================================================================== | ||
150 | static inline u64 HvCallCfg_setMinRuntimeMsChunks(u64 chunks) | ||
151 | { | ||
152 | u64 retVal = HvCall1(HvCallCfgSetMinRuntimeMsChunks,chunks); | ||
153 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
154 | return retVal; | ||
155 | } | ||
156 | //=================================================================== | ||
157 | static inline u64 HvCallCfg_getSystemPhysicalProcessors(void) | ||
158 | { | ||
159 | u64 retVal = HvCall0(HvCallCfgGetSystemPhysicalProcessors); | ||
160 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
161 | return retVal; | ||
162 | } | ||
163 | //=================================================================== | ||
164 | static inline u64 HvCallCfg_getPhysicalProcessors(HvLpIndex lp,enum HvCallCfg_ReqQual qual) | ||
165 | { | ||
166 | u64 retVal = HvCall2(HvCallCfgGetPhysicalProcessors,lp,qual); | ||
167 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
168 | return retVal; | ||
169 | } | ||
170 | //=================================================================== | ||
171 | static inline u64 HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp, | ||
172 | u16 hvLogicalProcIndex) | ||
173 | { | ||
174 | u64 retVal = HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc,lp,hvLogicalProcIndex); | ||
175 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
176 | return retVal; | ||
177 | |||
178 | } | ||
179 | //================================================================== | ||
180 | static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp) | ||
181 | { | ||
182 | HvLpSharedPoolIndex retVal = | ||
183 | HvCall1(HvCallCfgGetSharedPoolIndex,lp); | ||
184 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
185 | return retVal; | ||
186 | |||
187 | } | ||
188 | //================================================================== | ||
189 | static inline u64 HvCallCfg_getSharedProcUnits(HvLpIndex lp,enum HvCallCfg_ReqQual qual) | ||
190 | { | ||
191 | u64 retVal = HvCall2(HvCallCfgGetSharedProcUnits,lp,qual); | ||
192 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
193 | return retVal; | ||
194 | |||
195 | } | ||
196 | //================================================================== | ||
197 | static inline u64 HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) | ||
198 | { | ||
199 | u16 retVal = HvCall1(HvCallCfgGetNumProcsInSharedPool,sPI); | ||
200 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
201 | return retVal; | ||
202 | |||
203 | } | ||
204 | //================================================================== | ||
205 | static inline HvLpIndex HvCallCfg_getHostingLpIndex(HvLpIndex lp) | ||
206 | { | ||
207 | u64 retVal = HvCall1(HvCallCfgGetHostingLpIndex,lp); | ||
208 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
209 | return retVal; | ||
210 | |||
211 | } | ||
212 | |||
213 | #endif /* _HVCALLCFG_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallEvent.h b/include/asm-ppc64/iSeries/HvCallEvent.h new file mode 100644 index 000000000000..191ddce0c2c6 --- /dev/null +++ b/include/asm-ppc64/iSeries/HvCallEvent.h | |||
@@ -0,0 +1,297 @@ | |||
1 | /* | ||
2 | * HvCallEvent.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | /* | ||
21 | * This file contains the "hypervisor call" interface which is used to | ||
22 | * drive the hypervisor from the OS. | ||
23 | */ | ||
24 | #ifndef _HVCALLEVENT_H | ||
25 | #define _HVCALLEVENT_H | ||
26 | |||
27 | /* | ||
28 | * Standard Includes | ||
29 | */ | ||
30 | #include <asm/iSeries/HvCallSc.h> | ||
31 | #include <asm/iSeries/HvTypes.h> | ||
32 | #include <asm/abs_addr.h> | ||
33 | |||
34 | struct HvLpEvent; | ||
35 | |||
36 | typedef u8 HvLpEvent_Type; | ||
37 | typedef u8 HvLpEvent_AckInd; | ||
38 | typedef u8 HvLpEvent_AckType; | ||
39 | |||
40 | struct HvCallEvent_PackedParms { | ||
41 | u8 xAckType:1; | ||
42 | u8 xAckInd:1; | ||
43 | u8 xRsvd:1; | ||
44 | u8 xTargetLp:5; | ||
45 | u8 xType; | ||
46 | u16 xSubtype; | ||
47 | HvLpInstanceId xSourceInstId; | ||
48 | HvLpInstanceId xTargetInstId; | ||
49 | }; | ||
50 | |||
51 | typedef u8 HvLpDma_Direction; | ||
52 | typedef u8 HvLpDma_AddressType; | ||
53 | |||
54 | struct HvCallEvent_PackedDmaParms { | ||
55 | u8 xDirection:1; | ||
56 | u8 xLocalAddrType:1; | ||
57 | u8 xRemoteAddrType:1; | ||
58 | u8 xRsvd1:5; | ||
59 | HvLpIndex xRemoteLp; | ||
60 | u8 xType; | ||
61 | u8 xRsvd2; | ||
62 | HvLpInstanceId xLocalInstId; | ||
63 | HvLpInstanceId xRemoteInstId; | ||
64 | }; | ||
65 | |||
66 | typedef u64 HvLpEvent_Rc; | ||
67 | typedef u64 HvLpDma_Rc; | ||
68 | |||
69 | #define HvCallEventAckLpEvent HvCallEvent + 0 | ||
70 | #define HvCallEventCancelLpEvent HvCallEvent + 1 | ||
71 | #define HvCallEventCloseLpEventPath HvCallEvent + 2 | ||
72 | #define HvCallEventDmaBufList HvCallEvent + 3 | ||
73 | #define HvCallEventDmaSingle HvCallEvent + 4 | ||
74 | #define HvCallEventDmaToSp HvCallEvent + 5 | ||
75 | #define HvCallEventGetOverflowLpEvents HvCallEvent + 6 | ||
76 | #define HvCallEventGetSourceLpInstanceId HvCallEvent + 7 | ||
77 | #define HvCallEventGetTargetLpInstanceId HvCallEvent + 8 | ||
78 | #define HvCallEventOpenLpEventPath HvCallEvent + 9 | ||
79 | #define HvCallEventSetLpEventStack HvCallEvent + 10 | ||
80 | #define HvCallEventSignalLpEvent HvCallEvent + 11 | ||
81 | #define HvCallEventSignalLpEventParms HvCallEvent + 12 | ||
82 | #define HvCallEventSetInterLpQueueIndex HvCallEvent + 13 | ||
83 | #define HvCallEventSetLpEventQueueInterruptProc HvCallEvent + 14 | ||
84 | #define HvCallEventRouter15 HvCallEvent + 15 | ||
85 | |||
86 | static inline void HvCallEvent_getOverflowLpEvents(u8 queueIndex) | ||
87 | { | ||
88 | HvCall1(HvCallEventGetOverflowLpEvents,queueIndex); | ||
89 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
90 | } | ||
91 | |||
92 | static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex) | ||
93 | { | ||
94 | HvCall1(HvCallEventSetInterLpQueueIndex,queueIndex); | ||
95 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
96 | } | ||
97 | |||
98 | static inline void HvCallEvent_setLpEventStack(u8 queueIndex, | ||
99 | char *eventStackAddr, u32 eventStackSize) | ||
100 | { | ||
101 | u64 abs_addr; | ||
102 | |||
103 | abs_addr = virt_to_abs(eventStackAddr); | ||
104 | HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr, | ||
105 | eventStackSize); | ||
106 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
107 | } | ||
108 | |||
109 | static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, | ||
110 | u16 lpLogicalProcIndex) | ||
111 | { | ||
112 | HvCall2(HvCallEventSetLpEventQueueInterruptProc, queueIndex, | ||
113 | lpLogicalProcIndex); | ||
114 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
115 | } | ||
116 | |||
117 | static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) | ||
118 | { | ||
119 | u64 abs_addr; | ||
120 | HvLpEvent_Rc retVal; | ||
121 | |||
122 | #ifdef DEBUG_SENDEVENT | ||
123 | printk("HvCallEvent_signalLpEvent: *event = %016lx\n ", | ||
124 | (unsigned long)event); | ||
125 | #endif | ||
126 | abs_addr = virt_to_abs(event); | ||
127 | retVal = (HvLpEvent_Rc)HvCall1(HvCallEventSignalLpEvent, abs_addr); | ||
128 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
129 | return retVal; | ||
130 | } | ||
131 | |||
132 | static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, | ||
133 | HvLpEvent_Type type, u16 subtype, HvLpEvent_AckInd ackInd, | ||
134 | HvLpEvent_AckType ackType, HvLpInstanceId sourceInstanceId, | ||
135 | HvLpInstanceId targetInstanceId, u64 correlationToken, | ||
136 | u64 eventData1, u64 eventData2, u64 eventData3, | ||
137 | u64 eventData4, u64 eventData5) | ||
138 | { | ||
139 | HvLpEvent_Rc retVal; | ||
140 | |||
141 | // Pack the misc bits into a single Dword to pass to PLIC | ||
142 | union { | ||
143 | struct HvCallEvent_PackedParms parms; | ||
144 | u64 dword; | ||
145 | } packed; | ||
146 | packed.parms.xAckType = ackType; | ||
147 | packed.parms.xAckInd = ackInd; | ||
148 | packed.parms.xRsvd = 0; | ||
149 | packed.parms.xTargetLp = targetLp; | ||
150 | packed.parms.xType = type; | ||
151 | packed.parms.xSubtype = subtype; | ||
152 | packed.parms.xSourceInstId = sourceInstanceId; | ||
153 | packed.parms.xTargetInstId = targetInstanceId; | ||
154 | |||
155 | retVal = (HvLpEvent_Rc)HvCall7(HvCallEventSignalLpEventParms, | ||
156 | packed.dword, correlationToken, eventData1,eventData2, | ||
157 | eventData3,eventData4, eventData5); | ||
158 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
159 | return retVal; | ||
160 | } | ||
161 | |||
162 | static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) | ||
163 | { | ||
164 | u64 abs_addr; | ||
165 | HvLpEvent_Rc retVal; | ||
166 | |||
167 | abs_addr = virt_to_abs(event); | ||
168 | retVal = (HvLpEvent_Rc)HvCall1(HvCallEventAckLpEvent, abs_addr); | ||
169 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
170 | return retVal; | ||
171 | } | ||
172 | |||
173 | static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) | ||
174 | { | ||
175 | u64 abs_addr; | ||
176 | HvLpEvent_Rc retVal; | ||
177 | |||
178 | abs_addr = virt_to_abs(event); | ||
179 | retVal = (HvLpEvent_Rc)HvCall1(HvCallEventCancelLpEvent, abs_addr); | ||
180 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
181 | return retVal; | ||
182 | } | ||
183 | |||
184 | static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( | ||
185 | HvLpIndex targetLp, HvLpEvent_Type type) | ||
186 | { | ||
187 | HvLpInstanceId retVal; | ||
188 | |||
189 | retVal = HvCall2(HvCallEventGetSourceLpInstanceId, targetLp, type); | ||
190 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
191 | return retVal; | ||
192 | } | ||
193 | |||
194 | static inline HvLpInstanceId HvCallEvent_getTargetLpInstanceId( | ||
195 | HvLpIndex targetLp, HvLpEvent_Type type) | ||
196 | { | ||
197 | HvLpInstanceId retVal; | ||
198 | |||
199 | retVal = HvCall2(HvCallEventGetTargetLpInstanceId, targetLp, type); | ||
200 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
201 | return retVal; | ||
202 | } | ||
203 | |||
204 | static inline void HvCallEvent_openLpEventPath(HvLpIndex targetLp, | ||
205 | HvLpEvent_Type type) | ||
206 | { | ||
207 | HvCall2(HvCallEventOpenLpEventPath, targetLp, type); | ||
208 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
209 | } | ||
210 | |||
211 | static inline void HvCallEvent_closeLpEventPath(HvLpIndex targetLp, | ||
212 | HvLpEvent_Type type) | ||
213 | { | ||
214 | HvCall2(HvCallEventCloseLpEventPath, targetLp, type); | ||
215 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
216 | } | ||
217 | |||
218 | static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, | ||
219 | HvLpIndex remoteLp, HvLpDma_Direction direction, | ||
220 | HvLpInstanceId localInstanceId, | ||
221 | HvLpInstanceId remoteInstanceId, | ||
222 | HvLpDma_AddressType localAddressType, | ||
223 | HvLpDma_AddressType remoteAddressType, | ||
224 | /* Do these need to be converted to absolute addresses? */ | ||
225 | u64 localBufList, u64 remoteBufList, u32 transferLength) | ||
226 | { | ||
227 | HvLpDma_Rc retVal; | ||
228 | // Pack the misc bits into a single Dword to pass to PLIC | ||
229 | union { | ||
230 | struct HvCallEvent_PackedDmaParms parms; | ||
231 | u64 dword; | ||
232 | } packed; | ||
233 | |||
234 | packed.parms.xDirection = direction; | ||
235 | packed.parms.xLocalAddrType = localAddressType; | ||
236 | packed.parms.xRemoteAddrType = remoteAddressType; | ||
237 | packed.parms.xRsvd1 = 0; | ||
238 | packed.parms.xRemoteLp = remoteLp; | ||
239 | packed.parms.xType = type; | ||
240 | packed.parms.xRsvd2 = 0; | ||
241 | packed.parms.xLocalInstId = localInstanceId; | ||
242 | packed.parms.xRemoteInstId = remoteInstanceId; | ||
243 | |||
244 | retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaBufList, | ||
245 | packed.dword, localBufList, remoteBufList, | ||
246 | transferLength); | ||
247 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
248 | return retVal; | ||
249 | } | ||
250 | |||
251 | static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, | ||
252 | HvLpIndex remoteLp, HvLpDma_Direction direction, | ||
253 | HvLpInstanceId localInstanceId, | ||
254 | HvLpInstanceId remoteInstanceId, | ||
255 | HvLpDma_AddressType localAddressType, | ||
256 | HvLpDma_AddressType remoteAddressType, | ||
257 | u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength) | ||
258 | { | ||
259 | HvLpDma_Rc retVal; | ||
260 | // Pack the misc bits into a single Dword to pass to PLIC | ||
261 | union { | ||
262 | struct HvCallEvent_PackedDmaParms parms; | ||
263 | u64 dword; | ||
264 | } packed; | ||
265 | |||
266 | packed.parms.xDirection = direction; | ||
267 | packed.parms.xLocalAddrType = localAddressType; | ||
268 | packed.parms.xRemoteAddrType = remoteAddressType; | ||
269 | packed.parms.xRsvd1 = 0; | ||
270 | packed.parms.xRemoteLp = remoteLp; | ||
271 | packed.parms.xType = type; | ||
272 | packed.parms.xRsvd2 = 0; | ||
273 | packed.parms.xLocalInstId = localInstanceId; | ||
274 | packed.parms.xRemoteInstId = remoteInstanceId; | ||
275 | |||
276 | retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, | ||
277 | packed.dword, localAddrOrTce, remoteAddrOrTce, | ||
278 | transferLength); | ||
279 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
280 | return retVal; | ||
281 | } | ||
282 | |||
283 | static inline HvLpDma_Rc HvCallEvent_dmaToSp(void* local, u32 remote, | ||
284 | u32 length, HvLpDma_Direction dir) | ||
285 | { | ||
286 | u64 abs_addr; | ||
287 | HvLpDma_Rc retVal; | ||
288 | |||
289 | abs_addr = virt_to_abs(local); | ||
290 | retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaToSp, abs_addr, remote, | ||
291 | length, dir); | ||
292 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
293 | return retVal; | ||
294 | } | ||
295 | |||
296 | |||
297 | #endif /* _HVCALLEVENT_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallHpt.h b/include/asm-ppc64/iSeries/HvCallHpt.h new file mode 100644 index 000000000000..da769873d18b --- /dev/null +++ b/include/asm-ppc64/iSeries/HvCallHpt.h | |||
@@ -0,0 +1,127 @@ | |||
1 | /* | ||
2 | * HvCallHpt.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVCALLHPT_H | ||
20 | #define _HVCALLHPT_H | ||
21 | |||
22 | //============================================================================ | ||
23 | // | ||
24 | // This file contains the "hypervisor call" interface which is used to | ||
25 | // drive the hypervisor from the OS. | ||
26 | // | ||
27 | //============================================================================ | ||
28 | |||
29 | #include <asm/iSeries/HvCallSc.h> | ||
30 | #include <asm/iSeries/HvTypes.h> | ||
31 | #include <asm/mmu.h> | ||
32 | |||
33 | //----------------------------------------------------------------------------- | ||
34 | // Constants | ||
35 | //----------------------------------------------------------------------------- | ||
36 | |||
37 | #define HvCallHptGetHptAddress HvCallHpt + 0 | ||
38 | #define HvCallHptGetHptPages HvCallHpt + 1 | ||
39 | #define HvCallHptSetPp HvCallHpt + 5 | ||
40 | #define HvCallHptSetSwBits HvCallHpt + 6 | ||
41 | #define HvCallHptUpdate HvCallHpt + 7 | ||
42 | #define HvCallHptInvalidateNoSyncICache HvCallHpt + 8 | ||
43 | #define HvCallHptGet HvCallHpt + 11 | ||
44 | #define HvCallHptFindNextValid HvCallHpt + 12 | ||
45 | #define HvCallHptFindValid HvCallHpt + 13 | ||
46 | #define HvCallHptAddValidate HvCallHpt + 16 | ||
47 | #define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18 | ||
48 | |||
49 | |||
50 | //============================================================================ | ||
51 | static inline u64 HvCallHpt_getHptAddress(void) | ||
52 | { | ||
53 | u64 retval = HvCall0(HvCallHptGetHptAddress); | ||
54 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
55 | return retval; | ||
56 | } | ||
57 | //============================================================================ | ||
58 | static inline u64 HvCallHpt_getHptPages(void) | ||
59 | { | ||
60 | u64 retval = HvCall0(HvCallHptGetHptPages); | ||
61 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
62 | return retval; | ||
63 | } | ||
64 | //============================================================================= | ||
65 | static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value) | ||
66 | { | ||
67 | HvCall2( HvCallHptSetPp, hpteIndex, value ); | ||
68 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
69 | } | ||
70 | //============================================================================= | ||
71 | static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff ) | ||
72 | { | ||
73 | HvCall3( HvCallHptSetSwBits, hpteIndex, bitson, bitsoff ); | ||
74 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
75 | } | ||
76 | //============================================================================= | ||
77 | static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex) | ||
78 | |||
79 | { | ||
80 | HvCall1( HvCallHptInvalidateNoSyncICache, hpteIndex ); | ||
81 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
82 | } | ||
83 | //============================================================================= | ||
84 | static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, u8 bitsoff ) | ||
85 | |||
86 | { | ||
87 | u64 compressedStatus; | ||
88 | compressedStatus = HvCall4( HvCallHptInvalidateSetSwBitsGet, hpteIndex, bitson, bitsoff, 1 ); | ||
89 | HvCall1( HvCallHptInvalidateNoSyncICache, hpteIndex ); | ||
90 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
91 | return compressedStatus; | ||
92 | } | ||
93 | //============================================================================= | ||
94 | static inline u64 HvCallHpt_findValid( HPTE *hpte, u64 vpn ) | ||
95 | { | ||
96 | u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 ); | ||
97 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
98 | return retIndex; | ||
99 | } | ||
100 | //============================================================================= | ||
101 | static inline u64 HvCallHpt_findNextValid( HPTE *hpte, u32 hpteIndex, u8 bitson, u8 bitsoff ) | ||
102 | { | ||
103 | u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff ); | ||
104 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
105 | return retIndex; | ||
106 | } | ||
107 | //============================================================================= | ||
108 | static inline void HvCallHpt_get( HPTE *hpte, u32 hpteIndex ) | ||
109 | { | ||
110 | HvCall2Ret16( HvCallHptGet, hpte, hpteIndex, 0 ); | ||
111 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
112 | } | ||
113 | //============================================================================ | ||
114 | static inline void HvCallHpt_addValidate( u32 hpteIndex, | ||
115 | u32 hBit, | ||
116 | HPTE *hpte ) | ||
117 | |||
118 | { | ||
119 | HvCall4( HvCallHptAddValidate, hpteIndex, | ||
120 | hBit, (*((u64 *)hpte)), (*(((u64 *)hpte)+1)) ); | ||
121 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
122 | } | ||
123 | |||
124 | |||
125 | //============================================================================= | ||
126 | |||
127 | #endif /* _HVCALLHPT_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallPci.h b/include/asm-ppc64/iSeries/HvCallPci.h new file mode 100644 index 000000000000..6887b619288e --- /dev/null +++ b/include/asm-ppc64/iSeries/HvCallPci.h | |||
@@ -0,0 +1,673 @@ | |||
1 | /************************************************************************/ | ||
2 | /* Provides the Hypervisor PCI calls for iSeries Linux Parition. */ | ||
3 | /* Copyright (C) 2001 <Wayne G Holm> <IBM Corporation> */ | ||
4 | /* */ | ||
5 | /* This program is free software; you can redistribute it and/or modify */ | ||
6 | /* it under the terms of the GNU General Public License as published by */ | ||
7 | /* the Free Software Foundation; either version 2 of the License, or */ | ||
8 | /* (at your option) any later version. */ | ||
9 | /* */ | ||
10 | /* This program is distributed in the hope that it will be useful, */ | ||
11 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | ||
12 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | ||
13 | /* GNU General Public License for more details. */ | ||
14 | /* */ | ||
15 | /* You should have received a copy of the GNU General Public License */ | ||
16 | /* along with this program; if not, write to the: */ | ||
17 | /* Free Software Foundation, Inc., */ | ||
18 | /* 59 Temple Place, Suite 330, */ | ||
19 | /* Boston, MA 02111-1307 USA */ | ||
20 | /************************************************************************/ | ||
21 | /* Change Activity: */ | ||
22 | /* Created, Jan 9, 2001 */ | ||
23 | /************************************************************************/ | ||
24 | |||
25 | #ifndef _HVCALLPCI_H | ||
26 | #define _HVCALLPCI_H | ||
27 | |||
28 | #include <asm/iSeries/HvCallSc.h> | ||
29 | #include <asm/iSeries/HvTypes.h> | ||
30 | |||
31 | /* | ||
32 | * DSA == Direct Select Address | ||
33 | * this struct must be 64 bits in total | ||
34 | */ | ||
35 | struct HvCallPci_DsaAddr { | ||
36 | u16 busNumber; /* PHB index? */ | ||
37 | u8 subBusNumber; /* PCI bus number? */ | ||
38 | u8 deviceId; /* device and function? */ | ||
39 | u8 barNumber; | ||
40 | u8 reserved[3]; | ||
41 | }; | ||
42 | |||
43 | union HvDsaMap { | ||
44 | u64 DsaAddr; | ||
45 | struct HvCallPci_DsaAddr Dsa; | ||
46 | }; | ||
47 | |||
48 | struct HvCallPci_LoadReturn { | ||
49 | u64 rc; | ||
50 | u64 value; | ||
51 | }; | ||
52 | |||
53 | enum HvCallPci_DeviceType { | ||
54 | HvCallPci_NodeDevice = 1, | ||
55 | HvCallPci_SpDevice = 2, | ||
56 | HvCallPci_IopDevice = 3, | ||
57 | HvCallPci_BridgeDevice = 4, | ||
58 | HvCallPci_MultiFunctionDevice = 5, | ||
59 | HvCallPci_IoaDevice = 6 | ||
60 | }; | ||
61 | |||
62 | |||
63 | struct HvCallPci_DeviceInfo { | ||
64 | u32 deviceType; // See DeviceType enum for values | ||
65 | }; | ||
66 | |||
67 | struct HvCallPci_BusUnitInfo { | ||
68 | u32 sizeReturned; // length of data returned | ||
69 | u32 deviceType; // see DeviceType enum for values | ||
70 | }; | ||
71 | |||
72 | struct HvCallPci_BridgeInfo { | ||
73 | struct HvCallPci_BusUnitInfo busUnitInfo; // Generic bus unit info | ||
74 | u8 subBusNumber; // Bus number of secondary bus | ||
75 | u8 maxAgents; // Max idsels on secondary bus | ||
76 | u8 maxSubBusNumber; // Max Sub Bus | ||
77 | u8 logicalSlotNumber; // Logical Slot Number for IOA | ||
78 | }; | ||
79 | |||
80 | |||
81 | // Maximum BusUnitInfo buffer size. Provided for clients so they can allocate | ||
82 | // a buffer big enough for any type of bus unit. Increase as needed. | ||
83 | enum {HvCallPci_MaxBusUnitInfoSize = 128}; | ||
84 | |||
85 | struct HvCallPci_BarParms { | ||
86 | u64 vaddr; | ||
87 | u64 raddr; | ||
88 | u64 size; | ||
89 | u64 protectStart; | ||
90 | u64 protectEnd; | ||
91 | u64 relocationOffset; | ||
92 | u64 pciAddress; | ||
93 | u64 reserved[3]; | ||
94 | }; | ||
95 | |||
96 | enum HvCallPci_VpdType { | ||
97 | HvCallPci_BusVpd = 1, | ||
98 | HvCallPci_BusAdapterVpd = 2 | ||
99 | }; | ||
100 | |||
101 | #define HvCallPciConfigLoad8 HvCallPci + 0 | ||
102 | #define HvCallPciConfigLoad16 HvCallPci + 1 | ||
103 | #define HvCallPciConfigLoad32 HvCallPci + 2 | ||
104 | #define HvCallPciConfigStore8 HvCallPci + 3 | ||
105 | #define HvCallPciConfigStore16 HvCallPci + 4 | ||
106 | #define HvCallPciConfigStore32 HvCallPci + 5 | ||
107 | #define HvCallPciEoi HvCallPci + 16 | ||
108 | #define HvCallPciGetBarParms HvCallPci + 18 | ||
109 | #define HvCallPciMaskFisr HvCallPci + 20 | ||
110 | #define HvCallPciUnmaskFisr HvCallPci + 21 | ||
111 | #define HvCallPciSetSlotReset HvCallPci + 25 | ||
112 | #define HvCallPciGetDeviceInfo HvCallPci + 27 | ||
113 | #define HvCallPciGetCardVpd HvCallPci + 28 | ||
114 | #define HvCallPciBarLoad8 HvCallPci + 40 | ||
115 | #define HvCallPciBarLoad16 HvCallPci + 41 | ||
116 | #define HvCallPciBarLoad32 HvCallPci + 42 | ||
117 | #define HvCallPciBarLoad64 HvCallPci + 43 | ||
118 | #define HvCallPciBarStore8 HvCallPci + 44 | ||
119 | #define HvCallPciBarStore16 HvCallPci + 45 | ||
120 | #define HvCallPciBarStore32 HvCallPci + 46 | ||
121 | #define HvCallPciBarStore64 HvCallPci + 47 | ||
122 | #define HvCallPciMaskInterrupts HvCallPci + 48 | ||
123 | #define HvCallPciUnmaskInterrupts HvCallPci + 49 | ||
124 | #define HvCallPciGetBusUnitInfo HvCallPci + 50 | ||
125 | |||
126 | //============================================================================ | ||
127 | static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber, | ||
128 | u8 deviceId, u32 offset, | ||
129 | u8 *value) | ||
130 | { | ||
131 | struct HvCallPci_DsaAddr dsa; | ||
132 | struct HvCallPci_LoadReturn retVal; | ||
133 | |||
134 | *((u64*)&dsa) = 0; | ||
135 | |||
136 | dsa.busNumber = busNumber; | ||
137 | dsa.subBusNumber = subBusNumber; | ||
138 | dsa.deviceId = deviceId; | ||
139 | |||
140 | HvCall3Ret16(HvCallPciConfigLoad8, &retVal, *(u64 *)&dsa, offset, 0); | ||
141 | |||
142 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
143 | |||
144 | *value = retVal.value; | ||
145 | |||
146 | return retVal.rc; | ||
147 | } | ||
148 | //============================================================================ | ||
149 | static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber, | ||
150 | u8 deviceId, u32 offset, | ||
151 | u16 *value) | ||
152 | { | ||
153 | struct HvCallPci_DsaAddr dsa; | ||
154 | struct HvCallPci_LoadReturn retVal; | ||
155 | |||
156 | *((u64*)&dsa) = 0; | ||
157 | |||
158 | dsa.busNumber = busNumber; | ||
159 | dsa.subBusNumber = subBusNumber; | ||
160 | dsa.deviceId = deviceId; | ||
161 | |||
162 | HvCall3Ret16(HvCallPciConfigLoad16, &retVal, *(u64 *)&dsa, offset, 0); | ||
163 | |||
164 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
165 | |||
166 | *value = retVal.value; | ||
167 | |||
168 | return retVal.rc; | ||
169 | } | ||
170 | //============================================================================ | ||
171 | static inline u64 HvCallPci_configLoad32(u16 busNumber, u8 subBusNumber, | ||
172 | u8 deviceId, u32 offset, | ||
173 | u32 *value) | ||
174 | { | ||
175 | struct HvCallPci_DsaAddr dsa; | ||
176 | struct HvCallPci_LoadReturn retVal; | ||
177 | |||
178 | *((u64*)&dsa) = 0; | ||
179 | |||
180 | dsa.busNumber = busNumber; | ||
181 | dsa.subBusNumber = subBusNumber; | ||
182 | dsa.deviceId = deviceId; | ||
183 | |||
184 | HvCall3Ret16(HvCallPciConfigLoad32, &retVal, *(u64 *)&dsa, offset, 0); | ||
185 | |||
186 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
187 | |||
188 | *value = retVal.value; | ||
189 | |||
190 | return retVal.rc; | ||
191 | } | ||
192 | //============================================================================ | ||
193 | static inline u64 HvCallPci_configStore8(u16 busNumber, u8 subBusNumber, | ||
194 | u8 deviceId, u32 offset, | ||
195 | u8 value) | ||
196 | { | ||
197 | struct HvCallPci_DsaAddr dsa; | ||
198 | u64 retVal; | ||
199 | |||
200 | *((u64*)&dsa) = 0; | ||
201 | |||
202 | dsa.busNumber = busNumber; | ||
203 | dsa.subBusNumber = subBusNumber; | ||
204 | dsa.deviceId = deviceId; | ||
205 | |||
206 | retVal = HvCall4(HvCallPciConfigStore8, *(u64 *)&dsa, offset, value, 0); | ||
207 | |||
208 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
209 | |||
210 | return retVal; | ||
211 | } | ||
212 | //============================================================================ | ||
213 | static inline u64 HvCallPci_configStore16(u16 busNumber, u8 subBusNumber, | ||
214 | u8 deviceId, u32 offset, | ||
215 | u16 value) | ||
216 | { | ||
217 | struct HvCallPci_DsaAddr dsa; | ||
218 | u64 retVal; | ||
219 | |||
220 | *((u64*)&dsa) = 0; | ||
221 | |||
222 | dsa.busNumber = busNumber; | ||
223 | dsa.subBusNumber = subBusNumber; | ||
224 | dsa.deviceId = deviceId; | ||
225 | |||
226 | retVal = HvCall4(HvCallPciConfigStore16, *(u64 *)&dsa, offset, value, 0); | ||
227 | |||
228 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
229 | |||
230 | return retVal; | ||
231 | } | ||
232 | //============================================================================ | ||
233 | static inline u64 HvCallPci_configStore32(u16 busNumber, u8 subBusNumber, | ||
234 | u8 deviceId, u32 offset, | ||
235 | u32 value) | ||
236 | { | ||
237 | struct HvCallPci_DsaAddr dsa; | ||
238 | u64 retVal; | ||
239 | |||
240 | *((u64*)&dsa) = 0; | ||
241 | |||
242 | dsa.busNumber = busNumber; | ||
243 | dsa.subBusNumber = subBusNumber; | ||
244 | dsa.deviceId = deviceId; | ||
245 | |||
246 | retVal = HvCall4(HvCallPciConfigStore32, *(u64 *)&dsa, offset, value, 0); | ||
247 | |||
248 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
249 | |||
250 | return retVal; | ||
251 | } | ||
252 | //============================================================================ | ||
253 | static inline u64 HvCallPci_barLoad8(u16 busNumberParm, | ||
254 | u8 subBusParm, | ||
255 | u8 deviceIdParm, | ||
256 | u8 barNumberParm, | ||
257 | u64 offsetParm, | ||
258 | u8* valueParm) | ||
259 | { | ||
260 | struct HvCallPci_DsaAddr dsa; | ||
261 | struct HvCallPci_LoadReturn retVal; | ||
262 | |||
263 | *((u64*)&dsa) = 0; | ||
264 | |||
265 | dsa.busNumber = busNumberParm; | ||
266 | dsa.subBusNumber = subBusParm; | ||
267 | dsa.deviceId = deviceIdParm; | ||
268 | dsa.barNumber = barNumberParm; | ||
269 | |||
270 | HvCall3Ret16(HvCallPciBarLoad8, &retVal, *(u64 *)&dsa, offsetParm, 0); | ||
271 | |||
272 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
273 | |||
274 | *valueParm = retVal.value; | ||
275 | |||
276 | return retVal.rc; | ||
277 | } | ||
278 | //============================================================================ | ||
279 | static inline u64 HvCallPci_barLoad16(u16 busNumberParm, | ||
280 | u8 subBusParm, | ||
281 | u8 deviceIdParm, | ||
282 | u8 barNumberParm, | ||
283 | u64 offsetParm, | ||
284 | u16* valueParm) | ||
285 | { | ||
286 | struct HvCallPci_DsaAddr dsa; | ||
287 | struct HvCallPci_LoadReturn retVal; | ||
288 | |||
289 | *((u64*)&dsa) = 0; | ||
290 | |||
291 | dsa.busNumber = busNumberParm; | ||
292 | dsa.subBusNumber = subBusParm; | ||
293 | dsa.deviceId = deviceIdParm; | ||
294 | dsa.barNumber = barNumberParm; | ||
295 | |||
296 | HvCall3Ret16(HvCallPciBarLoad16, &retVal, *(u64 *)&dsa, offsetParm, 0); | ||
297 | |||
298 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
299 | |||
300 | *valueParm = retVal.value; | ||
301 | |||
302 | return retVal.rc; | ||
303 | } | ||
304 | //============================================================================ | ||
305 | static inline u64 HvCallPci_barLoad32(u16 busNumberParm, | ||
306 | u8 subBusParm, | ||
307 | u8 deviceIdParm, | ||
308 | u8 barNumberParm, | ||
309 | u64 offsetParm, | ||
310 | u32* valueParm) | ||
311 | { | ||
312 | struct HvCallPci_DsaAddr dsa; | ||
313 | struct HvCallPci_LoadReturn retVal; | ||
314 | |||
315 | *((u64*)&dsa) = 0; | ||
316 | |||
317 | dsa.busNumber = busNumberParm; | ||
318 | dsa.subBusNumber = subBusParm; | ||
319 | dsa.deviceId = deviceIdParm; | ||
320 | dsa.barNumber = barNumberParm; | ||
321 | |||
322 | HvCall3Ret16(HvCallPciBarLoad32, &retVal, *(u64 *)&dsa, offsetParm, 0); | ||
323 | |||
324 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
325 | |||
326 | *valueParm = retVal.value; | ||
327 | |||
328 | return retVal.rc; | ||
329 | } | ||
330 | //============================================================================ | ||
331 | static inline u64 HvCallPci_barLoad64(u16 busNumberParm, | ||
332 | u8 subBusParm, | ||
333 | u8 deviceIdParm, | ||
334 | u8 barNumberParm, | ||
335 | u64 offsetParm, | ||
336 | u64* valueParm) | ||
337 | { | ||
338 | struct HvCallPci_DsaAddr dsa; | ||
339 | struct HvCallPci_LoadReturn retVal; | ||
340 | |||
341 | *((u64*)&dsa) = 0; | ||
342 | |||
343 | dsa.busNumber = busNumberParm; | ||
344 | dsa.subBusNumber = subBusParm; | ||
345 | dsa.deviceId = deviceIdParm; | ||
346 | dsa.barNumber = barNumberParm; | ||
347 | |||
348 | HvCall3Ret16(HvCallPciBarLoad64, &retVal, *(u64 *)&dsa, offsetParm, 0); | ||
349 | |||
350 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
351 | |||
352 | *valueParm = retVal.value; | ||
353 | |||
354 | return retVal.rc; | ||
355 | } | ||
356 | //============================================================================ | ||
357 | static inline u64 HvCallPci_barStore8(u16 busNumberParm, | ||
358 | u8 subBusParm, | ||
359 | u8 deviceIdParm, | ||
360 | u8 barNumberParm, | ||
361 | u64 offsetParm, | ||
362 | u8 valueParm) | ||
363 | { | ||
364 | struct HvCallPci_DsaAddr dsa; | ||
365 | u64 retVal; | ||
366 | |||
367 | *((u64*)&dsa) = 0; | ||
368 | |||
369 | dsa.busNumber = busNumberParm; | ||
370 | dsa.subBusNumber = subBusParm; | ||
371 | dsa.deviceId = deviceIdParm; | ||
372 | dsa.barNumber = barNumberParm; | ||
373 | |||
374 | retVal = HvCall4(HvCallPciBarStore8, *(u64 *)&dsa, offsetParm, valueParm, 0); | ||
375 | |||
376 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
377 | |||
378 | return retVal; | ||
379 | } | ||
380 | //============================================================================ | ||
381 | static inline u64 HvCallPci_barStore16(u16 busNumberParm, | ||
382 | u8 subBusParm, | ||
383 | u8 deviceIdParm, | ||
384 | u8 barNumberParm, | ||
385 | u64 offsetParm, | ||
386 | u16 valueParm) | ||
387 | { | ||
388 | struct HvCallPci_DsaAddr dsa; | ||
389 | u64 retVal; | ||
390 | |||
391 | *((u64*)&dsa) = 0; | ||
392 | |||
393 | dsa.busNumber = busNumberParm; | ||
394 | dsa.subBusNumber = subBusParm; | ||
395 | dsa.deviceId = deviceIdParm; | ||
396 | dsa.barNumber = barNumberParm; | ||
397 | |||
398 | retVal = HvCall4(HvCallPciBarStore16, *(u64 *)&dsa, offsetParm, valueParm, 0); | ||
399 | |||
400 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
401 | |||
402 | return retVal; | ||
403 | } | ||
404 | //============================================================================ | ||
405 | static inline u64 HvCallPci_barStore32(u16 busNumberParm, | ||
406 | u8 subBusParm, | ||
407 | u8 deviceIdParm, | ||
408 | u8 barNumberParm, | ||
409 | u64 offsetParm, | ||
410 | u32 valueParm) | ||
411 | { | ||
412 | struct HvCallPci_DsaAddr dsa; | ||
413 | u64 retVal; | ||
414 | |||
415 | *((u64*)&dsa) = 0; | ||
416 | |||
417 | dsa.busNumber = busNumberParm; | ||
418 | dsa.subBusNumber = subBusParm; | ||
419 | dsa.deviceId = deviceIdParm; | ||
420 | dsa.barNumber = barNumberParm; | ||
421 | |||
422 | retVal = HvCall4(HvCallPciBarStore32, *(u64 *)&dsa, offsetParm, valueParm, 0); | ||
423 | |||
424 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
425 | |||
426 | return retVal; | ||
427 | } | ||
428 | //============================================================================ | ||
429 | static inline u64 HvCallPci_barStore64(u16 busNumberParm, | ||
430 | u8 subBusParm, | ||
431 | u8 deviceIdParm, | ||
432 | u8 barNumberParm, | ||
433 | u64 offsetParm, | ||
434 | u64 valueParm) | ||
435 | { | ||
436 | struct HvCallPci_DsaAddr dsa; | ||
437 | u64 retVal; | ||
438 | |||
439 | *((u64*)&dsa) = 0; | ||
440 | |||
441 | dsa.busNumber = busNumberParm; | ||
442 | dsa.subBusNumber = subBusParm; | ||
443 | dsa.deviceId = deviceIdParm; | ||
444 | dsa.barNumber = barNumberParm; | ||
445 | |||
446 | retVal = HvCall4(HvCallPciBarStore64, *(u64 *)&dsa, offsetParm, valueParm, 0); | ||
447 | |||
448 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
449 | |||
450 | return retVal; | ||
451 | } | ||
452 | //============================================================================ | ||
453 | static inline u64 HvCallPci_eoi(u16 busNumberParm, | ||
454 | u8 subBusParm, | ||
455 | u8 deviceIdParm) | ||
456 | { | ||
457 | struct HvCallPci_DsaAddr dsa; | ||
458 | struct HvCallPci_LoadReturn retVal; | ||
459 | |||
460 | *((u64*)&dsa) = 0; | ||
461 | |||
462 | dsa.busNumber = busNumberParm; | ||
463 | dsa.subBusNumber = subBusParm; | ||
464 | dsa.deviceId = deviceIdParm; | ||
465 | |||
466 | HvCall1Ret16(HvCallPciEoi, &retVal, *(u64*)&dsa); | ||
467 | |||
468 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
469 | |||
470 | return retVal.rc; | ||
471 | } | ||
472 | //============================================================================ | ||
473 | static inline u64 HvCallPci_getBarParms(u16 busNumberParm, | ||
474 | u8 subBusParm, | ||
475 | u8 deviceIdParm, | ||
476 | u8 barNumberParm, | ||
477 | u64 parms, | ||
478 | u32 sizeofParms) | ||
479 | { | ||
480 | struct HvCallPci_DsaAddr dsa; | ||
481 | u64 retVal; | ||
482 | |||
483 | *((u64*)&dsa) = 0; | ||
484 | |||
485 | dsa.busNumber = busNumberParm; | ||
486 | dsa.subBusNumber = subBusParm; | ||
487 | dsa.deviceId = deviceIdParm; | ||
488 | dsa.barNumber = barNumberParm; | ||
489 | |||
490 | retVal = HvCall3(HvCallPciGetBarParms, *(u64*)&dsa, parms, sizeofParms); | ||
491 | |||
492 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
493 | |||
494 | return retVal; | ||
495 | } | ||
496 | //============================================================================ | ||
497 | static inline u64 HvCallPci_maskFisr(u16 busNumberParm, | ||
498 | u8 subBusParm, | ||
499 | u8 deviceIdParm, | ||
500 | u64 fisrMask) | ||
501 | { | ||
502 | struct HvCallPci_DsaAddr dsa; | ||
503 | u64 retVal; | ||
504 | |||
505 | *((u64*)&dsa) = 0; | ||
506 | |||
507 | dsa.busNumber = busNumberParm; | ||
508 | dsa.subBusNumber = subBusParm; | ||
509 | dsa.deviceId = deviceIdParm; | ||
510 | |||
511 | retVal = HvCall2(HvCallPciMaskFisr, *(u64*)&dsa, fisrMask); | ||
512 | |||
513 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
514 | |||
515 | return retVal; | ||
516 | } | ||
517 | //============================================================================ | ||
518 | static inline u64 HvCallPci_unmaskFisr(u16 busNumberParm, | ||
519 | u8 subBusParm, | ||
520 | u8 deviceIdParm, | ||
521 | u64 fisrMask) | ||
522 | { | ||
523 | struct HvCallPci_DsaAddr dsa; | ||
524 | u64 retVal; | ||
525 | |||
526 | *((u64*)&dsa) = 0; | ||
527 | |||
528 | dsa.busNumber = busNumberParm; | ||
529 | dsa.subBusNumber = subBusParm; | ||
530 | dsa.deviceId = deviceIdParm; | ||
531 | |||
532 | retVal = HvCall2(HvCallPciUnmaskFisr, *(u64*)&dsa, fisrMask); | ||
533 | |||
534 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
535 | |||
536 | return retVal; | ||
537 | } | ||
538 | //============================================================================ | ||
539 | static inline u64 HvCallPci_setSlotReset(u16 busNumberParm, | ||
540 | u8 subBusParm, | ||
541 | u8 deviceIdParm, | ||
542 | u64 onNotOff) | ||
543 | { | ||
544 | struct HvCallPci_DsaAddr dsa; | ||
545 | u64 retVal; | ||
546 | |||
547 | *((u64*)&dsa) = 0; | ||
548 | |||
549 | dsa.busNumber = busNumberParm; | ||
550 | dsa.subBusNumber = subBusParm; | ||
551 | dsa.deviceId = deviceIdParm; | ||
552 | |||
553 | retVal = HvCall2(HvCallPciSetSlotReset, *(u64*)&dsa, onNotOff); | ||
554 | |||
555 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
556 | |||
557 | return retVal; | ||
558 | } | ||
559 | //============================================================================ | ||
560 | static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm, | ||
561 | u8 subBusParm, | ||
562 | u8 deviceNumberParm, | ||
563 | u64 parms, | ||
564 | u32 sizeofParms) | ||
565 | { | ||
566 | struct HvCallPci_DsaAddr dsa; | ||
567 | u64 retVal; | ||
568 | |||
569 | *((u64*)&dsa) = 0; | ||
570 | |||
571 | dsa.busNumber = busNumberParm; | ||
572 | dsa.subBusNumber = subBusParm; | ||
573 | dsa.deviceId = deviceNumberParm << 4; | ||
574 | |||
575 | retVal = HvCall3(HvCallPciGetDeviceInfo, *(u64*)&dsa, parms, sizeofParms); | ||
576 | |||
577 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
578 | |||
579 | return retVal; | ||
580 | } | ||
581 | //============================================================================ | ||
582 | static inline u64 HvCallPci_maskInterrupts(u16 busNumberParm, | ||
583 | u8 subBusParm, | ||
584 | u8 deviceIdParm, | ||
585 | u64 interruptMask) | ||
586 | { | ||
587 | struct HvCallPci_DsaAddr dsa; | ||
588 | u64 retVal; | ||
589 | |||
590 | *((u64*)&dsa) = 0; | ||
591 | |||
592 | dsa.busNumber = busNumberParm; | ||
593 | dsa.subBusNumber = subBusParm; | ||
594 | dsa.deviceId = deviceIdParm; | ||
595 | |||
596 | retVal = HvCall2(HvCallPciMaskInterrupts, *(u64*)&dsa, interruptMask); | ||
597 | |||
598 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
599 | |||
600 | return retVal; | ||
601 | } | ||
602 | //============================================================================ | ||
603 | static inline u64 HvCallPci_unmaskInterrupts(u16 busNumberParm, | ||
604 | u8 subBusParm, | ||
605 | u8 deviceIdParm, | ||
606 | u64 interruptMask) | ||
607 | { | ||
608 | struct HvCallPci_DsaAddr dsa; | ||
609 | u64 retVal; | ||
610 | |||
611 | *((u64*)&dsa) = 0; | ||
612 | |||
613 | dsa.busNumber = busNumberParm; | ||
614 | dsa.subBusNumber = subBusParm; | ||
615 | dsa.deviceId = deviceIdParm; | ||
616 | |||
617 | retVal = HvCall2(HvCallPciUnmaskInterrupts, *(u64*)&dsa, interruptMask); | ||
618 | |||
619 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
620 | |||
621 | return retVal; | ||
622 | } | ||
623 | //============================================================================ | ||
624 | |||
625 | static inline u64 HvCallPci_getBusUnitInfo(u16 busNumberParm, | ||
626 | u8 subBusParm, | ||
627 | u8 deviceIdParm, | ||
628 | u64 parms, | ||
629 | u32 sizeofParms) | ||
630 | { | ||
631 | struct HvCallPci_DsaAddr dsa; | ||
632 | u64 retVal; | ||
633 | |||
634 | *((u64*)&dsa) = 0; | ||
635 | |||
636 | dsa.busNumber = busNumberParm; | ||
637 | dsa.subBusNumber = subBusParm; | ||
638 | dsa.deviceId = deviceIdParm; | ||
639 | |||
640 | retVal = HvCall3(HvCallPciGetBusUnitInfo, *(u64*)&dsa, parms, sizeofParms); | ||
641 | |||
642 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
643 | |||
644 | return retVal; | ||
645 | } | ||
646 | //============================================================================ | ||
647 | |||
648 | static inline int HvCallPci_getBusVpd(u16 busNumParm, u64 destParm, u16 sizeParm) | ||
649 | { | ||
650 | int xRetSize; | ||
651 | u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, sizeParm, HvCallPci_BusVpd); | ||
652 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
653 | if (xRc == -1) | ||
654 | xRetSize = -1; | ||
655 | else | ||
656 | xRetSize = xRc & 0xFFFF; | ||
657 | return xRetSize; | ||
658 | } | ||
659 | //============================================================================ | ||
660 | |||
661 | static inline int HvCallPci_getBusAdapterVpd(u16 busNumParm, u64 destParm, u16 sizeParm) | ||
662 | { | ||
663 | int xRetSize; | ||
664 | u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, sizeParm, HvCallPci_BusAdapterVpd); | ||
665 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
666 | if (xRc == -1) | ||
667 | xRetSize = -1; | ||
668 | else | ||
669 | xRetSize = xRc & 0xFFFF; | ||
670 | return xRetSize; | ||
671 | } | ||
672 | //============================================================================ | ||
673 | #endif /* _HVCALLPCI_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallSc.h b/include/asm-ppc64/iSeries/HvCallSc.h new file mode 100644 index 000000000000..eea258447642 --- /dev/null +++ b/include/asm-ppc64/iSeries/HvCallSc.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * HvCallSc.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVCALLSC_H | ||
20 | #define _HVCALLSC_H | ||
21 | |||
22 | #include <asm/iSeries/HvTypes.h> | ||
23 | |||
24 | #define HvCallBase 0x8000000000000000ul | ||
25 | #define HvCallCc 0x8001000000000000ul | ||
26 | #define HvCallCfg 0x8002000000000000ul | ||
27 | #define HvCallEvent 0x8003000000000000ul | ||
28 | #define HvCallHpt 0x8004000000000000ul | ||
29 | #define HvCallPci 0x8005000000000000ul | ||
30 | #define HvCallSm 0x8007000000000000ul | ||
31 | #define HvCallXm 0x8009000000000000ul | ||
32 | |||
33 | u64 HvCall0( u64 ); | ||
34 | u64 HvCall1( u64, u64 ); | ||
35 | u64 HvCall2( u64, u64, u64 ); | ||
36 | u64 HvCall3( u64, u64, u64, u64 ); | ||
37 | u64 HvCall4( u64, u64, u64, u64, u64 ); | ||
38 | u64 HvCall5( u64, u64, u64, u64, u64, u64 ); | ||
39 | u64 HvCall6( u64, u64, u64, u64, u64, u64, u64 ); | ||
40 | u64 HvCall7( u64, u64, u64, u64, u64, u64, u64, u64 ); | ||
41 | |||
42 | u64 HvCall0Ret16( u64, void * ); | ||
43 | u64 HvCall1Ret16( u64, void *, u64 ); | ||
44 | u64 HvCall2Ret16( u64, void *, u64, u64 ); | ||
45 | u64 HvCall3Ret16( u64, void *, u64, u64, u64 ); | ||
46 | u64 HvCall4Ret16( u64, void *, u64, u64, u64, u64 ); | ||
47 | u64 HvCall5Ret16( u64, void *, u64, u64, u64, u64, u64 ); | ||
48 | u64 HvCall6Ret16( u64, void *, u64, u64, u64, u64, u64, u64 ); | ||
49 | u64 HvCall7Ret16( u64, void *, u64, u64 ,u64 ,u64 ,u64 ,u64 ,u64 ); | ||
50 | |||
51 | #endif /* _HVCALLSC_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallSm.h b/include/asm-ppc64/iSeries/HvCallSm.h new file mode 100644 index 000000000000..9050c94a529d --- /dev/null +++ b/include/asm-ppc64/iSeries/HvCallSm.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * HvCallSm.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVCALLSM_H | ||
20 | #define _HVCALLSM_H | ||
21 | |||
22 | //============================================================================ | ||
23 | // | ||
24 | // This file contains the "hypervisor call" interface which is used to | ||
25 | // drive the hypervisor from the OS. | ||
26 | // | ||
27 | //============================================================================ | ||
28 | |||
29 | //------------------------------------------------------------------- | ||
30 | // Standard Includes | ||
31 | //------------------------------------------------------------------- | ||
32 | #include <asm/iSeries/HvCallSc.h> | ||
33 | #include <asm/iSeries/HvTypes.h> | ||
34 | |||
35 | //----------------------------------------------------------------------------- | ||
36 | // Constants | ||
37 | //----------------------------------------------------------------------------- | ||
38 | |||
39 | #define HvCallSmGet64BitsOfAccessMap HvCallSm + 11 | ||
40 | |||
41 | |||
42 | //============================================================================ | ||
43 | static inline u64 HvCallSm_get64BitsOfAccessMap( | ||
44 | HvLpIndex lpIndex, u64 indexIntoBitMap ) | ||
45 | { | ||
46 | u64 retval = HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, | ||
47 | indexIntoBitMap ); | ||
48 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
49 | return retval; | ||
50 | } | ||
51 | //============================================================================ | ||
52 | #endif /* _HVCALLSM_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallXm.h b/include/asm-ppc64/iSeries/HvCallXm.h new file mode 100644 index 000000000000..bfb898f4db8d --- /dev/null +++ b/include/asm-ppc64/iSeries/HvCallXm.h | |||
@@ -0,0 +1,95 @@ | |||
1 | //============================================================================ | ||
2 | // Header File Id | ||
3 | // Name______________: HvCallXm.H | ||
4 | // | ||
5 | // Description_______: | ||
6 | // | ||
7 | // This file contains the "hypervisor call" interface which is used to | ||
8 | // drive the hypervisor from SLIC. | ||
9 | // | ||
10 | //============================================================================ | ||
11 | #ifndef _HVCALLXM_H | ||
12 | #define _HVCALLXM_H | ||
13 | |||
14 | //------------------------------------------------------------------- | ||
15 | // Forward declarations | ||
16 | //------------------------------------------------------------------- | ||
17 | |||
18 | //------------------------------------------------------------------- | ||
19 | // Standard Includes | ||
20 | //------------------------------------------------------------------- | ||
21 | #include <asm/iSeries/HvCallSc.h> | ||
22 | #include <asm/iSeries/HvTypes.h> | ||
23 | |||
24 | //----------------------------------------------------------------------------- | ||
25 | // Constants | ||
26 | //----------------------------------------------------------------------------- | ||
27 | |||
28 | #define HvCallXmGetTceTableParms HvCallXm + 0 | ||
29 | #define HvCallXmTestBus HvCallXm + 1 | ||
30 | #define HvCallXmConnectBusUnit HvCallXm + 2 | ||
31 | #define HvCallXmLoadTod HvCallXm + 8 | ||
32 | #define HvCallXmTestBusUnit HvCallXm + 9 | ||
33 | #define HvCallXmSetTce HvCallXm + 11 | ||
34 | #define HvCallXmSetTces HvCallXm + 13 | ||
35 | |||
36 | |||
37 | |||
38 | //============================================================================ | ||
39 | static inline void HvCallXm_getTceTableParms(u64 cb) | ||
40 | { | ||
41 | HvCall1(HvCallXmGetTceTableParms, cb); | ||
42 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
43 | } | ||
44 | //============================================================================ | ||
45 | static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce) | ||
46 | { | ||
47 | u64 retval = HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce ); | ||
48 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
49 | return retval; | ||
50 | } | ||
51 | //============================================================================ | ||
52 | static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset, u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4) | ||
53 | { | ||
54 | u64 retval = HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces, | ||
55 | tce1, tce2, tce3, tce4 ); | ||
56 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
57 | return retval; | ||
58 | } | ||
59 | //============================================================================= | ||
60 | static inline u64 HvCallXm_testBus(u16 busNumber) | ||
61 | { | ||
62 | u64 retVal = HvCall1(HvCallXmTestBus, busNumber); | ||
63 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
64 | return retVal; | ||
65 | } | ||
66 | //===================================================================================== | ||
67 | static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber, u8 deviceId) | ||
68 | { | ||
69 | u64 busUnitNumber = (subBusNumber << 8) | deviceId; | ||
70 | u64 retVal = HvCall2(HvCallXmTestBusUnit, busNumber, busUnitNumber); | ||
71 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
72 | return retVal; | ||
73 | } | ||
74 | //===================================================================================== | ||
75 | static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber, u8 deviceId, | ||
76 | u64 interruptToken) | ||
77 | { | ||
78 | u64 busUnitNumber = (subBusNumber << 8) | deviceId; | ||
79 | u64 queueIndex = 0; // HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard)); | ||
80 | |||
81 | u64 retVal = HvCall5(HvCallXmConnectBusUnit, busNumber, busUnitNumber, | ||
82 | interruptToken, 0, queueIndex); | ||
83 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
84 | return retVal; | ||
85 | } | ||
86 | //===================================================================================== | ||
87 | static inline u64 HvCallXm_loadTod(void) | ||
88 | { | ||
89 | u64 retVal = HvCall0(HvCallXmLoadTod); | ||
90 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | ||
91 | return retVal; | ||
92 | } | ||
93 | //===================================================================================== | ||
94 | |||
95 | #endif /* _HVCALLXM_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvLpConfig.h b/include/asm-ppc64/iSeries/HvLpConfig.h new file mode 100644 index 000000000000..bdbd70f42c9d --- /dev/null +++ b/include/asm-ppc64/iSeries/HvLpConfig.h | |||
@@ -0,0 +1,280 @@ | |||
1 | /* | ||
2 | * HvLpConfig.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVLPCONFIG_H | ||
20 | #define _HVLPCONFIG_H | ||
21 | |||
22 | //=========================================================================== | ||
23 | // | ||
24 | // This file contains the interface to the LPAR configuration data | ||
25 | // to determine which resources should be allocated to each partition. | ||
26 | // | ||
27 | //=========================================================================== | ||
28 | |||
29 | #include <asm/iSeries/HvCallCfg.h> | ||
30 | #include <asm/iSeries/HvTypes.h> | ||
31 | #include <asm/iSeries/ItLpNaca.h> | ||
32 | #include <asm/iSeries/LparData.h> | ||
33 | |||
34 | //------------------------------------------------------------------- | ||
35 | // Constants | ||
36 | //------------------------------------------------------------------- | ||
37 | |||
38 | extern HvLpIndex HvLpConfig_getLpIndex_outline(void); | ||
39 | |||
40 | //=================================================================== | ||
41 | static inline HvLpIndex HvLpConfig_getLpIndex(void) | ||
42 | { | ||
43 | return itLpNaca.xLpIndex; | ||
44 | } | ||
45 | //=================================================================== | ||
46 | static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void) | ||
47 | { | ||
48 | return itLpNaca.xPrimaryLpIndex; | ||
49 | } | ||
50 | //================================================================= | ||
51 | static inline HvLpIndex HvLpConfig_getLps(void) | ||
52 | { | ||
53 | return HvCallCfg_getLps(); | ||
54 | } | ||
55 | //================================================================= | ||
56 | static inline HvLpIndexMap HvLpConfig_getActiveLpMap(void) | ||
57 | { | ||
58 | return HvCallCfg_getActiveLpMap(); | ||
59 | } | ||
60 | //================================================================= | ||
61 | static inline u64 HvLpConfig_getSystemMsMegs(void) | ||
62 | { | ||
63 | return HvCallCfg_getSystemMsChunks() / HVCHUNKSPERMEG; | ||
64 | } | ||
65 | //================================================================= | ||
66 | static inline u64 HvLpConfig_getSystemMsChunks(void) | ||
67 | { | ||
68 | return HvCallCfg_getSystemMsChunks(); | ||
69 | } | ||
70 | //================================================================= | ||
71 | static inline u64 HvLpConfig_getSystemMsPages(void) | ||
72 | { | ||
73 | return HvCallCfg_getSystemMsChunks() * HVPAGESPERCHUNK; | ||
74 | } | ||
75 | //================================================================ | ||
76 | static inline u64 HvLpConfig_getMsMegs(void) | ||
77 | { | ||
78 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur) / HVCHUNKSPERMEG; | ||
79 | } | ||
80 | //================================================================ | ||
81 | static inline u64 HvLpConfig_getMsChunks(void) | ||
82 | { | ||
83 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur); | ||
84 | } | ||
85 | //================================================================ | ||
86 | static inline u64 HvLpConfig_getMsPages(void) | ||
87 | { | ||
88 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur) * HVPAGESPERCHUNK; | ||
89 | } | ||
90 | //================================================================ | ||
91 | static inline u64 HvLpConfig_getMinMsMegs(void) | ||
92 | { | ||
93 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min) / HVCHUNKSPERMEG; | ||
94 | } | ||
95 | //================================================================ | ||
96 | static inline u64 HvLpConfig_getMinMsChunks(void) | ||
97 | { | ||
98 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min); | ||
99 | } | ||
100 | //================================================================ | ||
101 | static inline u64 HvLpConfig_getMinMsPages(void) | ||
102 | { | ||
103 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min) * HVPAGESPERCHUNK; | ||
104 | } | ||
105 | //================================================================ | ||
106 | static inline u64 HvLpConfig_getMinRuntimeMsMegs(void) | ||
107 | { | ||
108 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()) / HVCHUNKSPERMEG; | ||
109 | } | ||
110 | //=============================================================== | ||
111 | static inline u64 HvLpConfig_getMinRuntimeMsChunks(void) | ||
112 | { | ||
113 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()); | ||
114 | } | ||
115 | //=============================================================== | ||
116 | static inline u64 HvLpConfig_getMinRuntimeMsPages(void) | ||
117 | { | ||
118 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()) * HVPAGESPERCHUNK; | ||
119 | } | ||
120 | //=============================================================== | ||
121 | static inline u64 HvLpConfig_getMaxMsMegs(void) | ||
122 | { | ||
123 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max) / HVCHUNKSPERMEG; | ||
124 | } | ||
125 | //=============================================================== | ||
126 | static inline u64 HvLpConfig_getMaxMsChunks(void) | ||
127 | { | ||
128 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max); | ||
129 | } | ||
130 | //=============================================================== | ||
131 | static inline u64 HvLpConfig_getMaxMsPages(void) | ||
132 | { | ||
133 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max) * HVPAGESPERCHUNK; | ||
134 | } | ||
135 | //=============================================================== | ||
136 | static inline u64 HvLpConfig_getInitMsMegs(void) | ||
137 | { | ||
138 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init) / HVCHUNKSPERMEG; | ||
139 | } | ||
140 | //=============================================================== | ||
141 | static inline u64 HvLpConfig_getInitMsChunks(void) | ||
142 | { | ||
143 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init); | ||
144 | } | ||
145 | //=============================================================== | ||
146 | static inline u64 HvLpConfig_getInitMsPages(void) | ||
147 | { return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init) * HVPAGESPERCHUNK; | ||
148 | } | ||
149 | //=============================================================== | ||
150 | static inline u64 HvLpConfig_getSystemPhysicalProcessors(void) | ||
151 | { | ||
152 | return HvCallCfg_getSystemPhysicalProcessors(); | ||
153 | } | ||
154 | //=============================================================== | ||
155 | static inline u64 HvLpConfig_getSystemLogicalProcessors(void) | ||
156 | { | ||
157 | return HvCallCfg_getSystemPhysicalProcessors() * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
158 | } | ||
159 | //=============================================================== | ||
160 | static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) | ||
161 | { | ||
162 | return HvCallCfg_getNumProcsInSharedPool(sPI); | ||
163 | } | ||
164 | //=============================================================== | ||
165 | static inline u64 HvLpConfig_getPhysicalProcessors(void) | ||
166 | { | ||
167 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Cur); | ||
168 | } | ||
169 | //=============================================================== | ||
170 | static inline u64 HvLpConfig_getLogicalProcessors(void) | ||
171 | { | ||
172 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Cur) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
173 | } | ||
174 | //=============================================================== | ||
175 | static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void) | ||
176 | { | ||
177 | return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex()); | ||
178 | } | ||
179 | //=============================================================== | ||
180 | static inline u64 HvLpConfig_getSharedProcUnits(void) | ||
181 | { | ||
182 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Cur); | ||
183 | } | ||
184 | //=============================================================== | ||
185 | static inline u64 HvLpConfig_getMinSharedProcUnits(void) | ||
186 | { | ||
187 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Min); | ||
188 | } | ||
189 | //=============================================================== | ||
190 | static inline u64 HvLpConfig_getMaxSharedProcUnits(void) | ||
191 | { | ||
192 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Max); | ||
193 | } | ||
194 | //=============================================================== | ||
195 | static inline u64 HvLpConfig_getMinPhysicalProcessors(void) | ||
196 | { | ||
197 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Min); | ||
198 | } | ||
199 | //=============================================================== | ||
200 | static inline u64 HvLpConfig_getMinLogicalProcessors(void) | ||
201 | { | ||
202 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Min) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
203 | } | ||
204 | //=============================================================== | ||
205 | static inline u64 HvLpConfig_getMaxPhysicalProcessors(void) | ||
206 | { | ||
207 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Max); | ||
208 | } | ||
209 | //=============================================================== | ||
210 | static inline u64 HvLpConfig_getMaxLogicalProcessors(void) | ||
211 | { | ||
212 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Max) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
213 | } | ||
214 | //=============================================================== | ||
215 | static inline u64 HvLpConfig_getInitPhysicalProcessors(void) | ||
216 | { | ||
217 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Init); | ||
218 | } | ||
219 | //=============================================================== | ||
220 | static inline u64 HvLpConfig_getInitLogicalProcessors(void) | ||
221 | { | ||
222 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Init) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); | ||
223 | } | ||
224 | //================================================================ | ||
225 | static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void) | ||
226 | { | ||
227 | return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline()); | ||
228 | } | ||
229 | //=============================================================== | ||
230 | static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp(HvLpIndex lp) | ||
231 | { | ||
232 | return HvCallCfg_getVirtualLanIndexMap(lp); | ||
233 | } | ||
234 | //================================================================ | ||
235 | static inline HvLpIndex HvLpConfig_getBusOwner(HvBusNumber busNumber) | ||
236 | { | ||
237 | return HvCallCfg_getBusOwner(busNumber); | ||
238 | } | ||
239 | //=============================================================== | ||
240 | static inline int HvLpConfig_isBusDedicated(HvBusNumber busNumber) | ||
241 | { | ||
242 | return HvCallCfg_isBusDedicated(busNumber); | ||
243 | } | ||
244 | //================================================================ | ||
245 | static inline HvLpIndexMap HvLpConfig_getBusAllocation(HvBusNumber busNumber) | ||
246 | { | ||
247 | return HvCallCfg_getBusAllocation(busNumber); | ||
248 | } | ||
249 | //================================================================ | ||
250 | // returns the absolute real address of the load area | ||
251 | static inline u64 HvLpConfig_getLoadAddress(void) | ||
252 | { | ||
253 | return itLpNaca.xLoadAreaAddr & 0x7fffffffffffffff; | ||
254 | } | ||
255 | //================================================================ | ||
256 | static inline u64 HvLpConfig_getLoadPages(void) | ||
257 | { | ||
258 | return itLpNaca.xLoadAreaChunks * HVPAGESPERCHUNK; | ||
259 | } | ||
260 | //================================================================ | ||
261 | static inline int HvLpConfig_isBusOwnedByThisLp(HvBusNumber busNumber) | ||
262 | { | ||
263 | HvLpIndex busOwner = HvLpConfig_getBusOwner(busNumber); | ||
264 | return (busOwner == HvLpConfig_getLpIndex()); | ||
265 | } | ||
266 | //================================================================ | ||
267 | static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1, HvLpIndex lp2) | ||
268 | { | ||
269 | HvLpVirtualLanIndexMap virtualLanIndexMap1 = HvCallCfg_getVirtualLanIndexMap( lp1 ); | ||
270 | HvLpVirtualLanIndexMap virtualLanIndexMap2 = HvCallCfg_getVirtualLanIndexMap( lp2 ); | ||
271 | return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0); | ||
272 | } | ||
273 | //================================================================ | ||
274 | static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp) | ||
275 | { | ||
276 | return HvCallCfg_getHostingLpIndex(lp); | ||
277 | } | ||
278 | //================================================================ | ||
279 | |||
280 | #endif /* _HVLPCONFIG_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvLpEvent.h b/include/asm-ppc64/iSeries/HvLpEvent.h new file mode 100644 index 000000000000..30936e433064 --- /dev/null +++ b/include/asm-ppc64/iSeries/HvLpEvent.h | |||
@@ -0,0 +1,144 @@ | |||
1 | /* | ||
2 | * HvLpEvent.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | //====================================================================== | ||
21 | // | ||
22 | // This file contains the class for HV events in the system. | ||
23 | // | ||
24 | //===================================================================== | ||
25 | #ifndef _HVLPEVENT_H | ||
26 | #define _HVLPEVENT_H | ||
27 | |||
28 | #include <asm/types.h> | ||
29 | #include <asm/ptrace.h> | ||
30 | #include <asm/iSeries/HvTypes.h> | ||
31 | #include <asm/iSeries/HvCallEvent.h> | ||
32 | |||
33 | //===================================================================== | ||
34 | // | ||
35 | // HvLpEvent is the structure for Lp Event messages passed between | ||
36 | // partitions through PLIC. | ||
37 | // | ||
38 | //===================================================================== | ||
39 | |||
40 | struct HvEventFlags | ||
41 | { | ||
42 | u8 xValid:1; // Indicates a valid request x00-x00 | ||
43 | u8 xRsvd1:4; // Reserved ... | ||
44 | u8 xAckType:1; // Immediate or deferred ... | ||
45 | u8 xAckInd:1; // Indicates if ACK required ... | ||
46 | u8 xFunction:1; // Interrupt or Acknowledge ... | ||
47 | }; | ||
48 | |||
49 | |||
50 | struct HvLpEvent | ||
51 | { | ||
52 | struct HvEventFlags xFlags; // Event flags x00-x00 | ||
53 | u8 xType; // Type of message x01-x01 | ||
54 | u16 xSubtype; // Subtype for event x02-x03 | ||
55 | u8 xSourceLp; // Source LP x04-x04 | ||
56 | u8 xTargetLp; // Target LP x05-x05 | ||
57 | u8 xSizeMinus1; // Size of Derived class - 1 x06-x06 | ||
58 | u8 xRc; // RC for Ack flows x07-x07 | ||
59 | u16 xSourceInstanceId; // Source sides instance id x08-x09 | ||
60 | u16 xTargetInstanceId; // Target sides instance id x0A-x0B | ||
61 | union { | ||
62 | u32 xSubtypeData; // Data usable by the subtype x0C-x0F | ||
63 | u16 xSubtypeDataShort[2]; // Data as 2 shorts | ||
64 | u8 xSubtypeDataChar[4]; // Data as 4 chars | ||
65 | } x; | ||
66 | |||
67 | u64 xCorrelationToken; // Unique value for source/type x10-x17 | ||
68 | }; | ||
69 | |||
70 | // Lp Event handler function | ||
71 | typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *); | ||
72 | |||
73 | // Register a handler for an event type | ||
74 | // returns 0 on success | ||
75 | extern int HvLpEvent_registerHandler( HvLpEvent_Type eventType, LpEventHandler hdlr); | ||
76 | |||
77 | // Unregister a handler for an event type | ||
78 | // This call will sleep until the handler being removed is guaranteed to | ||
79 | // be no longer executing on any CPU. Do not call with locks held. | ||
80 | // | ||
81 | // returns 0 on success | ||
82 | // Unregister will fail if there are any paths open for the type | ||
83 | extern int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType ); | ||
84 | |||
85 | // Open an Lp Event Path for an event type | ||
86 | // returns 0 on success | ||
87 | // openPath will fail if there is no handler registered for the event type. | ||
88 | // The lpIndex specified is the partition index for the target partition | ||
89 | // (for VirtualIo, VirtualLan and SessionMgr) other types specify zero) | ||
90 | extern int HvLpEvent_openPath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); | ||
91 | |||
92 | |||
93 | // Close an Lp Event Path for a type and partition | ||
94 | // returns 0 on sucess | ||
95 | extern int HvLpEvent_closePath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); | ||
96 | |||
97 | #define HvLpEvent_Type_Hypervisor 0 | ||
98 | #define HvLpEvent_Type_MachineFac 1 | ||
99 | #define HvLpEvent_Type_SessionMgr 2 | ||
100 | #define HvLpEvent_Type_SpdIo 3 | ||
101 | #define HvLpEvent_Type_VirtualBus 4 | ||
102 | #define HvLpEvent_Type_PciIo 5 | ||
103 | #define HvLpEvent_Type_RioIo 6 | ||
104 | #define HvLpEvent_Type_VirtualLan 7 | ||
105 | #define HvLpEvent_Type_VirtualIo 8 | ||
106 | #define HvLpEvent_Type_NumTypes 9 | ||
107 | |||
108 | #define HvLpEvent_Rc_Good 0 | ||
109 | #define HvLpEvent_Rc_BufferNotAvailable 1 | ||
110 | #define HvLpEvent_Rc_Cancelled 2 | ||
111 | #define HvLpEvent_Rc_GenericError 3 | ||
112 | #define HvLpEvent_Rc_InvalidAddress 4 | ||
113 | #define HvLpEvent_Rc_InvalidPartition 5 | ||
114 | #define HvLpEvent_Rc_InvalidSize 6 | ||
115 | #define HvLpEvent_Rc_InvalidSubtype 7 | ||
116 | #define HvLpEvent_Rc_InvalidSubtypeData 8 | ||
117 | #define HvLpEvent_Rc_InvalidType 9 | ||
118 | #define HvLpEvent_Rc_PartitionDead 10 | ||
119 | #define HvLpEvent_Rc_PathClosed 11 | ||
120 | #define HvLpEvent_Rc_SubtypeError 12 | ||
121 | |||
122 | #define HvLpEvent_Function_Ack 0 | ||
123 | #define HvLpEvent_Function_Int 1 | ||
124 | |||
125 | #define HvLpEvent_AckInd_NoAck 0 | ||
126 | #define HvLpEvent_AckInd_DoAck 1 | ||
127 | |||
128 | #define HvLpEvent_AckType_ImmediateAck 0 | ||
129 | #define HvLpEvent_AckType_DeferredAck 1 | ||
130 | |||
131 | #define HvLpDma_Direction_LocalToRemote 0 | ||
132 | #define HvLpDma_Direction_RemoteToLocal 1 | ||
133 | |||
134 | #define HvLpDma_AddressType_TceIndex 0 | ||
135 | #define HvLpDma_AddressType_RealAddress 1 | ||
136 | |||
137 | #define HvLpDma_Rc_Good 0 | ||
138 | #define HvLpDma_Rc_Error 1 | ||
139 | #define HvLpDma_Rc_PartitionDead 2 | ||
140 | #define HvLpDma_Rc_PathClosed 3 | ||
141 | #define HvLpDma_Rc_InvalidAddress 4 | ||
142 | #define HvLpDma_Rc_InvalidLength 5 | ||
143 | |||
144 | #endif // _HVLPEVENT_H | ||
diff --git a/include/asm-ppc64/iSeries/HvReleaseData.h b/include/asm-ppc64/iSeries/HvReleaseData.h new file mode 100644 index 000000000000..183e5e738c26 --- /dev/null +++ b/include/asm-ppc64/iSeries/HvReleaseData.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * HvReleaseData.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVRELEASEDATA_H | ||
20 | #define _HVRELEASEDATA_H | ||
21 | |||
22 | //============================================================================= | ||
23 | // | ||
24 | // This control block contains the critical information about the | ||
25 | // release so that it can be changed in the future (ie, the virtual | ||
26 | // address of the OS's NACA). | ||
27 | // | ||
28 | #include <asm/types.h> | ||
29 | #include <asm/naca.h> | ||
30 | |||
31 | //============================================================================= | ||
32 | // | ||
33 | // When we IPL a secondary partition, we will check if if the | ||
34 | // secondary xMinPlicVrmIndex > the primary xVrmIndex. | ||
35 | // If it is then this tells PLIC that this secondary is not | ||
36 | // supported running on this "old" of a level of PLIC. | ||
37 | // | ||
38 | // Likewise, we will compare the primary xMinSlicVrmIndex to | ||
39 | // the secondary xVrmIndex. | ||
40 | // If the primary xMinSlicVrmDelta > secondary xVrmDelta then we | ||
41 | // know that this PLIC does not support running an OS "that old". | ||
42 | // | ||
43 | //============================================================================= | ||
44 | |||
45 | struct HvReleaseData | ||
46 | { | ||
47 | u32 xDesc; // Descriptor "HvRD" ebcdic x00-x03 | ||
48 | u16 xSize; // Size of this control block x04-x05 | ||
49 | u16 xVpdAreasPtrOffset; // Offset in NACA of ItVpdAreas x06-x07 | ||
50 | struct naca_struct * xSlicNacaAddr; // Virt addr of SLIC NACA x08-x0F | ||
51 | u32 xMsNucDataOffset; // Offset of Linux Mapping Data x10-x13 | ||
52 | u32 xRsvd1; // Reserved x14-x17 | ||
53 | u16 xTagsMode:1; // 0 == tags active, 1 == tags inactive | ||
54 | u16 xAddressSize:1; // 0 == 64-bit, 1 == 32-bit | ||
55 | u16 xNoSharedProcs:1; // 0 == shared procs, 1 == no shared | ||
56 | u16 xNoHMT:1; // 0 == allow HMT, 1 == no HMT | ||
57 | u16 xRsvd2:12; // Reserved x18-x19 | ||
58 | u16 xVrmIndex; // VRM Index of OS image x1A-x1B | ||
59 | u16 xMinSupportedPlicVrmIndex;// Min PLIC level (soft) x1C-x1D | ||
60 | u16 xMinCompatablePlicVrmIndex;// Min PLIC levelP (hard) x1E-x1F | ||
61 | char xVrmName[12]; // Displayable name x20-x2B | ||
62 | char xRsvd3[20]; // Reserved x2C-x3F | ||
63 | }; | ||
64 | |||
65 | #endif /* _HVRELEASEDATA_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvTypes.h b/include/asm-ppc64/iSeries/HvTypes.h new file mode 100644 index 000000000000..3ec49c1aec32 --- /dev/null +++ b/include/asm-ppc64/iSeries/HvTypes.h | |||
@@ -0,0 +1,127 @@ | |||
1 | /* | ||
2 | * HvTypes.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVTYPES_H | ||
20 | #define _HVTYPES_H | ||
21 | |||
22 | //=========================================================================== | ||
23 | // Header File Id | ||
24 | // Name______________: HvTypes.H | ||
25 | // | ||
26 | // Description_______: | ||
27 | // | ||
28 | // General typedefs for the hypervisor. | ||
29 | // | ||
30 | // Declared Class(es): | ||
31 | // | ||
32 | //=========================================================================== | ||
33 | |||
34 | #include <asm/types.h> | ||
35 | |||
36 | //------------------------------------------------------------------- | ||
37 | // Typedefs | ||
38 | //------------------------------------------------------------------- | ||
39 | typedef u8 HvLpIndex; | ||
40 | typedef u16 HvLpInstanceId; | ||
41 | typedef u64 HvLpTOD; | ||
42 | typedef u64 HvLpSystemSerialNum; | ||
43 | typedef u8 HvLpDeviceSerialNum[12]; | ||
44 | typedef u16 HvLpSanHwSet; | ||
45 | typedef u16 HvLpBus; | ||
46 | typedef u16 HvLpBoard; | ||
47 | typedef u16 HvLpCard; | ||
48 | typedef u8 HvLpDeviceType[4]; | ||
49 | typedef u8 HvLpDeviceModel[3]; | ||
50 | typedef u64 HvIoToken; | ||
51 | typedef u8 HvLpName[8]; | ||
52 | typedef u32 HvIoId; | ||
53 | typedef u64 HvRealMemoryIndex; | ||
54 | typedef u32 HvLpIndexMap; // Must hold HvMaxArchitectedLps bits!!! | ||
55 | typedef u16 HvLpVrmIndex; | ||
56 | typedef u32 HvXmGenerationId; | ||
57 | typedef u8 HvLpBusPool; | ||
58 | typedef u8 HvLpSharedPoolIndex; | ||
59 | typedef u16 HvLpSharedProcUnitsX100; | ||
60 | typedef u8 HvLpVirtualLanIndex; | ||
61 | typedef u16 HvLpVirtualLanIndexMap; // Must hold HvMaxArchitectedVirtualLans bits!!! | ||
62 | typedef u16 HvBusNumber; // Hypervisor Bus Number | ||
63 | typedef u8 HvSubBusNumber; // Hypervisor SubBus Number | ||
64 | typedef u8 HvAgentId; // Hypervisor DevFn | ||
65 | |||
66 | |||
67 | #define HVMAXARCHITECTEDLPS 32 | ||
68 | #define HVMAXARCHITECTEDVIRTUALLANS 16 | ||
69 | #define HVMAXARCHITECTEDVIRTUALDISKS 32 | ||
70 | #define HVMAXARCHITECTEDVIRTUALCDROMS 8 | ||
71 | #define HVMAXARCHITECTEDVIRTUALTAPES 8 | ||
72 | #define HVCHUNKSIZE 256 * 1024 | ||
73 | #define HVPAGESIZE 4 * 1024 | ||
74 | #define HVLPMINMEGSPRIMARY 256 | ||
75 | #define HVLPMINMEGSSECONDARY 64 | ||
76 | #define HVCHUNKSPERMEG 4 | ||
77 | #define HVPAGESPERMEG 256 | ||
78 | #define HVPAGESPERCHUNK 64 | ||
79 | |||
80 | #define HvMaxArchitectedLps ((HvLpIndex)HVMAXARCHITECTEDLPS) | ||
81 | #define HvMaxArchitectedVirtualLans ((HvLpVirtualLanIndex)16) | ||
82 | #define HvLpIndexInvalid ((HvLpIndex)0xff) | ||
83 | |||
84 | //-------------------------------------------------------------------- | ||
85 | // Enums for the sub-components under PLIC | ||
86 | // Used in HvCall and HvPrimaryCall | ||
87 | //-------------------------------------------------------------------- | ||
88 | enum HvCallCompIds | ||
89 | { | ||
90 | HvCallCompId = 0, | ||
91 | HvCallCpuCtlsCompId = 1, | ||
92 | HvCallCfgCompId = 2, | ||
93 | HvCallEventCompId = 3, | ||
94 | HvCallHptCompId = 4, | ||
95 | HvCallPciCompId = 5, | ||
96 | HvCallSlmCompId = 6, | ||
97 | HvCallSmCompId = 7, | ||
98 | HvCallSpdCompId = 8, | ||
99 | HvCallXmCompId = 9, | ||
100 | HvCallRioCompId = 10, | ||
101 | HvCallRsvd3CompId = 11, | ||
102 | HvCallRsvd2CompId = 12, | ||
103 | HvCallRsvd1CompId = 13, | ||
104 | HvCallMaxCompId = 14, | ||
105 | HvPrimaryCallCompId = 0, | ||
106 | HvPrimaryCallCfgCompId = 1, | ||
107 | HvPrimaryCallPciCompId = 2, | ||
108 | HvPrimaryCallSmCompId = 3, | ||
109 | HvPrimaryCallSpdCompId = 4, | ||
110 | HvPrimaryCallXmCompId = 5, | ||
111 | HvPrimaryCallRioCompId = 6, | ||
112 | HvPrimaryCallRsvd7CompId = 7, | ||
113 | HvPrimaryCallRsvd6CompId = 8, | ||
114 | HvPrimaryCallRsvd5CompId = 9, | ||
115 | HvPrimaryCallRsvd4CompId = 10, | ||
116 | HvPrimaryCallRsvd3CompId = 11, | ||
117 | HvPrimaryCallRsvd2CompId = 12, | ||
118 | HvPrimaryCallRsvd1CompId = 13, | ||
119 | HvPrimaryCallMaxCompId = HvCallMaxCompId | ||
120 | }; | ||
121 | |||
122 | struct HvLpBufferList { | ||
123 | u64 addr; | ||
124 | u64 len; | ||
125 | }; | ||
126 | |||
127 | #endif /* _HVTYPES_H */ | ||
diff --git a/include/asm-ppc64/iSeries/IoHriMainStore.h b/include/asm-ppc64/iSeries/IoHriMainStore.h new file mode 100644 index 000000000000..ff00e865f620 --- /dev/null +++ b/include/asm-ppc64/iSeries/IoHriMainStore.h | |||
@@ -0,0 +1,167 @@ | |||
1 | /* | ||
2 | * IoHriMainStore.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef _IOHRIMAINSTORE_H | ||
21 | #define _IOHRIMAINSTORE_H | ||
22 | |||
23 | /* Main Store Vpd for Condor,iStar,sStar */ | ||
24 | struct IoHriMainStoreSegment4 { | ||
25 | u8 msArea0Exists:1; | ||
26 | u8 msArea1Exists:1; | ||
27 | u8 msArea2Exists:1; | ||
28 | u8 msArea3Exists:1; | ||
29 | u8 reserved1:4; | ||
30 | u8 reserved2; | ||
31 | |||
32 | u8 msArea0Functional:1; | ||
33 | u8 msArea1Functional:1; | ||
34 | u8 msArea2Functional:1; | ||
35 | u8 msArea3Functional:1; | ||
36 | u8 reserved3:4; | ||
37 | u8 reserved4; | ||
38 | |||
39 | u32 totalMainStore; | ||
40 | |||
41 | u64 msArea0Ptr; | ||
42 | u64 msArea1Ptr; | ||
43 | u64 msArea2Ptr; | ||
44 | u64 msArea3Ptr; | ||
45 | |||
46 | u32 cardProductionLevel; | ||
47 | |||
48 | u32 msAdrHole; | ||
49 | |||
50 | u8 msArea0HasRiserVpd:1; | ||
51 | u8 msArea1HasRiserVpd:1; | ||
52 | u8 msArea2HasRiserVpd:1; | ||
53 | u8 msArea3HasRiserVpd:1; | ||
54 | u8 reserved5:4; | ||
55 | u8 reserved6; | ||
56 | u16 reserved7; | ||
57 | |||
58 | u8 reserved8[28]; | ||
59 | |||
60 | u64 nonInterleavedBlocksStartAdr; | ||
61 | u64 nonInterleavedBlocksEndAdr; | ||
62 | }; | ||
63 | |||
64 | /* Main Store VPD for Power4 */ | ||
65 | struct IoHriMainStoreChipInfo1 { | ||
66 | u32 chipMfgID __attribute((packed)); | ||
67 | char chipECLevel[4] __attribute((packed)); | ||
68 | }; | ||
69 | |||
70 | struct IoHriMainStoreVpdIdData { | ||
71 | char typeNumber[4]; | ||
72 | char modelNumber[4]; | ||
73 | char partNumber[12]; | ||
74 | char serialNumber[12]; | ||
75 | }; | ||
76 | |||
77 | struct IoHriMainStoreVpdFruData { | ||
78 | char fruLabel[8] __attribute((packed)); | ||
79 | u8 numberOfSlots __attribute((packed)); | ||
80 | u8 pluggingType __attribute((packed)); | ||
81 | u16 slotMapIndex __attribute((packed)); | ||
82 | }; | ||
83 | |||
84 | struct IoHriMainStoreAdrRangeBlock { | ||
85 | void * blockStart __attribute((packed)); | ||
86 | void * blockEnd __attribute((packed)); | ||
87 | u32 blockProcChipId __attribute((packed)); | ||
88 | }; | ||
89 | |||
90 | #define MaxAreaAdrRangeBlocks 4 | ||
91 | |||
92 | struct IoHriMainStoreArea4 { | ||
93 | u32 msVpdFormat __attribute((packed)); | ||
94 | u8 containedVpdType __attribute((packed)); | ||
95 | u8 reserved1 __attribute((packed)); | ||
96 | u16 reserved2 __attribute((packed)); | ||
97 | |||
98 | u64 msExists __attribute((packed)); | ||
99 | u64 msFunctional __attribute((packed)); | ||
100 | |||
101 | u32 memorySize __attribute((packed)); | ||
102 | u32 procNodeId __attribute((packed)); | ||
103 | |||
104 | u32 numAdrRangeBlocks __attribute((packed)); | ||
105 | struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks] __attribute((packed)); | ||
106 | |||
107 | struct IoHriMainStoreChipInfo1 chipInfo0 __attribute((packed)); | ||
108 | struct IoHriMainStoreChipInfo1 chipInfo1 __attribute((packed)); | ||
109 | struct IoHriMainStoreChipInfo1 chipInfo2 __attribute((packed)); | ||
110 | struct IoHriMainStoreChipInfo1 chipInfo3 __attribute((packed)); | ||
111 | struct IoHriMainStoreChipInfo1 chipInfo4 __attribute((packed)); | ||
112 | struct IoHriMainStoreChipInfo1 chipInfo5 __attribute((packed)); | ||
113 | struct IoHriMainStoreChipInfo1 chipInfo6 __attribute((packed)); | ||
114 | struct IoHriMainStoreChipInfo1 chipInfo7 __attribute((packed)); | ||
115 | |||
116 | void * msRamAreaArray __attribute((packed)); | ||
117 | u32 msRamAreaArrayNumEntries __attribute((packed)); | ||
118 | u32 msRamAreaArrayEntrySize __attribute((packed)); | ||
119 | |||
120 | u32 numaDimmExists __attribute((packed)); | ||
121 | u32 numaDimmFunctional __attribute((packed)); | ||
122 | void * numaDimmArray __attribute((packed)); | ||
123 | u32 numaDimmArrayNumEntries __attribute((packed)); | ||
124 | u32 numaDimmArrayEntrySize __attribute((packed)); | ||
125 | |||
126 | struct IoHriMainStoreVpdIdData idData __attribute((packed)); | ||
127 | |||
128 | u64 powerData __attribute((packed)); | ||
129 | u64 cardAssemblyPartNum __attribute((packed)); | ||
130 | u64 chipSerialNum __attribute((packed)); | ||
131 | |||
132 | u64 reserved3 __attribute((packed)); | ||
133 | char reserved4[16] __attribute((packed)); | ||
134 | |||
135 | struct IoHriMainStoreVpdFruData fruData __attribute((packed)); | ||
136 | |||
137 | u8 vpdPortNum __attribute((packed)); | ||
138 | u8 reserved5 __attribute((packed)); | ||
139 | u8 frameId __attribute((packed)); | ||
140 | u8 rackUnit __attribute((packed)); | ||
141 | char asciiKeywordVpd[256] __attribute((packed)); | ||
142 | u32 reserved6 __attribute((packed)); | ||
143 | }; | ||
144 | |||
145 | |||
146 | struct IoHriMainStoreSegment5 { | ||
147 | u16 reserved1; | ||
148 | u8 reserved2; | ||
149 | u8 msVpdFormat; | ||
150 | |||
151 | u32 totalMainStore; | ||
152 | u64 maxConfiguredMsAdr; | ||
153 | |||
154 | struct IoHriMainStoreArea4* msAreaArray; | ||
155 | u32 msAreaArrayNumEntries; | ||
156 | u32 msAreaArrayEntrySize; | ||
157 | |||
158 | u32 msAreaExists; | ||
159 | u32 msAreaFunctional; | ||
160 | |||
161 | u64 reserved3; | ||
162 | }; | ||
163 | |||
164 | |||
165 | |||
166 | #endif // _IOHRIMAINSTORE_H | ||
167 | |||
diff --git a/include/asm-ppc64/iSeries/IoHriProcessorVpd.h b/include/asm-ppc64/iSeries/IoHriProcessorVpd.h new file mode 100644 index 000000000000..965433888653 --- /dev/null +++ b/include/asm-ppc64/iSeries/IoHriProcessorVpd.h | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * IoHriProcessorVpd.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _IOHRIPROCESSORVPD_H | ||
20 | #define _IOHRIPROCESSORVPD_H | ||
21 | |||
22 | //=================================================================== | ||
23 | // | ||
24 | // This struct maps Processor Vpd that is DMAd to SLIC by CSP | ||
25 | // | ||
26 | |||
27 | #include <asm/types.h> | ||
28 | |||
29 | struct IoHriProcessorVpd | ||
30 | { | ||
31 | |||
32 | u8 xFormat; // VPD format indicator x00-x00 | ||
33 | u8 xProcStatus:8; // Processor State x01-x01 | ||
34 | u8 xSecondaryThreadCount; // Secondary thread cnt x02-x02 | ||
35 | u8 xSrcType:1; // Src Type x03-x03 | ||
36 | u8 xSrcSoft:1; // Src stay soft ... | ||
37 | u8 xSrcParable:1; // Src parable ... | ||
38 | u8 xRsvd1:5; // Reserved ... | ||
39 | u16 xHvPhysicalProcIndex; // Hypervisor physical proc index04-x05 | ||
40 | u16 xRsvd2; // Reserved x06-x07 | ||
41 | u32 xHwNodeId; // Hardware node id x08-x0B | ||
42 | u32 xHwProcId; // Hardware processor id x0C-x0F | ||
43 | |||
44 | u32 xTypeNum; // Card Type/CCIN number x10-x13 | ||
45 | u32 xModelNum; // Model/Feature number x14-x17 | ||
46 | u64 xSerialNum; // Serial number x18-x1F | ||
47 | char xPartNum[12]; // Book Part or FPU number x20-x2B | ||
48 | char xMfgID[4]; // Manufacturing ID x2C-x2F | ||
49 | |||
50 | u32 xProcFreq; // Processor Frequency x30-x33 | ||
51 | u32 xTimeBaseFreq; // Time Base Frequency x34-x37 | ||
52 | |||
53 | u32 xChipEcLevel; // Chip EC Levels x38-x3B | ||
54 | u32 xProcIdReg; // PIR SPR value x3C-x3F | ||
55 | u32 xPVR; // PVR value x40-x43 | ||
56 | u8 xRsvd3[12]; // Reserved x44-x4F | ||
57 | |||
58 | u32 xInstCacheSize; // Instruction cache size in KB x50-x53 | ||
59 | u32 xInstBlockSize; // Instruction cache block size x54-x57 | ||
60 | u32 xDataCacheOperandSize; // Data cache operand size x58-x5B | ||
61 | u32 xInstCacheOperandSize; // Inst cache operand size x5C-x5F | ||
62 | |||
63 | u32 xDataL1CacheSizeKB; // L1 data cache size in KB x60-x63 | ||
64 | u32 xDataL1CacheLineSize; // L1 data cache block size x64-x67 | ||
65 | u64 xRsvd4; // Reserved x68-x6F | ||
66 | |||
67 | u32 xDataL2CacheSizeKB; // L2 data cache size in KB x70-x73 | ||
68 | u32 xDataL2CacheLineSize; // L2 data cache block size x74-x77 | ||
69 | u64 xRsvd5; // Reserved x78-x7F | ||
70 | |||
71 | u32 xDataL3CacheSizeKB; // L3 data cache size in KB x80-x83 | ||
72 | u32 xDataL3CacheLineSize; // L3 data cache block size x84-x87 | ||
73 | u64 xRsvd6; // Reserved x88-x8F | ||
74 | |||
75 | u64 xFruLabel; // Card Location Label x90-x97 | ||
76 | u8 xSlotsOnCard; // Slots on card (0=no slots) x98-x98 | ||
77 | u8 xPartLocFlag; // Location flag (0-pluggable 1-imbedded) x99-x99 | ||
78 | u16 xSlotMapIndex; // Index in slot map table x9A-x9B | ||
79 | u8 xSmartCardPortNo; // Smart card port number x9C-x9C | ||
80 | u8 xRsvd7; // Reserved x9D-x9D | ||
81 | u16 xFrameIdAndRackUnit; // Frame ID and rack unit adr x9E-x9F | ||
82 | |||
83 | u8 xRsvd8[24]; // Reserved xA0-xB7 | ||
84 | |||
85 | char xProcSrc[72]; // CSP format SRC xB8-xFF | ||
86 | }; | ||
87 | |||
88 | #endif /* _IOHRIPROCESSORVPD_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItExtVpdPanel.h b/include/asm-ppc64/iSeries/ItExtVpdPanel.h new file mode 100644 index 000000000000..dee6b1273031 --- /dev/null +++ b/include/asm-ppc64/iSeries/ItExtVpdPanel.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * ItExtVpdPanel.h | ||
3 | * Copyright (C) 2002 Dave Boutcher IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ITEXTVPDPANEL_H | ||
20 | #define _ITEXTVPDPANEL_H | ||
21 | |||
22 | /* | ||
23 | * | ||
24 | * This struct maps the panel information | ||
25 | * | ||
26 | * Warning: | ||
27 | * This data must match the architecture for the panel information | ||
28 | * | ||
29 | */ | ||
30 | |||
31 | |||
32 | /*------------------------------------------------------------------- | ||
33 | * Standard Includes | ||
34 | *------------------------------------------------------------------- | ||
35 | */ | ||
36 | #include <asm/types.h> | ||
37 | |||
38 | struct ItExtVpdPanel | ||
39 | { | ||
40 | // Definition of the Extended Vpd On Panel Data Area | ||
41 | char systemSerial[8]; | ||
42 | char mfgID[4]; | ||
43 | char reserved1[24]; | ||
44 | char machineType[4]; | ||
45 | char systemID[6]; | ||
46 | char somUniqueCnt[4]; | ||
47 | char serialNumberCount; | ||
48 | char reserved2[7]; | ||
49 | u16 bbu3; | ||
50 | u16 bbu2; | ||
51 | u16 bbu1; | ||
52 | char xLocationLabel[8]; | ||
53 | u8 xRsvd1[6]; | ||
54 | u16 xFrameId; | ||
55 | u8 xRsvd2[48]; | ||
56 | }; | ||
57 | |||
58 | #endif /* _ITEXTVPDPANEL_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItIplParmsReal.h b/include/asm-ppc64/iSeries/ItIplParmsReal.h new file mode 100644 index 000000000000..4d8b430ab12d --- /dev/null +++ b/include/asm-ppc64/iSeries/ItIplParmsReal.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * ItIplParmsReal.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ITIPLPARMSREAL_H | ||
20 | #define _ITIPLPARMSREAL_H | ||
21 | |||
22 | //============================================================================== | ||
23 | // | ||
24 | // This struct maps the IPL Parameters DMA'd from the SP. | ||
25 | // | ||
26 | // Warning: | ||
27 | // This data must map in exactly 64 bytes and match the architecture for | ||
28 | // the IPL parms | ||
29 | // | ||
30 | //============================================================================= | ||
31 | |||
32 | |||
33 | //------------------------------------------------------------------- | ||
34 | // Standard Includes | ||
35 | //------------------------------------------------------------------- | ||
36 | #include <asm/types.h> | ||
37 | |||
38 | struct ItIplParmsReal | ||
39 | { | ||
40 | u8 xFormat; // Defines format of IplParms x00-x00 | ||
41 | u8 xRsvd01:6; // Reserved x01-x01 | ||
42 | u8 xAlternateSearch:1; // Alternate search indicator ... | ||
43 | u8 xUaSupplied:1; // UA Supplied on programmed IPL ... | ||
44 | u8 xLsUaFormat; // Format byte for UA x02-x02 | ||
45 | u8 xRsvd02; // Reserved x03-x03 | ||
46 | u32 xLsUa; // LS UA x04-x07 | ||
47 | u32 xUnusedLsLid; // First OS LID to load x08-x0B | ||
48 | u16 xLsBusNumber; // LS Bus Number x0C-x0D | ||
49 | u8 xLsCardAdr; // LS Card Address x0E-x0E | ||
50 | u8 xLsBoardAdr; // LS Board Address x0F-x0F | ||
51 | u32 xRsvd03; // Reserved x10-x13 | ||
52 | u8 xSpcnPresent:1; // SPCN present x14-x14 | ||
53 | u8 xCpmPresent:1; // CPM present ... | ||
54 | u8 xRsvd04:6; // Reserved ... | ||
55 | u8 xRsvd05:4; // Reserved x15-x15 | ||
56 | u8 xKeyLock:4; // Keylock setting ... | ||
57 | u8 xRsvd06:6; // Reserved x16-x16 | ||
58 | u8 xIplMode:2; // Ipl mode (A|B|C|D) ... | ||
59 | u8 xHwIplType; // Fast v slow v slow EC HW IPL x17-x17 | ||
60 | u16 xCpmEnabledIpl:1; // CPM in effect when IPL initiated x18-x19 | ||
61 | u16 xPowerOnResetIpl:1; // Indicate POR condition ... | ||
62 | u16 xMainStorePreserved:1; // Main Storage is preserved ... | ||
63 | u16 xRsvd07:13; // Reserved ... | ||
64 | u16 xIplSource:16; // Ipl source x1A-x1B | ||
65 | u8 xIplReason:8; // Reason for this IPL x1C-x1C | ||
66 | u8 xRsvd08; // Reserved x1D-x1D | ||
67 | u16 xRsvd09; // Reserved x1E-x1F | ||
68 | u16 xSysBoxType; // System Box Type x20-x21 | ||
69 | u16 xSysProcType; // System Processor Type x22-x23 | ||
70 | u32 xRsvd10; // Reserved x24-x27 | ||
71 | u64 xRsvd11; // Reserved x28-x2F | ||
72 | u64 xRsvd12; // Reserved x30-x37 | ||
73 | u64 xRsvd13; // Reserved x38-x3F | ||
74 | }; | ||
75 | |||
76 | #endif /* _ITIPLPARMSREAL_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItLpNaca.h b/include/asm-ppc64/iSeries/ItLpNaca.h new file mode 100644 index 000000000000..5baffddfae1b --- /dev/null +++ b/include/asm-ppc64/iSeries/ItLpNaca.h | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * ItLpNaca.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ITLPNACA_H | ||
20 | #define _ITLPNACA_H | ||
21 | |||
22 | //============================================================================= | ||
23 | // | ||
24 | // This control block contains the data that is shared between the | ||
25 | // hypervisor (PLIC) and the OS. | ||
26 | // | ||
27 | //============================================================================= | ||
28 | |||
29 | struct ItLpNaca | ||
30 | { | ||
31 | //============================================================================= | ||
32 | // CACHE_LINE_1 0x0000 - 0x007F Contains read-only data | ||
33 | //============================================================================= | ||
34 | u32 xDesc; // Eye catcher x00-x03 | ||
35 | u16 xSize; // Size of this class x04-x05 | ||
36 | u16 xIntHdlrOffset; // Offset to IntHdlr array x06-x07 | ||
37 | u8 xMaxIntHdlrEntries; // Number of entries in array x08-x08 | ||
38 | u8 xPrimaryLpIndex; // LP Index of Primary x09-x09 | ||
39 | u8 xServiceLpIndex; // LP Ind of Service Focal Pointx0A-x0A | ||
40 | u8 xLpIndex; // LP Index x0B-x0B | ||
41 | u16 xMaxLpQueues; // Number of allocated queues x0C-x0D | ||
42 | u16 xLpQueueOffset; // Offset to start of LP queues x0E-x0F | ||
43 | u8 xPirEnvironMode:8; // Piranha or hardware x10-x10 | ||
44 | u8 xPirConsoleMode:8; // Piranha console indicator x11-x11 | ||
45 | u8 xPirDasdMode:8; // Piranha dasd indicator x12-x12 | ||
46 | u8 xRsvd1_0[5]; // Reserved for Piranha related x13-x17 | ||
47 | u8 xLparInstalled:1; // Is LPAR installed on system x18-x1F | ||
48 | u8 xSysPartitioned:1; // Is the system partitioned ... | ||
49 | u8 xHwSyncedTBs:1; // Hardware synced TBs ... | ||
50 | u8 xIntProcUtilHmt:1; // Utilize HMT for interrupts ... | ||
51 | u8 xRsvd1_1:4; // Reserved ... | ||
52 | u8 xSpVpdFormat:8; // VPD areas are in CSP format ... | ||
53 | u8 xIntProcRatio:8; // Ratio of int procs to procs ... | ||
54 | u8 xRsvd1_2[5]; // Reserved ... | ||
55 | u16 xRsvd1_3; // Reserved x20-x21 | ||
56 | u16 xPlicVrmIndex; // VRM index of PLIC x22-x23 | ||
57 | u16 xMinSupportedSlicVrmInd;// Min supported OS VRM index x24-x25 | ||
58 | u16 xMinCompatableSlicVrmInd;// Min compatible OS VRM index x26-x27 | ||
59 | u64 xLoadAreaAddr; // ER address of load area x28-x2F | ||
60 | u32 xLoadAreaChunks; // Chunks for the load area x30-x33 | ||
61 | u32 xPaseSysCallCRMask; // Mask used to test CR before x34-x37 | ||
62 | // doing an ASR switch on PASE | ||
63 | // system call. | ||
64 | u64 xSlicSegmentTablePtr; // Pointer to Slic seg table. x38-x3f | ||
65 | u8 xRsvd1_4[64]; // x40-x7F | ||
66 | |||
67 | //============================================================================= | ||
68 | // CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data | ||
69 | //============================================================================= | ||
70 | u8 xRsvd2_0[128]; // Reserved x00-x7F | ||
71 | |||
72 | //============================================================================= | ||
73 | // CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators | ||
74 | // NB: Padding required to keep xInterrruptHdlr at x300 which is required | ||
75 | // for v4r4 PLIC. | ||
76 | //============================================================================= | ||
77 | u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F | ||
78 | u8 xRsvd3_0[384]; // Reserved 180-2FF | ||
79 | //============================================================================= | ||
80 | // CACHE_LINE_7-8 0x0300 - 0x03FF Contains the address of the OS interrupt | ||
81 | // handlers | ||
82 | //============================================================================= | ||
83 | u64 xInterruptHdlr[32]; // Interrupt handlers 300-x3FF | ||
84 | }; | ||
85 | |||
86 | //============================================================================= | ||
87 | |||
88 | #endif /* _ITLPNACA_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItLpQueue.h b/include/asm-ppc64/iSeries/ItLpQueue.h new file mode 100644 index 000000000000..4f4dde2a638d --- /dev/null +++ b/include/asm-ppc64/iSeries/ItLpQueue.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * ItLpQueue.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ITLPQUEUE_H | ||
20 | #define _ITLPQUEUE_H | ||
21 | |||
22 | //============================================================================= | ||
23 | // | ||
24 | // This control block defines the simple LP queue structure that is | ||
25 | // shared between the hypervisor (PLIC) and the OS in order to send | ||
26 | // events to an LP. | ||
27 | // | ||
28 | |||
29 | #include <asm/types.h> | ||
30 | #include <asm/ptrace.h> | ||
31 | |||
32 | struct HvLpEvent; | ||
33 | |||
34 | #define ITMaxLpQueues 8 | ||
35 | |||
36 | #define NotUsed 0 // Queue will not be used by PLIC | ||
37 | #define DedicatedIo 1 // Queue dedicated to IO processor specified | ||
38 | #define DedicatedLp 2 // Queue dedicated to LP specified | ||
39 | #define Shared 3 // Queue shared for both IO and LP | ||
40 | |||
41 | #define LpEventStackSize 4096 | ||
42 | #define LpEventMaxSize 256 | ||
43 | #define LpEventAlign 64 | ||
44 | |||
45 | struct ItLpQueue | ||
46 | { | ||
47 | // | ||
48 | // The xSlicCurEventPtr is the pointer to the next event stack entry that will | ||
49 | // become valid. The OS must peek at this entry to determine if it is valid. | ||
50 | // PLIC will set the valid indicator as the very last store into that entry. | ||
51 | // | ||
52 | // When the OS has completed processing of the event then it will mark the event | ||
53 | // as invalid so that PLIC knows it can store into that event location again. | ||
54 | // | ||
55 | // If the event stack fills and there are overflow events, then PLIC will set | ||
56 | // the xPlicOverflowIntPending flag in which case the OS will have to fetch the | ||
57 | // additional LP events once they have drained the event stack. | ||
58 | // | ||
59 | // The first 16-bytes are known by both the OS and PLIC. The remainder of the | ||
60 | // cache line is for use by the OS. | ||
61 | // | ||
62 | //============================================================================= | ||
63 | u8 xPlicOverflowIntPending;// 0x00 Overflow events are pending | ||
64 | u8 xPlicStatus; // 0x01 DedicatedIo or DedicatedLp or NotUsed | ||
65 | u16 xSlicLogicalProcIndex; // 0x02 Logical Proc Index for correlation | ||
66 | u8 xPlicRsvd[12]; // 0x04 | ||
67 | char* xSlicCurEventPtr; // 0x10 | ||
68 | char* xSlicLastValidEventPtr; // 0x18 | ||
69 | char* xSlicEventStackPtr; // 0x20 | ||
70 | u8 xIndex; // 0x28 unique sequential index. | ||
71 | u8 xSlicRsvd[3]; // 0x29-2b | ||
72 | u32 xInUseWord; // 0x2C | ||
73 | u64 xLpIntCount; // 0x30 Total Lp Int msgs processed | ||
74 | u64 xLpIntCountByType[9]; // 0x38-0x7F Event counts by type | ||
75 | }; | ||
76 | |||
77 | extern struct ItLpQueue xItLpQueue; | ||
78 | |||
79 | extern struct HvLpEvent * ItLpQueue_getNextLpEvent( struct ItLpQueue * ); | ||
80 | extern int ItLpQueue_isLpIntPending( struct ItLpQueue * ); | ||
81 | extern unsigned ItLpQueue_process( struct ItLpQueue *, struct pt_regs * ); | ||
82 | extern void ItLpQueue_clearValid( struct HvLpEvent * ); | ||
83 | |||
84 | static __inline__ void process_iSeries_events( void ) | ||
85 | { | ||
86 | __asm__ __volatile__ ( | ||
87 | " li 0,0x5555 \n\ | ||
88 | sc" | ||
89 | : : : "r0", "r3" ); | ||
90 | } | ||
91 | |||
92 | #endif /* _ITLPQUEUE_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItLpRegSave.h b/include/asm-ppc64/iSeries/ItLpRegSave.h new file mode 100644 index 000000000000..dafc4c813788 --- /dev/null +++ b/include/asm-ppc64/iSeries/ItLpRegSave.h | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | * ItLpRegSave.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ITLPREGSAVE_H | ||
20 | #define _ITLPREGSAVE_H | ||
21 | |||
22 | //===================================================================================== | ||
23 | // | ||
24 | // This control block contains the data that is shared between PLIC | ||
25 | // and the OS | ||
26 | // | ||
27 | // | ||
28 | |||
29 | struct ItLpRegSave | ||
30 | { | ||
31 | u32 xDesc; // Eye catcher "LpRS" ebcdic 000-003 | ||
32 | u16 xSize; // Size of this class 004-005 | ||
33 | u8 xInUse; // Area is live 006-007 | ||
34 | u8 xRsvd1[9]; // Reserved 007-00F | ||
35 | |||
36 | u8 xFixedRegSave[352]; // Fixed Register Save Area 010-16F | ||
37 | u32 xCTRL; // Control Register 170-173 | ||
38 | u32 xDEC; // Decrementer 174-177 | ||
39 | u32 xFPSCR; // FP Status and Control Reg 178-17B | ||
40 | u32 xPVR; // Processor Version Number 17C-17F | ||
41 | |||
42 | u64 xMMCR0; // Monitor Mode Control Reg 0 180-187 | ||
43 | u32 xPMC1; // Perf Monitor Counter 1 188-18B | ||
44 | u32 xPMC2; // Perf Monitor Counter 2 18C-18F | ||
45 | u32 xPMC3; // Perf Monitor Counter 3 190-193 | ||
46 | u32 xPMC4; // Perf Monitor Counter 4 194-197 | ||
47 | u32 xPIR; // Processor ID Reg 198-19B | ||
48 | |||
49 | u32 xMMCR1; // Monitor Mode Control Reg 1 19C-19F | ||
50 | u32 xMMCRA; // Monitor Mode Control Reg A 1A0-1A3 | ||
51 | u32 xPMC5; // Perf Monitor Counter 5 1A4-1A7 | ||
52 | u32 xPMC6; // Perf Monitor Counter 6 1A8-1AB | ||
53 | u32 xPMC7; // Perf Monitor Counter 7 1AC-1AF | ||
54 | u32 xPMC8; // Perf Monitor Counter 8 1B0-1B3 | ||
55 | u32 xTSC; // Thread Switch Control 1B4-1B7 | ||
56 | u32 xTST; // Thread Switch Timeout 1B8-1BB | ||
57 | u32 xRsvd; // Reserved 1BC-1BF | ||
58 | |||
59 | u64 xACCR; // Address Compare Control Reg 1C0-1C7 | ||
60 | u64 xIMR; // Instruction Match Register 1C8-1CF | ||
61 | u64 xSDR1; // Storage Description Reg 1 1D0-1D7 | ||
62 | u64 xSPRG0; // Special Purpose Reg General0 1D8-1DF | ||
63 | u64 xSPRG1; // Special Purpose Reg General1 1E0-1E7 | ||
64 | u64 xSPRG2; // Special Purpose Reg General2 1E8-1EF | ||
65 | u64 xSPRG3; // Special Purpose Reg General3 1F0-1F7 | ||
66 | u64 xTB; // Time Base Register 1F8-1FF | ||
67 | |||
68 | u64 xFPR[32]; // Floating Point Registers 200-2FF | ||
69 | |||
70 | u64 xMSR; // Machine State Register 300-307 | ||
71 | u64 xNIA; // Next Instruction Address 308-30F | ||
72 | |||
73 | u64 xDABR; // Data Address Breakpoint Reg 310-317 | ||
74 | u64 xIABR; // Inst Address Breakpoint Reg 318-31F | ||
75 | |||
76 | u64 xHID0; // HW Implementation Dependent0 320-327 | ||
77 | |||
78 | u64 xHID4; // HW Implementation Dependent4 328-32F | ||
79 | u64 xSCOMd; // SCON Data Reg (SPRG4) 330-337 | ||
80 | u64 xSCOMc; // SCON Command Reg (SPRG5) 338-33F | ||
81 | u64 xSDAR; // Sample Data Address Register 340-347 | ||
82 | u64 xSIAR; // Sample Inst Address Register 348-34F | ||
83 | |||
84 | u8 xRsvd3[176]; // Reserved 350-3FF | ||
85 | }; | ||
86 | |||
87 | #endif /* _ITLPREGSAVE_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItSpCommArea.h b/include/asm-ppc64/iSeries/ItSpCommArea.h new file mode 100644 index 000000000000..f1b56f9e11e2 --- /dev/null +++ b/include/asm-ppc64/iSeries/ItSpCommArea.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * ItSpCommArea.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | |||
21 | #ifndef _ITSPCOMMAREA_H | ||
22 | #define _ITSPCOMMAREA_H | ||
23 | |||
24 | |||
25 | struct SpCommArea | ||
26 | { | ||
27 | u32 xDesc; // Descriptor (only in new formats) 000-003 | ||
28 | u8 xFormat; // Format (only in new formats) 004-004 | ||
29 | u8 xRsvd1[11]; // Reserved 005-00F | ||
30 | u64 xRawTbAtIplStart; // Raw HW TB value when IPL is started 010-017 | ||
31 | u64 xRawTodAtIplStart; // Raw HW TOD value when IPL is started 018-01F | ||
32 | u64 xBcdTimeAtIplStart; // BCD time when IPL is started 020-027 | ||
33 | u64 xBcdTimeAtOsStart; // BCD time when OS passed control 028-02F | ||
34 | u8 xRsvd2[80]; // Reserved 030-07F | ||
35 | }; | ||
36 | |||
37 | extern struct SpCommArea xSpCommArea; | ||
38 | |||
39 | #endif /* _ITSPCOMMAREA_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItVpdAreas.h b/include/asm-ppc64/iSeries/ItVpdAreas.h new file mode 100644 index 000000000000..d120439f30a5 --- /dev/null +++ b/include/asm-ppc64/iSeries/ItVpdAreas.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * ItVpdAreas.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ITVPDAREAS_H | ||
20 | #define _ITVPDAREAS_H | ||
21 | |||
22 | //===================================================================================== | ||
23 | // | ||
24 | // This file defines the address and length of all of the VPD area passed to | ||
25 | // the OS from PLIC (most of which start from the SP). | ||
26 | // | ||
27 | |||
28 | #include <asm/types.h> | ||
29 | |||
30 | // VPD Entry index is carved in stone - cannot be changed (easily). | ||
31 | #define ItVpdCecVpd 0 | ||
32 | #define ItVpdDynamicSpace 1 | ||
33 | #define ItVpdExtVpd 2 | ||
34 | #define ItVpdExtVpdOnPanel 3 | ||
35 | #define ItVpdFirstPaca 4 | ||
36 | #define ItVpdIoVpd 5 | ||
37 | #define ItVpdIplParms 6 | ||
38 | #define ItVpdMsVpd 7 | ||
39 | #define ItVpdPanelVpd 8 | ||
40 | #define ItVpdLpNaca 9 | ||
41 | #define ItVpdBackplaneAndMaybeClockCardVpd 10 | ||
42 | #define ItVpdRecoveryLogBuffer 11 | ||
43 | #define ItVpdSpCommArea 12 | ||
44 | #define ItVpdSpLogBuffer 13 | ||
45 | #define ItVpdSpLogBufferSave 14 | ||
46 | #define ItVpdSpCardVpd 15 | ||
47 | #define ItVpdFirstProcVpd 16 | ||
48 | #define ItVpdApModelVpd 17 | ||
49 | #define ItVpdClockCardVpd 18 | ||
50 | #define ItVpdBusExtCardVpd 19 | ||
51 | #define ItVpdProcCapacityVpd 20 | ||
52 | #define ItVpdInteractiveCapacityVpd 21 | ||
53 | #define ItVpdFirstSlotLabel 22 | ||
54 | #define ItVpdFirstLpQueue 23 | ||
55 | #define ItVpdFirstL3CacheVpd 24 | ||
56 | #define ItVpdFirstProcFruVpd 25 | ||
57 | |||
58 | #define ItVpdMaxEntries 26 | ||
59 | |||
60 | |||
61 | #define ItDmaMaxEntries 10 | ||
62 | |||
63 | #define ItVpdAreasMaxSlotLabels 192 | ||
64 | |||
65 | |||
66 | struct SlicVpdAdrs { | ||
67 | u32 pad1; | ||
68 | void * vpdAddr; | ||
69 | }; | ||
70 | |||
71 | |||
72 | struct ItVpdAreas | ||
73 | { | ||
74 | u32 xSlicDesc; // Descriptor 000-003 | ||
75 | u16 xSlicSize; // Size of this control block 004-005 | ||
76 | u16 xPlicAdjustVpdLens:1; // Flag to indicate new interface 006-007 | ||
77 | u16 xRsvd1:15; // Reserved bits ... | ||
78 | u16 xSlicVpdEntries; // Number of VPD entries 008-009 | ||
79 | u16 xSlicDmaEntries; // Number of DMA entries 00A-00B | ||
80 | u16 xSlicMaxLogicalProcs; // Maximum logical processors 00C-00D | ||
81 | u16 xSlicMaxPhysicalProcs; // Maximum physical processors 00E-00F | ||
82 | u16 xSlicDmaToksOffset; // Offset into this of array 010-011 | ||
83 | u16 xSlicVpdAdrsOffset; // Offset into this of array 012-013 | ||
84 | u16 xSlicDmaLensOffset; // Offset into this of array 014-015 | ||
85 | u16 xSlicVpdLensOffset; // Offset into this of array 016-017 | ||
86 | u16 xSlicMaxSlotLabels; // Maximum number of slot labels 018-019 | ||
87 | u16 xSlicMaxLpQueues; // Maximum number of LP Queues 01A-01B | ||
88 | u8 xRsvd2[4]; // Reserved 01C-01F | ||
89 | u64 xRsvd3[12]; // Reserved 020-07F | ||
90 | u32 xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths 080-0A7 | ||
91 | u32 xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens 0A8-0CF | ||
92 | u32 xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths 0D0-12F | ||
93 | void * xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF | ||
94 | }; | ||
95 | |||
96 | #endif /* _ITVPDAREAS_H */ | ||
diff --git a/include/asm-ppc64/iSeries/LparData.h b/include/asm-ppc64/iSeries/LparData.h new file mode 100644 index 000000000000..e54f3b686e58 --- /dev/null +++ b/include/asm-ppc64/iSeries/LparData.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * LparData.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef _LPARDATA_H | ||
21 | #define _LPARDATA_H | ||
22 | |||
23 | #include <asm/types.h> | ||
24 | #include <asm/page.h> | ||
25 | #include <asm/abs_addr.h> | ||
26 | |||
27 | #include <asm/iSeries/ItLpNaca.h> | ||
28 | #include <asm/iSeries/ItLpRegSave.h> | ||
29 | #include <asm/iSeries/HvReleaseData.h> | ||
30 | #include <asm/iSeries/LparMap.h> | ||
31 | #include <asm/iSeries/ItVpdAreas.h> | ||
32 | #include <asm/iSeries/ItIplParmsReal.h> | ||
33 | #include <asm/iSeries/ItExtVpdPanel.h> | ||
34 | #include <asm/iSeries/ItLpQueue.h> | ||
35 | #include <asm/iSeries/IoHriProcessorVpd.h> | ||
36 | |||
37 | extern struct LparMap xLparMap; | ||
38 | extern struct HvReleaseData hvReleaseData; | ||
39 | extern struct ItLpNaca itLpNaca; | ||
40 | extern struct ItIplParmsReal xItIplParmsReal; | ||
41 | extern struct ItExtVpdPanel xItExtVpdPanel; | ||
42 | extern struct IoHriProcessorVpd xIoHriProcessorVpd[]; | ||
43 | extern struct ItLpQueue xItLpQueue; | ||
44 | extern struct ItVpdAreas itVpdAreas; | ||
45 | extern u64 xMsVpd[]; | ||
46 | extern struct msChunks msChunks; | ||
47 | |||
48 | |||
49 | #endif /* _LPARDATA_H */ | ||
diff --git a/include/asm-ppc64/iSeries/LparMap.h b/include/asm-ppc64/iSeries/LparMap.h new file mode 100644 index 000000000000..075205bb0f4a --- /dev/null +++ b/include/asm-ppc64/iSeries/LparMap.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * LparMap.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _LPARMAP_H | ||
20 | #define _LPARMAP_H | ||
21 | |||
22 | #include <asm/types.h> | ||
23 | |||
24 | /* The iSeries hypervisor will set up mapping for one or more | ||
25 | * ESID/VSID pairs (in SLB/segment registers) and will set up | ||
26 | * mappings of one or more ranges of pages to VAs. | ||
27 | * We will have the hypervisor set up the ESID->VSID mapping | ||
28 | * for the four kernel segments (C-F). With shared processors, | ||
29 | * the hypervisor will clear all segment registers and reload | ||
30 | * these four whenever the processor is switched from one | ||
31 | * partition to another. | ||
32 | */ | ||
33 | |||
34 | /* The Vsid and Esid identified below will be used by the hypervisor | ||
35 | * to set up a memory mapping for part of the load area before giving | ||
36 | * control to the Linux kernel. The load area is 64 MB, but this must | ||
37 | * not attempt to map the whole load area. The Hashed Page Table may | ||
38 | * need to be located within the load area (if the total partition size | ||
39 | * is 64 MB), but cannot be mapped. Typically, this should specify | ||
40 | * to map half (32 MB) of the load area. | ||
41 | * | ||
42 | * The hypervisor will set up page table entries for the number of | ||
43 | * pages specified. | ||
44 | * | ||
45 | * In 32-bit mode, the hypervisor will load all four of the | ||
46 | * segment registers (identified by the low-order four bits of the | ||
47 | * Esid field. In 64-bit mode, the hypervisor will load one SLB | ||
48 | * entry to map the Esid to the Vsid. | ||
49 | */ | ||
50 | |||
51 | // Hypervisor initially maps 32MB of the load area | ||
52 | #define HvPagesToMap 8192 | ||
53 | |||
54 | struct LparMap | ||
55 | { | ||
56 | u64 xNumberEsids; // Number of ESID/VSID pairs (1) | ||
57 | u64 xNumberRanges; // Number of VA ranges to map (1) | ||
58 | u64 xSegmentTableOffs; // Page number within load area of seg table (0) | ||
59 | u64 xRsvd[5]; // Reserved (0) | ||
60 | u64 xKernelEsid; // Esid used to map kernel load (0x0C00000000) | ||
61 | u64 xKernelVsid; // Vsid used to map kernel load (0x0C00000000) | ||
62 | u64 xPages; // Number of pages to be mapped (8192) | ||
63 | u64 xOffset; // Offset from start of load area (0) | ||
64 | u64 xVPN; // Virtual Page Number (0x000C000000000000) | ||
65 | }; | ||
66 | |||
67 | #endif /* _LPARMAP_H */ | ||
diff --git a/include/asm-ppc64/iSeries/XmPciLpEvent.h b/include/asm-ppc64/iSeries/XmPciLpEvent.h new file mode 100644 index 000000000000..a3d27f116e49 --- /dev/null +++ b/include/asm-ppc64/iSeries/XmPciLpEvent.h | |||
@@ -0,0 +1,18 @@ | |||
1 | |||
2 | #ifndef __XMPCILPEVENT_H__ | ||
3 | #define __XMPCILPEVENT_H__ | ||
4 | |||
5 | |||
6 | #ifdef __cplusplus | ||
7 | extern "C" { | ||
8 | #endif | ||
9 | |||
10 | int XmPciLpEvent_init(void); | ||
11 | void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq); | ||
12 | |||
13 | |||
14 | #ifdef __cplusplus | ||
15 | } | ||
16 | #endif | ||
17 | |||
18 | #endif /* __XMPCILPEVENT_H__ */ | ||
diff --git a/include/asm-ppc64/iSeries/iSeries_io.h b/include/asm-ppc64/iSeries/iSeries_io.h new file mode 100644 index 000000000000..f52b7599b372 --- /dev/null +++ b/include/asm-ppc64/iSeries/iSeries_io.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef _ISERIES_IO_H | ||
2 | #define _ISERIES_IO_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef CONFIG_PPC_ISERIES | ||
7 | #include <linux/types.h> | ||
8 | /************************************************************************/ | ||
9 | /* File iSeries_io.h created by Allan Trautman on Thu Dec 28 2000. */ | ||
10 | /************************************************************************/ | ||
11 | /* Remaps the io.h for the iSeries Io */ | ||
12 | /* Copyright (C) 20yy Allan H Trautman, IBM Corporation */ | ||
13 | /* */ | ||
14 | /* This program is free software; you can redistribute it and/or modify */ | ||
15 | /* it under the terms of the GNU General Public License as published by */ | ||
16 | /* the Free Software Foundation; either version 2 of the License, or */ | ||
17 | /* (at your option) any later version. */ | ||
18 | /* */ | ||
19 | /* This program is distributed in the hope that it will be useful, */ | ||
20 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | ||
21 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ | ||
22 | /* GNU General Public License for more details. */ | ||
23 | /* */ | ||
24 | /* You should have received a copy of the GNU General Public License */ | ||
25 | /* along with this program; if not, write to the: */ | ||
26 | /* Free Software Foundation, Inc., */ | ||
27 | /* 59 Temple Place, Suite 330, */ | ||
28 | /* Boston, MA 02111-1307 USA */ | ||
29 | /************************************************************************/ | ||
30 | /* Change Activity: */ | ||
31 | /* Created December 28, 2000 */ | ||
32 | /* End Change Activity */ | ||
33 | /************************************************************************/ | ||
34 | extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress); | ||
35 | extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress); | ||
36 | extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress); | ||
37 | extern void iSeries_Write_Byte(u8 IoData, volatile void __iomem * IoAddress); | ||
38 | extern void iSeries_Write_Word(u16 IoData, volatile void __iomem * IoAddress); | ||
39 | extern void iSeries_Write_Long(u32 IoData, volatile void __iomem * IoAddress); | ||
40 | |||
41 | extern void iSeries_memset_io(volatile void __iomem *dest, char x, size_t n); | ||
42 | extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, size_t n); | ||
43 | extern void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *source, size_t n); | ||
44 | |||
45 | #endif /* CONFIG_PPC_ISERIES */ | ||
46 | #endif /* _ISERIES_IO_H */ | ||
diff --git a/include/asm-ppc64/iSeries/iSeries_irq.h b/include/asm-ppc64/iSeries/iSeries_irq.h new file mode 100644 index 000000000000..ff8ddede038c --- /dev/null +++ b/include/asm-ppc64/iSeries/iSeries_irq.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef __ISERIES_IRQ_H__ | ||
2 | #define __ISERIES_IRQ_H__ | ||
3 | |||
4 | #ifdef __cplusplus | ||
5 | extern "C" { | ||
6 | #endif | ||
7 | |||
8 | void iSeries_init_IRQ(void); | ||
9 | int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId); | ||
10 | int iSeries_assign_IRQ(int, HvBusNumber, HvSubBusNumber, HvAgentId); | ||
11 | void iSeries_activate_IRQs(void); | ||
12 | |||
13 | int XmPciLpEvent_init(void); | ||
14 | |||
15 | #ifdef __cplusplus | ||
16 | } | ||
17 | #endif | ||
18 | |||
19 | #endif /* __ISERIES_IRQ_H__ */ | ||
diff --git a/include/asm-ppc64/iSeries/iSeries_pci.h b/include/asm-ppc64/iSeries/iSeries_pci.h new file mode 100644 index 000000000000..5769cff4c00c --- /dev/null +++ b/include/asm-ppc64/iSeries/iSeries_pci.h | |||
@@ -0,0 +1,112 @@ | |||
1 | #ifndef _ISERIES_64_PCI_H | ||
2 | #define _ISERIES_64_PCI_H | ||
3 | |||
4 | /************************************************************************/ | ||
5 | /* File iSeries_pci.h 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/iSeries/HvCallPci.h> | ||
34 | #include <asm/abs_addr.h> | ||
35 | |||
36 | struct pci_dev; /* For Forward Reference */ | ||
37 | struct iSeries_Device_Node; | ||
38 | |||
39 | /************************************************************************/ | ||
40 | /* Gets iSeries Bus, SubBus, DevFn using iSeries_Device_Node structure */ | ||
41 | /************************************************************************/ | ||
42 | |||
43 | #define ISERIES_BUS(DevPtr) DevPtr->DsaAddr.Dsa.busNumber | ||
44 | #define ISERIES_SUBBUS(DevPtr) DevPtr->DsaAddr.Dsa.subBusNumber | ||
45 | #define ISERIES_DEVICE(DevPtr) DevPtr->DsaAddr.Dsa.deviceId | ||
46 | #define ISERIES_DSA(DevPtr) DevPtr->DsaAddr.DsaAddr | ||
47 | #define ISERIES_DEVFUN(DevPtr) DevPtr->DevFn | ||
48 | #define ISERIES_DEVNODE(PciDev) ((struct iSeries_Device_Node*)PciDev->sysdata) | ||
49 | |||
50 | #define EADsMaxAgents 7 | ||
51 | |||
52 | /************************************************************************/ | ||
53 | /* Decodes Linux DevFn to iSeries DevFn, bridge device, or function. */ | ||
54 | /* For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h */ | ||
55 | /************************************************************************/ | ||
56 | |||
57 | #define ISERIES_PCI_AGENTID(idsel,func) ((idsel & 0x0F) << 4) | (func & 0x07) | ||
58 | #define ISERIES_ENCODE_DEVICE(agentid) ((0x10) | ((agentid&0x20)>>2) | (agentid&07)) | ||
59 | |||
60 | #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7) | ||
61 | #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7) | ||
62 | |||
63 | /* | ||
64 | * N.B. the ISERIES_DECODE_* macros are not used anywhere, and I think | ||
65 | * the 0x71 (at least) must be wrong - 0x78 maybe? -- paulus. | ||
66 | */ | ||
67 | #define ISERIES_DECODE_DEVFN(linuxdevfn) (((linuxdevfn & 0x71) << 1) | (linuxdevfn & 0x07)) | ||
68 | #define ISERIES_DECODE_DEVICE(linuxdevfn) (((linuxdevfn & 0x38) >> 3) |(((linuxdevfn & 0x40) >> 2) + 0x10)) | ||
69 | #define ISERIES_DECODE_FUNCTION(linuxdevfn) (linuxdevfn & 0x07) | ||
70 | |||
71 | /************************************************************************/ | ||
72 | /* Converts Virtual Address to Real Address for Hypervisor calls */ | ||
73 | /************************************************************************/ | ||
74 | |||
75 | #define ISERIES_HV_ADDR(virtaddr) (0x8000000000000000 | virt_to_abs(virtaddr)) | ||
76 | |||
77 | /************************************************************************/ | ||
78 | /* iSeries Device Information */ | ||
79 | /************************************************************************/ | ||
80 | |||
81 | struct iSeries_Device_Node { | ||
82 | struct list_head Device_List; | ||
83 | struct pci_dev* PciDev; /* Pointer to pci_dev structure*/ | ||
84 | union HvDsaMap DsaAddr; /* Direct Select Address */ | ||
85 | /* busNumber,subBusNumber, */ | ||
86 | /* deviceId, barNumber */ | ||
87 | HvAgentId AgentId; /* Hypervisor DevFn */ | ||
88 | int DevFn; /* Linux devfn */ | ||
89 | int BarOffset; | ||
90 | int Irq; /* Assigned IRQ */ | ||
91 | int ReturnCode; /* Return Code Holder */ | ||
92 | int IoRetry; /* Current Retry Count */ | ||
93 | int Flags; /* Possible flags(disable/bist)*/ | ||
94 | u16 Vendor; /* Vendor ID */ | ||
95 | u8 LogicalSlot; /* Hv Slot Index for Tces */ | ||
96 | struct iommu_table* iommu_table;/* Device TCE Table */ | ||
97 | u8 PhbId; /* Phb Card is on. */ | ||
98 | u16 Board; /* Board Number */ | ||
99 | u8 FrameId; /* iSeries spcn Frame Id */ | ||
100 | char CardLocation[4];/* Char format of planar vpd */ | ||
101 | char Location[20]; /* Frame 1, Card C10 */ | ||
102 | }; | ||
103 | |||
104 | /************************************************************************/ | ||
105 | /* Functions */ | ||
106 | /************************************************************************/ | ||
107 | |||
108 | extern int iSeries_Device_Information(struct pci_dev*,char*, int); | ||
109 | extern void iSeries_Get_Location_Code(struct iSeries_Device_Node*); | ||
110 | extern int iSeries_Device_ToggleReset(struct pci_dev* PciDev, int AssertTime, int DelayTime); | ||
111 | |||
112 | #endif /* _ISERIES_64_PCI_H */ | ||
diff --git a/include/asm-ppc64/iSeries/iSeries_proc.h b/include/asm-ppc64/iSeries/iSeries_proc.h new file mode 100644 index 000000000000..adb6dc14dd4d --- /dev/null +++ b/include/asm-ppc64/iSeries/iSeries_proc.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * iSeries_proc.h | ||
3 | * Copyright (C) 2001 Kyle A. Lucke IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ISERIES_PROC_H | ||
20 | #define _ISERIES_PROC_H | ||
21 | |||
22 | extern void iSeries_proc_early_init(void); | ||
23 | |||
24 | #endif /* _iSeries_PROC_H */ | ||
diff --git a/include/asm-ppc64/iSeries/mf.h b/include/asm-ppc64/iSeries/mf.h new file mode 100644 index 000000000000..2e59a8e15a0b --- /dev/null +++ b/include/asm-ppc64/iSeries/mf.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * mf.h | ||
3 | * Copyright (C) 2001 Troy D. Armstrong IBM Corporation | ||
4 | * Copyright (C) 2004 Stephen Rothwell IBM Corporation | ||
5 | * | ||
6 | * This modules exists as an interface between a Linux secondary partition | ||
7 | * running on an iSeries and the primary partition's Virtual Service | ||
8 | * Processor (VSP) object. The VSP has final authority over powering on/off | ||
9 | * all partitions in the iSeries. It also provides miscellaneous low-level | ||
10 | * machine facility type operations. | ||
11 | * | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License as published by | ||
15 | * the Free Software Foundation; either version 2 of the License, or | ||
16 | * (at your option) any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the Free Software | ||
25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
26 | */ | ||
27 | #ifndef _ASM_PPC64_ISERIES_MF_H | ||
28 | #define _ASM_PPC64_ISERIES_MF_H | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | |||
32 | #include <asm/iSeries/HvTypes.h> | ||
33 | #include <asm/iSeries/HvCallEvent.h> | ||
34 | |||
35 | struct rtc_time; | ||
36 | |||
37 | typedef void (*MFCompleteHandler)(void *clientToken, int returnCode); | ||
38 | |||
39 | extern void mf_allocate_lp_events(HvLpIndex targetLp, HvLpEvent_Type type, | ||
40 | unsigned size, unsigned amount, MFCompleteHandler hdlr, | ||
41 | void *userToken); | ||
42 | extern void mf_deallocate_lp_events(HvLpIndex targetLp, HvLpEvent_Type type, | ||
43 | unsigned count, MFCompleteHandler hdlr, void *userToken); | ||
44 | |||
45 | extern void mf_power_off(void); | ||
46 | extern void mf_reboot(void); | ||
47 | |||
48 | extern void mf_display_src(u32 word); | ||
49 | extern void mf_display_progress(u16 value); | ||
50 | extern void mf_clear_src(void); | ||
51 | |||
52 | extern void mf_init(void); | ||
53 | |||
54 | extern int mf_get_rtc(struct rtc_time *tm); | ||
55 | extern int mf_set_rtc(struct rtc_time *tm); | ||
56 | |||
57 | #endif /* _ASM_PPC64_ISERIES_MF_H */ | ||
diff --git a/include/asm-ppc64/iSeries/vio.h b/include/asm-ppc64/iSeries/vio.h new file mode 100644 index 000000000000..3e5766a849d6 --- /dev/null +++ b/include/asm-ppc64/iSeries/vio.h | |||
@@ -0,0 +1,129 @@ | |||
1 | /* -*- linux-c -*- | ||
2 | * drivers/char/vio.h | ||
3 | * | ||
4 | * iSeries Virtual I/O Message Path header | ||
5 | * | ||
6 | * Authors: Dave Boutcher <boutcher@us.ibm.com> | ||
7 | * Ryan Arnold <ryanarn@us.ibm.com> | ||
8 | * Colin Devilbiss <devilbis@us.ibm.com> | ||
9 | * | ||
10 | * (C) Copyright 2000 IBM Corporation | ||
11 | * | ||
12 | * This header file is used by the iSeries virtual I/O device | ||
13 | * drivers. It defines the interfaces to the common functions | ||
14 | * (implemented in drivers/char/viopath.h) as well as defining | ||
15 | * common functions and structures. Currently (at the time I | ||
16 | * wrote this comment) the iSeries virtual I/O device drivers | ||
17 | * that use this are | ||
18 | * drivers/block/viodasd.c | ||
19 | * drivers/char/viocons.c | ||
20 | * drivers/char/viotape.c | ||
21 | * drivers/cdrom/viocd.c | ||
22 | * | ||
23 | * The iSeries virtual ethernet support (veth.c) uses a whole | ||
24 | * different set of functions. | ||
25 | * | ||
26 | * This program is free software; you can redistribute it and/or | ||
27 | * modify it under the terms of the GNU General Public License as | ||
28 | * published by the Free Software Foundation; either version 2 of the | ||
29 | * License, or (at your option) anyu later version. | ||
30 | * | ||
31 | * This program is distributed in the hope that it will be useful, but | ||
32 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
34 | * General Public License for more details. | ||
35 | * | ||
36 | * You should have received a copy of the GNU General Public License | ||
37 | * along with this program; if not, write to the Free Software Foundation, | ||
38 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
39 | * | ||
40 | */ | ||
41 | #ifndef _ISERIES_VIO_H | ||
42 | #define _ISERIES_VIO_H | ||
43 | |||
44 | #include <asm/iSeries/HvTypes.h> | ||
45 | #include <asm/iSeries/HvLpEvent.h> | ||
46 | |||
47 | /* iSeries virtual I/O events use the subtype field in | ||
48 | * HvLpEvent to figure out what kind of vio event is coming | ||
49 | * in. We use a table to route these, and this defines | ||
50 | * the maximum number of distinct subtypes | ||
51 | */ | ||
52 | #define VIO_MAX_SUBTYPES 8 | ||
53 | |||
54 | /* Each subtype can register a handler to process their events. | ||
55 | * The handler must have this interface. | ||
56 | */ | ||
57 | typedef void (vio_event_handler_t) (struct HvLpEvent * event); | ||
58 | |||
59 | int viopath_open(HvLpIndex remoteLp, int subtype, int numReq); | ||
60 | int viopath_close(HvLpIndex remoteLp, int subtype, int numReq); | ||
61 | int vio_setHandler(int subtype, vio_event_handler_t * beh); | ||
62 | int vio_clearHandler(int subtype); | ||
63 | int viopath_isactive(HvLpIndex lp); | ||
64 | HvLpInstanceId viopath_sourceinst(HvLpIndex lp); | ||
65 | HvLpInstanceId viopath_targetinst(HvLpIndex lp); | ||
66 | void vio_set_hostlp(void); | ||
67 | void *vio_get_event_buffer(int subtype); | ||
68 | void vio_free_event_buffer(int subtype, void *buffer); | ||
69 | |||
70 | extern HvLpIndex viopath_hostLp; | ||
71 | extern HvLpIndex viopath_ourLp; | ||
72 | |||
73 | #define VIOCHAR_MAX_DATA 200 | ||
74 | |||
75 | #define VIOMAJOR_SUBTYPE_MASK 0xff00 | ||
76 | #define VIOMINOR_SUBTYPE_MASK 0x00ff | ||
77 | #define VIOMAJOR_SUBTYPE_SHIFT 8 | ||
78 | |||
79 | #define VIOVERSION 0x0101 | ||
80 | |||
81 | /* | ||
82 | * This is the general structure for VIO errors; each module should have | ||
83 | * a table of them, and each table should be terminated by an entry of | ||
84 | * { 0, 0, NULL }. Then, to find a specific error message, a module | ||
85 | * should pass its local table and the return code. | ||
86 | */ | ||
87 | struct vio_error_entry { | ||
88 | u16 rc; | ||
89 | int errno; | ||
90 | const char *msg; | ||
91 | }; | ||
92 | const struct vio_error_entry *vio_lookup_rc(const struct vio_error_entry | ||
93 | *local_table, u16 rc); | ||
94 | |||
95 | enum viosubtypes { | ||
96 | viomajorsubtype_monitor = 0x0100, | ||
97 | viomajorsubtype_blockio = 0x0200, | ||
98 | viomajorsubtype_chario = 0x0300, | ||
99 | viomajorsubtype_config = 0x0400, | ||
100 | viomajorsubtype_cdio = 0x0500, | ||
101 | viomajorsubtype_tape = 0x0600, | ||
102 | viomajorsubtype_scsi = 0x0700 | ||
103 | }; | ||
104 | |||
105 | |||
106 | enum vioconfigsubtype { | ||
107 | vioconfigget = 0x0001, | ||
108 | }; | ||
109 | |||
110 | enum viorc { | ||
111 | viorc_good = 0x0000, | ||
112 | viorc_noConnection = 0x0001, | ||
113 | viorc_noReceiver = 0x0002, | ||
114 | viorc_noBufferAvailable = 0x0003, | ||
115 | viorc_invalidMessageType = 0x0004, | ||
116 | viorc_invalidRange = 0x0201, | ||
117 | viorc_invalidToken = 0x0202, | ||
118 | viorc_DMAError = 0x0203, | ||
119 | viorc_useError = 0x0204, | ||
120 | viorc_releaseError = 0x0205, | ||
121 | viorc_invalidDisk = 0x0206, | ||
122 | viorc_openRejected = 0x0301 | ||
123 | }; | ||
124 | |||
125 | struct device; | ||
126 | |||
127 | extern struct device *iSeries_vio_dev; | ||
128 | |||
129 | #endif /* _ISERIES_VIO_H */ | ||