summaryrefslogtreecommitdiff
path: root/zephyr/test/ap_power
diff options
context:
space:
mode:
authorRajesh Kumar <rajesh3.kumar@intel.com>2022-09-16 11:07:21 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-04 03:45:17 +0000
commit1e4840d4b2b6698e1a6157c5e94fc64927fa8c68 (patch)
tree397704671752296ad88e7ed2a12c3bc676499e99 /zephyr/test/ap_power
parenta4344f58223cee6d4b6d163a96eff399da735690 (diff)
downloadchrome-ec-1e4840d4b2b6698e1a6157c5e94fc64927fa8c68.tar.gz
ap_pwrseq: console command to enable debug mode
Intel debugger puts SOC in boot halt mode for step debugging, during this time EC may lose Sx lines, Adding this console command to enable debug_mode and avoid force shutdown. Below EC console command can be used to prevent force shutdown: 1. debug_mode enable - to prevent force shutdown. 2. debug_mode disable - to follow normal power seq. debug_mode is disabled by default. BRANCH=None BUG=None TEST=force shutdown should be preveneted if debug_mode is enabled. Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: I3fe432d287c9e033d3bb2cb253e436dd2801c6c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3902601 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Diffstat (limited to 'zephyr/test/ap_power')
-rw-r--r--zephyr/test/ap_power/src/console_command.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/zephyr/test/ap_power/src/console_command.c b/zephyr/test/ap_power/src/console_command.c
new file mode 100644
index 0000000000..9d38e773c7
--- /dev/null
+++ b/zephyr/test/ap_power/src/console_command.c
@@ -0,0 +1,32 @@
+/* Copyright 2022 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <zephyr/shell/shell.h>
+#include <zephyr/ztest.h>
+
+#include "console.h"
+#include "ec_commands.h"
+#include "test_state.h"
+
+ZTEST_USER(console_cmd_debug_mode, test_debug_mode_default)
+{
+ zassert_ok(shell_execute_cmd(get_ec_shell(), "debug_mode"),
+ "failed to get debug_mode");
+}
+
+ZTEST_USER(console_cmd_debug_mode, test_debug_mode_disabled)
+{
+ zassert_ok(shell_execute_cmd(get_ec_shell(), "debug_mode disable"),
+ "failed to disable debug_mode");
+}
+
+ZTEST_USER(console_cmd_debug_mode, test_debug_mode_enabled)
+{
+ zassert_ok(shell_execute_cmd(get_ec_shell(), "debug_mode enable"),
+ "failed to enable debug_mode");
+}
+
+ZTEST_SUITE(console_cmd_debug_mode, ap_power_predicate_post_main, NULL, NULL,
+ NULL, NULL);