diff options
| author | Heiko J Schick <schihei@de.ibm.com> | 2006-03-30 15:47:14 -0500 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2006-04-01 06:37:00 -0500 |
| commit | b13a96cfb055fd4b9c61463f87534a6f406b174b (patch) | |
| tree | 4ab32133b1a786ef9bd9448ffadff0f2fc9c36bf | |
| parent | 706c8c93ba4865a19e981b9770151a7a63c15794 (diff) | |
[PATCH] powerpc: Extends HCALL interface for InfiniBand usage
This extends the HCALL interface for InfiniBand usage. I've
made the patch against the linux-2.6 git tree and Segher's patch:
[PATCH] Change H_StudlyCaps to H_SHOUTING_CAPS
We moved this into the common powerpc code based on comments we
got after posting the first eHCA InfiniBand device driver patch.
Signed-off-by: Heiko j Schick <schickhj@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
| -rw-r--r-- | arch/powerpc/platforms/pseries/hvCall.S | 100 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 3 | ||||
| -rw-r--r-- | include/asm-powerpc/hvcall.h | 100 |
3 files changed, 202 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S index db7c19fe9297..c9ff547f9d25 100644 --- a/arch/powerpc/platforms/pseries/hvCall.S +++ b/arch/powerpc/platforms/pseries/hvCall.S | |||
| @@ -127,3 +127,103 @@ _GLOBAL(plpar_hcall_4out) | |||
| 127 | 127 | ||
| 128 | mtcrf 0xff,r0 | 128 | mtcrf 0xff,r0 |
| 129 | blr /* return r3 = status */ | 129 | blr /* return r3 = status */ |
| 130 | |||
| 131 | /* plpar_hcall_7arg_7ret(unsigned long opcode, R3 | ||
| 132 | unsigned long arg1, R4 | ||
| 133 | unsigned long arg2, R5 | ||
| 134 | unsigned long arg3, R6 | ||
| 135 | unsigned long arg4, R7 | ||
| 136 | unsigned long arg5, R8 | ||
| 137 | unsigned long arg6, R9 | ||
| 138 | unsigned long arg7, R10 | ||
| 139 | unsigned long *out1, 112(R1) | ||
| 140 | unsigned long *out2, 110(R1) | ||
| 141 | unsigned long *out3, 108(R1) | ||
| 142 | unsigned long *out4, 106(R1) | ||
| 143 | unsigned long *out5, 104(R1) | ||
| 144 | unsigned long *out6, 102(R1) | ||
| 145 | unsigned long *out7); 100(R1) | ||
| 146 | */ | ||
| 147 | _GLOBAL(plpar_hcall_7arg_7ret) | ||
| 148 | HMT_MEDIUM | ||
| 149 | |||
| 150 | mfcr r0 | ||
| 151 | stw r0,8(r1) | ||
| 152 | |||
| 153 | HVSC /* invoke the hypervisor */ | ||
| 154 | |||
| 155 | lwz r0,8(r1) | ||
| 156 | |||
| 157 | ld r11,STK_PARM(r11)(r1) /* Fetch r4 ret arg */ | ||
| 158 | std r4,0(r11) | ||
| 159 | ld r11,STK_PARM(r12)(r1) /* Fetch r5 ret arg */ | ||
| 160 | std r5,0(r11) | ||
| 161 | ld r11,STK_PARM(r13)(r1) /* Fetch r6 ret arg */ | ||
| 162 | std r6,0(r11) | ||
| 163 | ld r11,STK_PARM(r14)(r1) /* Fetch r7 ret arg */ | ||
| 164 | std r7,0(r11) | ||
| 165 | ld r11,STK_PARM(r15)(r1) /* Fetch r8 ret arg */ | ||
| 166 | std r8,0(r11) | ||
| 167 | ld r11,STK_PARM(r16)(r1) /* Fetch r9 ret arg */ | ||
| 168 | std r9,0(r11) | ||
| 169 | ld r11,STK_PARM(r17)(r1) /* Fetch r10 ret arg */ | ||
| 170 | std r10,0(r11) | ||
| 171 | |||
| 172 | mtcrf 0xff,r0 | ||
| 173 | |||
| 174 | blr /* return r3 = status */ | ||
| 175 | |||
| 176 | /* plpar_hcall_9arg_9ret(unsigned long opcode, R3 | ||
| 177 | unsigned long arg1, R4 | ||
| 178 | unsigned long arg2, R5 | ||
| 179 | unsigned long arg3, R6 | ||
| 180 | unsigned long arg4, R7 | ||
| 181 | unsigned long arg5, R8 | ||
| 182 | unsigned long arg6, R9 | ||
| 183 | unsigned long arg7, R10 | ||
| 184 | unsigned long arg8, 112(R1) | ||
| 185 | unsigned long arg9, 110(R1) | ||
| 186 | unsigned long *out1, 108(R1) | ||
| 187 | unsigned long *out2, 106(R1) | ||
| 188 | unsigned long *out3, 104(R1) | ||
| 189 | unsigned long *out4, 102(R1) | ||
| 190 | unsigned long *out5, 100(R1) | ||
| 191 | unsigned long *out6, 98(R1) | ||
| 192 | unsigned long *out7); 96(R1) | ||
| 193 | unsigned long *out8, 94(R1) | ||
| 194 | unsigned long *out9, 92(R1) | ||
| 195 | */ | ||
| 196 | _GLOBAL(plpar_hcall_9arg_9ret) | ||
| 197 | HMT_MEDIUM | ||
| 198 | |||
| 199 | mfcr r0 | ||
| 200 | stw r0,8(r1) | ||
| 201 | |||
| 202 | ld r11,STK_PARM(r11)(r1) /* put arg8 in R11 */ | ||
| 203 | ld r12,STK_PARM(r12)(r1) /* put arg9 in R12 */ | ||
| 204 | |||
| 205 | HVSC /* invoke the hypervisor */ | ||
| 206 | |||
| 207 | ld r0,STK_PARM(r13)(r1) /* Fetch r4 ret arg */ | ||
| 208 | stdx r4,r0,r0 | ||
| 209 | ld r0,STK_PARM(r14)(r1) /* Fetch r5 ret arg */ | ||
| 210 | stdx r5,r0,r0 | ||
| 211 | ld r0,STK_PARM(r15)(r1) /* Fetch r6 ret arg */ | ||
| 212 | stdx r6,r0,r0 | ||
| 213 | ld r0,STK_PARM(r16)(r1) /* Fetch r7 ret arg */ | ||
| 214 | stdx r7,r0,r0 | ||
| 215 | ld r0,STK_PARM(r17)(r1) /* Fetch r8 ret arg */ | ||
| 216 | stdx r8,r0,r0 | ||
| 217 | ld r0,STK_PARM(r18)(r1) /* Fetch r9 ret arg */ | ||
| 218 | stdx r9,r0,r0 | ||
| 219 | ld r0,STK_PARM(r19)(r1) /* Fetch r10 ret arg */ | ||
| 220 | stdx r10,r0,r0 | ||
| 221 | ld r0,STK_PARM(r20)(r1) /* Fetch r11 ret arg */ | ||
| 222 | stdx r11,r0,r0 | ||
| 223 | ld r0,STK_PARM(r21)(r1) /* Fetch r12 ret arg */ | ||
| 224 | stdx r12,r0,r0 | ||
| 225 | |||
| 226 | lwz r0,8(r1) | ||
| 227 | mtcrf 0xff,r0 | ||
| 228 | |||
| 229 | blr /* return r3 = status */ | ||
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index c72c0918b44b..634b7d06d3cc 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
| @@ -54,7 +54,8 @@ EXPORT_SYMBOL(plpar_hcall); | |||
| 54 | EXPORT_SYMBOL(plpar_hcall_4out); | 54 | EXPORT_SYMBOL(plpar_hcall_4out); |
| 55 | EXPORT_SYMBOL(plpar_hcall_norets); | 55 | EXPORT_SYMBOL(plpar_hcall_norets); |
| 56 | EXPORT_SYMBOL(plpar_hcall_8arg_2ret); | 56 | EXPORT_SYMBOL(plpar_hcall_8arg_2ret); |
| 57 | 57 | EXPORT_SYMBOL(plpar_hcall_7arg_7ret); | |
| 58 | EXPORT_SYMBOL(plpar_hcall_9arg_9ret); | ||
| 58 | extern void pSeries_find_serial_port(void); | 59 | extern void pSeries_find_serial_port(void); |
| 59 | 60 | ||
| 60 | 61 | ||
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index 029afaef1e66..6cc7e1fb7bfd 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h | |||
| @@ -7,8 +7,12 @@ | |||
| 7 | #define H_SUCCESS 0 | 7 | #define H_SUCCESS 0 |
| 8 | #define H_BUSY 1 /* Hardware busy -- retry later */ | 8 | #define H_BUSY 1 /* Hardware busy -- retry later */ |
| 9 | #define H_CLOSED 2 /* Resource closed */ | 9 | #define H_CLOSED 2 /* Resource closed */ |
| 10 | #define H_NOT_AVAILABLE 3 | ||
| 10 | #define H_CONSTRAINED 4 /* Resource request constrained to max allowed */ | 11 | #define H_CONSTRAINED 4 /* Resource request constrained to max allowed */ |
| 12 | #define H_PARTIAL 5 | ||
| 11 | #define H_IN_PROGRESS 14 /* Kind of like busy */ | 13 | #define H_IN_PROGRESS 14 /* Kind of like busy */ |
| 14 | #define H_PAGE_REGISTERED 15 | ||
| 15 | #define H_PARTIAL_STORE 16 | ||
| 12 | #define H_PENDING 17 /* returned from H_POLL_PENDING */ | 16 | #define H_PENDING 17 /* returned from H_POLL_PENDING */ |
| 13 | #define H_CONTINUE 18 /* Returned from H_Join on success */ | 17 | #define H_CONTINUE 18 /* Returned from H_Join on success */ |
| 14 | #define H_LONG_BUSY_START_RANGE 9900 /* Start of long busy range */ | 18 | #define H_LONG_BUSY_START_RANGE 9900 /* Start of long busy range */ |
| @@ -41,6 +45,36 @@ | |||
| 41 | #define H_DEST_PARM -14 | 45 | #define H_DEST_PARM -14 |
| 42 | #define H_REMOTE_PARM -15 | 46 | #define H_REMOTE_PARM -15 |
| 43 | #define H_RESOURCE -16 | 47 | #define H_RESOURCE -16 |
| 48 | #define H_ADAPTER_PARM -17 | ||
| 49 | #define H_RH_PARM -18 | ||
| 50 | #define H_RCQ_PARM -19 | ||
| 51 | #define H_SCQ_PARM -20 | ||
| 52 | #define H_EQ_PARM -21 | ||
| 53 | #define H_RT_PARM -22 | ||
| 54 | #define H_ST_PARM -23 | ||
| 55 | #define H_SIGT_PARM -24 | ||
| 56 | #define H_TOKEN_PARM -25 | ||
| 57 | #define H_MLENGTH_PARM -27 | ||
| 58 | #define H_MEM_PARM -28 | ||
| 59 | #define H_MEM_ACCESS_PARM -29 | ||
| 60 | #define H_ATTR_PARM -30 | ||
| 61 | #define H_PORT_PARM -31 | ||
| 62 | #define H_MCG_PARM -32 | ||
| 63 | #define H_VL_PARM -33 | ||
| 64 | #define H_TSIZE_PARM -34 | ||
| 65 | #define H_TRACE_PARM -35 | ||
| 66 | |||
| 67 | #define H_MASK_PARM -37 | ||
| 68 | #define H_MCG_FULL -38 | ||
| 69 | #define H_ALIAS_EXIST -39 | ||
| 70 | #define H_P_COUNTER -40 | ||
| 71 | #define H_TABLE_FULL -41 | ||
| 72 | #define H_ALT_TABLE -42 | ||
| 73 | #define H_MR_CONDITION -43 | ||
| 74 | #define H_NOT_ENOUGH_RESOURCES -44 | ||
| 75 | #define H_R_STATE -45 | ||
| 76 | #define H_RESCINDEND -46 | ||
| 77 | |||
| 44 | 78 | ||
| 45 | /* Long Busy is a condition that can be returned by the firmware | 79 | /* Long Busy is a condition that can be returned by the firmware |
| 46 | * when a call cannot be completed now, but the identical call | 80 | * when a call cannot be completed now, but the identical call |
| @@ -73,6 +107,9 @@ | |||
| 73 | #define H_DABRX_KERNEL (1UL<<(63-62)) | 107 | #define H_DABRX_KERNEL (1UL<<(63-62)) |
| 74 | #define H_DABRX_USER (1UL<<(63-63)) | 108 | #define H_DABRX_USER (1UL<<(63-63)) |
| 75 | 109 | ||
| 110 | /* Each control block has to be on a 4K bondary */ | ||
| 111 | #define H_CB_ALIGNMENT 4096 | ||
| 112 | |||
| 76 | /* pSeries hypervisor opcodes */ | 113 | /* pSeries hypervisor opcodes */ |
| 77 | #define H_REMOVE 0x04 | 114 | #define H_REMOVE 0x04 |
| 78 | #define H_ENTER 0x08 | 115 | #define H_ENTER 0x08 |
| @@ -124,6 +161,33 @@ | |||
| 124 | #define H_VTERM_PARTNER_INFO 0x150 | 161 | #define H_VTERM_PARTNER_INFO 0x150 |
| 125 | #define H_REGISTER_VTERM 0x154 | 162 | #define H_REGISTER_VTERM 0x154 |
| 126 | #define H_FREE_VTERM 0x158 | 163 | #define H_FREE_VTERM 0x158 |
| 164 | #define H_RESET_EVENTS 0x15C | ||
| 165 | #define H_ALLOC_RESOURCE 0x160 | ||
| 166 | #define H_FREE_RESOURCE 0x164 | ||
| 167 | #define H_MODIFY_QP 0x168 | ||
| 168 | #define H_QUERY_QP 0x16C | ||
| 169 | #define H_REREGISTER_PMR 0x170 | ||
| 170 | #define H_REGISTER_SMR 0x174 | ||
| 171 | #define H_QUERY_MR 0x178 | ||
| 172 | #define H_QUERY_MW 0x17C | ||
| 173 | #define H_QUERY_HCA 0x180 | ||
| 174 | #define H_QUERY_PORT 0x184 | ||
| 175 | #define H_MODIFY_PORT 0x188 | ||
| 176 | #define H_DEFINE_AQP1 0x18C | ||
| 177 | #define H_GET_TRACE_BUFFER 0x190 | ||
| 178 | #define H_DEFINE_AQP0 0x194 | ||
| 179 | #define H_RESIZE_MR 0x198 | ||
| 180 | #define H_ATTACH_MCQP 0x19C | ||
| 181 | #define H_DETACH_MCQP 0x1A0 | ||
| 182 | #define H_CREATE_RPT 0x1A4 | ||
| 183 | #define H_REMOVE_RPT 0x1A8 | ||
| 184 | #define H_REGISTER_RPAGES 0x1AC | ||
| 185 | #define H_DISABLE_AND_GETC 0x1B0 | ||
| 186 | #define H_ERROR_DATA 0x1B4 | ||
| 187 | #define H_GET_HCA_INFO 0x1B8 | ||
| 188 | #define H_GET_PERF_COUNT 0x1BC | ||
| 189 | #define H_MANAGE_TRACE 0x1C0 | ||
| 190 | #define H_QUERY_INT_STATE 0x1E4 | ||
| 127 | #define H_POLL_PENDING 0x1D8 | 191 | #define H_POLL_PENDING 0x1D8 |
| 128 | #define H_JOIN 0x298 | 192 | #define H_JOIN 0x298 |
| 129 | #define H_ENABLE_CRQ 0x2B0 | 193 | #define H_ENABLE_CRQ 0x2B0 |
| @@ -183,6 +247,42 @@ long plpar_hcall_4out(unsigned long opcode, | |||
| 183 | unsigned long *out3, | 247 | unsigned long *out3, |
| 184 | unsigned long *out4); | 248 | unsigned long *out4); |
| 185 | 249 | ||
| 250 | long plpar_hcall_7arg_7ret(unsigned long opcode, | ||
| 251 | unsigned long arg1, | ||
| 252 | unsigned long arg2, | ||
| 253 | unsigned long arg3, | ||
| 254 | unsigned long arg4, | ||
| 255 | unsigned long arg5, | ||
| 256 | unsigned long arg6, | ||
| 257 | unsigned long arg7, | ||
| 258 | unsigned long *out1, | ||
| 259 | unsigned long *out2, | ||
| 260 | unsigned long *out3, | ||
| 261 | unsigned long *out4, | ||
| 262 | unsigned long *out5, | ||
| 263 | unsigned long *out6, | ||
| 264 | unsigned long *out7); | ||
| 265 | |||
| 266 | long plpar_hcall_9arg_9ret(unsigned long opcode, | ||
| 267 | unsigned long arg1, | ||
| 268 | unsigned long arg2, | ||
| 269 | unsigned long arg3, | ||
| 270 | unsigned long arg4, | ||
| 271 | unsigned long arg5, | ||
| 272 | unsigned long arg6, | ||
| 273 | unsigned long arg7, | ||
| 274 | unsigned long arg8, | ||
| 275 | unsigned long arg9, | ||
| 276 | unsigned long *out1, | ||
| 277 | unsigned long *out2, | ||
| 278 | unsigned long *out3, | ||
| 279 | unsigned long *out4, | ||
| 280 | unsigned long *out5, | ||
| 281 | unsigned long *out6, | ||
| 282 | unsigned long *out7, | ||
| 283 | unsigned long *out8, | ||
| 284 | unsigned long *out9); | ||
| 285 | |||
| 186 | #endif /* __ASSEMBLY__ */ | 286 | #endif /* __ASSEMBLY__ */ |
| 187 | #endif /* __KERNEL__ */ | 287 | #endif /* __KERNEL__ */ |
| 188 | #endif /* _ASM_POWERPC_HVCALL_H */ | 288 | #endif /* _ASM_POWERPC_HVCALL_H */ |
