diff options
author | Ian Munsie <imunsie@au1.ibm.com> | 2012-11-06 00:15:17 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-14 23:08:06 -0500 |
commit | d8f48ecc0e81cbc52a8eac907e02916d98dbfb5a (patch) | |
tree | eb51a7a834fea2dd9e82c701cf686a6d7920b881 | |
parent | b0302722eec7c086a31de6e3d9789304ef21df7b (diff) |
powerpc: Add set_mode hcall
This new hcall in POWER8 is used to set various resource mode registers.
eg. it can set address translation mode on interrupt (note: partition wide
scope)
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/include/asm/firmware.h | 4 | ||||
-rw-r--r-- | arch/powerpc/include/asm/hvcall.h | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/firmware.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/plpar_wrappers.h | 6 |
4 files changed, 12 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h index ad0b751b0d78..973cc3be011b 100644 --- a/arch/powerpc/include/asm/firmware.h +++ b/arch/powerpc/include/asm/firmware.h | |||
@@ -49,6 +49,7 @@ | |||
49 | #define FW_FEATURE_XCMO ASM_CONST(0x0000000008000000) | 49 | #define FW_FEATURE_XCMO ASM_CONST(0x0000000008000000) |
50 | #define FW_FEATURE_OPAL ASM_CONST(0x0000000010000000) | 50 | #define FW_FEATURE_OPAL ASM_CONST(0x0000000010000000) |
51 | #define FW_FEATURE_OPALv2 ASM_CONST(0x0000000020000000) | 51 | #define FW_FEATURE_OPALv2 ASM_CONST(0x0000000020000000) |
52 | #define FW_FEATURE_SET_MODE ASM_CONST(0x0000000040000000) | ||
52 | 53 | ||
53 | #ifndef __ASSEMBLY__ | 54 | #ifndef __ASSEMBLY__ |
54 | 55 | ||
@@ -62,7 +63,8 @@ enum { | |||
62 | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | | 63 | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | |
63 | FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR | | 64 | FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR | |
64 | FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR | | 65 | FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR | |
65 | FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO, | 66 | FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO | |
67 | FW_FEATURE_SET_MODE, | ||
66 | FW_FEATURE_PSERIES_ALWAYS = 0, | 68 | FW_FEATURE_PSERIES_ALWAYS = 0, |
67 | FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2, | 69 | FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2, |
68 | FW_FEATURE_POWERNV_ALWAYS = 0, | 70 | FW_FEATURE_POWERNV_ALWAYS = 0, |
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index 7a867065db79..a3d26d8f63cd 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h | |||
@@ -267,7 +267,8 @@ | |||
267 | #define H_RANDOM 0x300 | 267 | #define H_RANDOM 0x300 |
268 | #define H_COP 0x304 | 268 | #define H_COP 0x304 |
269 | #define H_GET_MPP_X 0x314 | 269 | #define H_GET_MPP_X 0x314 |
270 | #define MAX_HCALL_OPCODE H_GET_MPP_X | 270 | #define H_SET_MODE 0x31C |
271 | #define MAX_HCALL_OPCODE H_SET_MODE | ||
271 | 272 | ||
272 | #ifndef __ASSEMBLY__ | 273 | #ifndef __ASSEMBLY__ |
273 | 274 | ||
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c index 0b0eff0cce35..7b56118f531c 100644 --- a/arch/powerpc/platforms/pseries/firmware.c +++ b/arch/powerpc/platforms/pseries/firmware.c | |||
@@ -56,6 +56,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = { | |||
56 | {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, | 56 | {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, |
57 | {FW_FEATURE_SPLPAR, "hcall-splpar"}, | 57 | {FW_FEATURE_SPLPAR, "hcall-splpar"}, |
58 | {FW_FEATURE_VPHN, "hcall-vphn"}, | 58 | {FW_FEATURE_VPHN, "hcall-vphn"}, |
59 | {FW_FEATURE_SET_MODE, "hcall-set-mode"}, | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | /* Build up the firmware features bitmask using the contents of | 62 | /* Build up the firmware features bitmask using the contents of |
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index 13e8cc43adf7..44ad21403452 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h | |||
@@ -273,4 +273,10 @@ static inline long plpar_put_term_char(unsigned long termno, unsigned long len, | |||
273 | lbuf[1]); | 273 | lbuf[1]); |
274 | } | 274 | } |
275 | 275 | ||
276 | /* Set various resource mode parameters */ | ||
277 | static inline long plpar_set_mode(unsigned long mflags, unsigned long resource, | ||
278 | unsigned long value1, unsigned long value2) | ||
279 | { | ||
280 | return plpar_hcall_norets(H_SET_MODE, mflags, resource, value1, value2); | ||
281 | } | ||
276 | #endif /* _PSERIES_PLPAR_WRAPPERS_H */ | 282 | #endif /* _PSERIES_PLPAR_WRAPPERS_H */ |