summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2017-01-17 14:15:07 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-18 16:06:46 -0800
commit7a4accb77eb4b9b7cb57367c0d8acd57dc650f6b (patch)
tree5fe3733c664cce38fa7686d90faa379d4b9e6d09
parent9dbe791241d90d01c36a57688e46ce3d1343d281 (diff)
downloadchrome-ec-7a4accb77eb4b9b7cb57367c0d8acd57dc650f6b.tar.gz
cr50: extend sysrst pulse to 20ms
Increase the sysrst pulse to be long enough to reset the AP. This change increases it to 20ms by default, but adds a parameter to set the interval in the sysrst pulse command. BUG=none BRANCH=none TEST='sysrst pulse' will cause the AP to reset and 'sysrst pulse 1000' shows that sys_rst_l is asserted and 1 second later it is deasserted. Change-Id: I66b0d627480852dc166f62dc0fddd02f094b6162 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/429150 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--board/cr50/rdd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/board/cr50/rdd.c b/board/cr50/rdd.c
index e294d42d5e..e8a7a190ea 100644
--- a/board/cr50/rdd.c
+++ b/board/cr50/rdd.c
@@ -239,12 +239,19 @@ DECLARE_CONSOLE_COMMAND(ccd, command_ccd,
static int command_sys_rst(int argc, char **argv)
{
int val;
+ char *e;
+ int ms = 20;
if (argc > 1) {
if (!strcasecmp("pulse", argv[1])) {
- ccprintf("Pulsing AP reset\n");
+ if (argc == 3) {
+ ms = strtoi(argv[2], &e, 0);
+ if (*e)
+ return EC_ERROR_PARAM2;
+ }
+ ccprintf("Pulsing AP reset for %dms\n", ms);
assert_sys_rst();
- usleep(200);
+ msleep(ms);
deassert_sys_rst();
} else if (parse_bool(argv[1], &val)) {
if (val)
@@ -262,7 +269,7 @@ static int command_sys_rst(int argc, char **argv)
}
DECLARE_SAFE_CONSOLE_COMMAND(sysrst, command_sys_rst,
- "[pulse | <BOOLEAN>]",
+ "[pulse [time] | <BOOLEAN>]",
"Assert/deassert SYS_RST_L to reset the AP");
static int command_ec_rst(int argc, char **argv)