summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2019-06-19 18:29:36 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-20 19:24:19 +0000
commit6dfc7de037e8e18baa54bfda7d8d282b1a0da693 (patch)
tree3f08e8a5662aa0fe02554fb4d404ef7b71ca7a0c
parent546291a7c9dcbaa90a8e5ee78034371febbfaca4 (diff)
downloadchrome-ec-6dfc7de037e8e18baa54bfda7d8d282b1a0da693.tar.gz
system: Add EC_CMD_CLEAR_RESET_FLAG
Currently, when AP boots for a battery check, it doesn't clear RESET_FLAG_TIMER. This causes the next valid boot (e.g. power button press) to be interpreted as another battery check. This patch adds EC_CMD_CLEAR_RESET_FLAG to allow Depthcharge to clear RESET_FLAG_TIMER to fix the problem. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/135636824 BRANCH=strago TEST=Shutdown, hibernate after G3 timeout, wake up by timer, auto-shutdown, press power button. Kefka boots successfully. Change-Id: I9cc62bffe36a05d33c99eb33419c1bf8998ddd7c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1668423 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--common/system.c11
-rw-r--r--include/ec_commands.h7
2 files changed, 18 insertions, 0 deletions
diff --git a/common/system.c b/common/system.c
index 685b406d45..6e7751b2aa 100644
--- a/common/system.c
+++ b/common/system.c
@@ -1170,3 +1170,14 @@ static int host_command_get_reset_flag(struct host_cmd_handler_args *args)
DECLARE_HOST_COMMAND(EC_CMD_GET_RESET_FLAG,
host_command_get_reset_flag,
EC_VER_MASK(0));
+
+static int host_command_clear_reset_flag(struct host_cmd_handler_args *args)
+{
+ const struct ec_params_clear_reset_flag *p = args->params;
+ system_clear_reset_flags(p->reset_flag);
+ args->response_size = 0;
+ return EC_RES_SUCCESS;
+}
+DECLARE_HOST_COMMAND(EC_CMD_CLEAR_RESET_FLAG,
+ host_command_clear_reset_flag,
+ EC_VER_MASK(0));
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 4f1a891a50..9afda97bc2 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -3596,6 +3596,13 @@ struct ec_response_get_reset_flag {
uint32_t reset_flag;
} __packed;
+/* Clear reset flags */
+#define EC_CMD_CLEAR_RESET_FLAG 0x128
+
+struct ec_params_clear_reset_flag {
+ uint32_t reset_flag;
+} __packed;
+
/*****************************************************************************/
/*
* Blob commands are just opaque chunks of data, sent with proto v3.