summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/papr-watchdog.h
blob: bf876fc2caae55a5624a17564f5bcf88bc4a2d67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef _ASM_POWERPC_PAPR_WATCHDOG_H
#define _ASM_POWERPC_PAPR_WATCHDOG_H

/*
 * H_WATCHDOG Input
 *
 * R4: "flags":
 *
 *         Bits 48-55: "operation"
 */
#define PSERIES_WDTF_OP_START	0x100UL		/* start timer */
#define PSERIES_WDTF_OP_STOP	0x200UL		/* stop timer */
#define PSERIES_WDTF_OP_QUERY	0x300UL		/* query timer capabilities */

/*
 *         Bits 56-63: "timeoutAction" (for "Start Watchdog" only)
 */
#define PSERIES_WDTF_ACTION_HARD_POWEROFF	0x1UL	/* poweroff */
#define PSERIES_WDTF_ACTION_HARD_RESTART	0x2UL	/* restart */
#define PSERIES_WDTF_ACTION_DUMP_RESTART	0x3UL	/* dump + restart */

/*
 * R5: "watchdogNumber":
 *       PAPR says use -1 (all ones) to stop all watchdogs.
 */
#define PSERIES_WDT_NUM_ALL	((unsigned long)-1)

/*
 * H_WATCHDOG Output
 *
 * R3: Return code
 *
 *     H_SUCCESS    The operation completed.
 *
 *     H_BUSY	    The hypervisor is too busy; retry the operation.
 *
 *     H_PARAMETER  The given "flags" are somehow invalid.  Either the
 *                  "operation" or "timeoutAction" is invalid, or a
 *                  reserved bit is set.
 *
 *     H_P2         The given "watchdogNumber" is zero or exceeds the
 *                  supported maximum value.
 *
 *     H_P3         The given "timeoutInMs" is below the supported
 *                  minimum value.
 *
 *     H_NOOP       The given "watchdogNumber" is already stopped.
 *
 *     H_HARDWARE   The operation failed for ineffable reasons.
 *
 *     H_FUNCTION   The H_WATCHDOG hypercall is not supported by this
 *                  hypervisor.
 *
 * R4:
 *
 * - For the "Query Watchdog Capabilities" operation, a 64-bit
 *   structure:
 */
#define PSERIES_WDTQ_MIN_TIMEOUT(cap)	(((cap) >> 48) & 0xffff)
#define PSERIES_WDTQ_MAX_NUMBER(cap)	(((cap) >> 32) & 0xffff)

#endif /* _ASM_POWERPC_PAPR_WATCHDOG_H */