powerpc/pseries: add FW_FEATURE_WATCHDOG flag
authorScott Cheloha <cheloha@linux.ibm.com>
Wed, 13 Jul 2022 20:23:33 +0000 (15:23 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 20 Jul 2022 11:57:39 +0000 (21:57 +1000)
PAPR v2.12 specifies a new optional function set, "hcall-watchdog",
for the /rtas/ibm,hypertas-functions property.  The presence of this
function set indicates support for the H_WATCHDOG hypercall.

Check for this function set and, if present, set the new
FW_FEATURE_WATCHDOG flag.

Signed-off-by: Scott Cheloha <cheloha@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220713202335.1217647-3-cheloha@linux.ibm.com
arch/powerpc/include/asm/firmware.h
arch/powerpc/platforms/pseries/firmware.c

index 8dddd34b8ecf108806ac2f375973528f75141827..398e0b5e485f66a8da5908ffae4841ff567e8b58 100644 (file)
@@ -55,6 +55,7 @@
 #define FW_FEATURE_RPT_INVALIDATE ASM_CONST(0x0000010000000000)
 #define FW_FEATURE_FORM2_AFFINITY ASM_CONST(0x0000020000000000)
 #define FW_FEATURE_ENERGY_SCALE_INFO ASM_CONST(0x0000040000000000)
+#define FW_FEATURE_WATCHDOG    ASM_CONST(0x0000080000000000)
 
 #ifndef __ASSEMBLY__
 
@@ -76,7 +77,7 @@ enum {
                FW_FEATURE_DRC_INFO | FW_FEATURE_BLOCK_REMOVE |
                FW_FEATURE_PAPR_SCM | FW_FEATURE_ULTRAVISOR |
                FW_FEATURE_RPT_INVALIDATE | FW_FEATURE_FORM2_AFFINITY |
-               FW_FEATURE_ENERGY_SCALE_INFO,
+               FW_FEATURE_ENERGY_SCALE_INFO | FW_FEATURE_WATCHDOG,
        FW_FEATURE_PSERIES_ALWAYS = 0,
        FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_ULTRAVISOR,
        FW_FEATURE_POWERNV_ALWAYS = 0,
index 09c119b2f623ead9481115b4c7ebcdaa22702afb..080108d129ed56050bf5f954dd2d05b0b8693a69 100644 (file)
@@ -67,6 +67,7 @@ hypertas_fw_features_table[] = {
        {FW_FEATURE_PAPR_SCM,           "hcall-scm"},
        {FW_FEATURE_RPT_INVALIDATE,     "hcall-rpt-invalidate"},
        {FW_FEATURE_ENERGY_SCALE_INFO,  "hcall-energy-scale-info"},
+       {FW_FEATURE_WATCHDOG,           "hcall-watchdog"},
 };
 
 /* Build up the firmware features bitmask using the contents of