History

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.

Lukasz Majczak committed 2 years ago

Commit 4d2ff651 parent 66134761 file · +35 −43Browse files

Showing the changes to include/linux/platform_data (1 of 1 file). Show all

Unified · Split

include/linux/platform_data/cros_ec_commands.h+35−43
@@ -3961,60 +3961,52 @@ struct ec_response_i2c_passthru { · 3960 unmodified lines
39613961 } __ec_align1;
39623962
39633963 /*****************************************************************************/
3964−/* Power button hang detect */
3965−
3964+/* AP hang detect */
39663965 #define EC_CMD_HANG_DETECT 0x009F
39673966
3968−/* Reasons to start hang detection timer */
3969−/* Power button pressed */
3970−#define EC_HANG_START_ON_POWER_PRESS BIT(0)
3971−
3972−/* Lid closed */
3973−#define EC_HANG_START_ON_LID_CLOSE BIT(1)
3974−
3975− /* Lid opened */
3976−#define EC_HANG_START_ON_LID_OPEN BIT(2)
3977−
3978−/* Start of AP S3->S0 transition (booting or resuming from suspend) */
3979−#define EC_HANG_START_ON_RESUME BIT(3)
3980−
3981−/* Reasons to cancel hang detection */
3967+#define EC_HANG_DETECT_MIN_TIMEOUT 5
3968+#define EC_HANG_DETECT_MAX_TIMEOUT 65535
39823969
3983−/* Power button released */
3984−#define EC_HANG_STOP_ON_POWER_RELEASE BIT(8)
3970+/* EC hang detect commands */
3971+enum ec_hang_detect_cmds {
3972+ /* Reload AP hang detect timer. */
3973+ EC_HANG_DETECT_CMD_RELOAD = 0x0,
39853974
3986−/* Any host command from AP received */
3987−#define EC_HANG_STOP_ON_HOST_COMMAND BIT(9)
3975+ /* Stop AP hang detect timer. */
3976+ EC_HANG_DETECT_CMD_CANCEL = 0x1,
39883977
3989−/* Stop on end of AP S0->S3 transition (suspending or shutting down) */
3990−#define EC_HANG_STOP_ON_SUSPEND BIT(10)
3978+ /* Configure watchdog with given reboot timeout and
3979+ * cancel currently running AP hang detect timer.
3980+ */
3981+ EC_HANG_DETECT_CMD_SET_TIMEOUT = 0x2,
39913982
3992−/*
3993− * If this flag is set, all the other fields are ignored, and the hang detect
3994− * timer is started. This provides the AP a way to start the hang timer
3995− * without reconfiguring any of the other hang detect settings. Note that
3996− * you must previously have configured the timeouts.
3997− */
3998−#define EC_HANG_START_NOW BIT(30)
3983+ /* Get last hang status - whether the AP boot was clear or not */
3984+ EC_HANG_DETECT_CMD_GET_STATUS = 0x3,
39993985
4000−/*
4001− * If this flag is set, all the other fields are ignored (including
4002− * EC_HANG_START_NOW). This provides the AP a way to stop the hang timer
4003− * without reconfiguring any of the other hang detect settings.
4004− */
4005−#define EC_HANG_STOP_NOW BIT(31)
3986+ /* Clear last hang status. Called when AP is rebooting/shutting down
3987+ * gracefully.
3988+ */
3989+ EC_HANG_DETECT_CMD_CLEAR_STATUS = 0x4
3990+};
40063991
40073992 struct ec_params_hang_detect {
4008− /* Flags; see EC_HANG_* */
4009− uint32_t flags;
4010−
4011− /* Timeout in msec before generating host event, if enabled */
4012− uint16_t host_event_timeout_msec;
3993+ uint16_t command; /* enum ec_hang_detect_cmds */
3994+ /* Timeout in seconds before generating reboot */
3995+ uint16_t reboot_timeout_sec;
3996+} __ec_align2;
40133997
4014− /* Timeout in msec before generating warm reboot, if enabled */
4015− uint16_t warm_reboot_timeout_msec;
4016−} __ec_align4;
3998+/* Status codes that describe whether AP has boot normally or the hang has been
3999+ * detected and EC has reset AP
4000+ */
4001+enum ec_hang_detect_status {
4002+ EC_HANG_DETECT_AP_BOOT_NORMAL = 0x0,
4003+ EC_HANG_DETECT_AP_BOOT_EC_WDT = 0x1,
4004+ EC_HANG_DETECT_AP_BOOT_COUNT,
4005+};
40174006
4007+struct ec_response_hang_detect {
4008+ uint8_t status; /* enum ec_hang_detect_status */
4009+} __ec_align1;
40184010 /*****************************************************************************/
40194011 /* Commands for battery charging */
40204012

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t