]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc: Add set_mode hcall
authorIan Munsie <imunsie@au1.ibm.com>
Tue, 6 Nov 2012 05:15:17 +0000 (16:15 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 15 Nov 2012 04:08:06 +0000 (15:08 +1100)
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>
arch/powerpc/include/asm/firmware.h
arch/powerpc/include/asm/hvcall.h
arch/powerpc/platforms/pseries/firmware.c
arch/powerpc/platforms/pseries/plpar_wrappers.h

index ad0b751b0d78e418e799b7cb959091d4a6f35df7..973cc3be011b95950b7402a841337c02497cb06f 100644 (file)
@@ -49,6 +49,7 @@
 #define FW_FEATURE_XCMO                ASM_CONST(0x0000000008000000)
 #define FW_FEATURE_OPAL                ASM_CONST(0x0000000010000000)
 #define FW_FEATURE_OPALv2      ASM_CONST(0x0000000020000000)
+#define FW_FEATURE_SET_MODE    ASM_CONST(0x0000000040000000)
 
 #ifndef __ASSEMBLY__
 
@@ -62,7 +63,8 @@ enum {
                FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
                FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR |
                FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
-               FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO,
+               FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO |
+               FW_FEATURE_SET_MODE,
        FW_FEATURE_PSERIES_ALWAYS = 0,
        FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2,
        FW_FEATURE_POWERNV_ALWAYS = 0,
index 7a867065db79a8286578180abc2e8a4d36272885..a3d26d8f63cd1fb6613031f7541887af5f7d1767 100644 (file)
 #define H_RANDOM               0x300
 #define H_COP                  0x304
 #define H_GET_MPP_X            0x314
-#define MAX_HCALL_OPCODE       H_GET_MPP_X
+#define H_SET_MODE             0x31C
+#define MAX_HCALL_OPCODE       H_SET_MODE
 
 #ifndef __ASSEMBLY__
 
index 0b0eff0cce35e94b2888b05a5116581052dca2af..7b56118f531c5e09a5d9f602d1c4e409181a4d51 100644 (file)
@@ -56,6 +56,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
        {FW_FEATURE_MULTITCE,           "hcall-multi-tce"},
        {FW_FEATURE_SPLPAR,             "hcall-splpar"},
        {FW_FEATURE_VPHN,               "hcall-vphn"},
+       {FW_FEATURE_SET_MODE,           "hcall-set-mode"},
 };
 
 /* Build up the firmware features bitmask using the contents of
index 13e8cc43adf7589d778b0ba05df274450728658c..44ad214034525036a39ec00a7e0bda58edb82a39 100644 (file)
@@ -273,4 +273,10 @@ static inline long plpar_put_term_char(unsigned long termno, unsigned long len,
                        lbuf[1]);
 }
 
+/* Set various resource mode parameters */
+static inline long plpar_set_mode(unsigned long mflags, unsigned long resource,
+               unsigned long value1, unsigned long value2)
+{
+       return plpar_hcall_norets(H_SET_MODE, mflags, resource, value1, value2);
+}
 #endif /* _PSERIES_PLPAR_WRAPPERS_H */