Commit 4d2ff655 authored by Lukasz Majczak's avatar Lukasz Majczak Committed by Lee Jones

platform/chrome: Update binary interface for EC-based watchdog

Update structures and defines related to EC_CMD_HANG_DETECT
to allow usage of new EC-based watchdog.
Signed-off-by: default avatarLukasz Majczak <lma@chromium.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Acked-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240126095721.782782-2-lma@chromium.orgSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 6613476e
...@@ -3961,60 +3961,52 @@ struct ec_response_i2c_passthru { ...@@ -3961,60 +3961,52 @@ struct ec_response_i2c_passthru {
} __ec_align1; } __ec_align1;
/*****************************************************************************/ /*****************************************************************************/
/* Power button hang detect */ /* AP hang detect */
#define EC_CMD_HANG_DETECT 0x009F #define EC_CMD_HANG_DETECT 0x009F
/* Reasons to start hang detection timer */ #define EC_HANG_DETECT_MIN_TIMEOUT 5
/* Power button pressed */ #define EC_HANG_DETECT_MAX_TIMEOUT 65535
#define EC_HANG_START_ON_POWER_PRESS BIT(0)
/* Lid closed */
#define EC_HANG_START_ON_LID_CLOSE BIT(1)
/* Lid opened */
#define EC_HANG_START_ON_LID_OPEN BIT(2)
/* Start of AP S3->S0 transition (booting or resuming from suspend) */
#define EC_HANG_START_ON_RESUME BIT(3)
/* Reasons to cancel hang detection */
/* Power button released */ /* EC hang detect commands */
#define EC_HANG_STOP_ON_POWER_RELEASE BIT(8) enum ec_hang_detect_cmds {
/* Reload AP hang detect timer. */
EC_HANG_DETECT_CMD_RELOAD = 0x0,
/* Any host command from AP received */ /* Stop AP hang detect timer. */
#define EC_HANG_STOP_ON_HOST_COMMAND BIT(9) EC_HANG_DETECT_CMD_CANCEL = 0x1,
/* Stop on end of AP S0->S3 transition (suspending or shutting down) */ /* Configure watchdog with given reboot timeout and
#define EC_HANG_STOP_ON_SUSPEND BIT(10) * cancel currently running AP hang detect timer.
*/
EC_HANG_DETECT_CMD_SET_TIMEOUT = 0x2,
/* /* Get last hang status - whether the AP boot was clear or not */
* If this flag is set, all the other fields are ignored, and the hang detect EC_HANG_DETECT_CMD_GET_STATUS = 0x3,
* timer is started. This provides the AP a way to start the hang timer
* without reconfiguring any of the other hang detect settings. Note that
* you must previously have configured the timeouts.
*/
#define EC_HANG_START_NOW BIT(30)
/* /* Clear last hang status. Called when AP is rebooting/shutting down
* If this flag is set, all the other fields are ignored (including * gracefully.
* EC_HANG_START_NOW). This provides the AP a way to stop the hang timer */
* without reconfiguring any of the other hang detect settings. EC_HANG_DETECT_CMD_CLEAR_STATUS = 0x4
*/ };
#define EC_HANG_STOP_NOW BIT(31)
struct ec_params_hang_detect { struct ec_params_hang_detect {
/* Flags; see EC_HANG_* */ uint16_t command; /* enum ec_hang_detect_cmds */
uint32_t flags; /* Timeout in seconds before generating reboot */
uint16_t reboot_timeout_sec;
/* Timeout in msec before generating host event, if enabled */ } __ec_align2;
uint16_t host_event_timeout_msec;
/* Timeout in msec before generating warm reboot, if enabled */ /* Status codes that describe whether AP has boot normally or the hang has been
uint16_t warm_reboot_timeout_msec; * detected and EC has reset AP
} __ec_align4; */
enum ec_hang_detect_status {
EC_HANG_DETECT_AP_BOOT_NORMAL = 0x0,
EC_HANG_DETECT_AP_BOOT_EC_WDT = 0x1,
EC_HANG_DETECT_AP_BOOT_COUNT,
};
struct ec_response_hang_detect {
uint8_t status; /* enum ec_hang_detect_status */
} __ec_align1;
/*****************************************************************************/ /*****************************************************************************/
/* Commands for battery charging */ /* Commands for battery charging */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment