summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-04-27 12:09:44 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-27 18:05:29 -0700
commit102ad072922da1c510446fb3bb4d14c5eb815cec (patch)
treed29dfd2f80f09aea308bb5db77c9d974f56b5407
parent86ab7efb58025601b7799eedee29ba9d9d5f10a6 (diff)
downloadchrome-ec-102ad072922da1c510446fb3bb4d14c5eb815cec.tar.gz
npcx/lpc: Add debug command to trigger sci/smi/wake
This change adds console command to trigger sci/smi/wake based on the user-provided argument. This command is enabled only when DEBUG_LPC is set to 1. It was very helpful while debugging b:78497502 where I could trigger the interrupts to check communication between AP and EC. BUG=b:78497502 BRANCH=None TEST=Verified by enabling DEBUG_LPC that sci/smi/wake are generated as expected. Change-Id: I5b52f5ea4e1824e520fd76315091f73bef157ebf Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1033541 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--chip/npcx/lpc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/chip/npcx/lpc.c b/chip/npcx/lpc.c
index d37c47ed1c..646196f88c 100644
--- a/chip/npcx/lpc.c
+++ b/chip/npcx/lpc.c
@@ -1042,3 +1042,23 @@ static int lpc_get_protocol_info(struct host_cmd_handler_args *args)
DECLARE_HOST_COMMAND(EC_CMD_GET_PROTOCOL_INFO,
lpc_get_protocol_info,
EC_VER_MASK(0));
+
+#if DEBUG_LPC
+static int command_lpc(int argc, char **argv)
+{
+ if (argc == 1)
+ return EC_ERROR_PARAM1;
+
+ if (!strcasecmp(argv[1], "sci"))
+ lpc_generate_sci();
+ else if (!strcasecmp(argv[1], "smi"))
+ lpc_generate_smi();
+ else if (!strcasecmp(argv[1], "wake"))
+ lpc_update_wake(-1);
+ else
+ return EC_ERROR_PARAM1;
+ return EC_SUCCESS;
+}
+DECLARE_CONSOLE_COMMAND(lpc, command_lpc, "[sci|smi|wake]", "Trigger SCI/SMI");
+
+#endif