diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-09-25 15:28:55 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-09-26 11:31:31 -0700 |
commit | 5943e6c1f5ca86c96cfa38926651466d929278d2 (patch) | |
tree | 13b1c4610e16abbfe55cc1d1f16559d69fe6c452 | |
parent | 1b14b2c922808ac1f7084f301d54173ca0074bf7 (diff) | |
download | chrome-ec-5943e6c1f5ca86c96cfa38926651466d929278d2.tar.gz |
Clean up reboot host command
1) Only send the host response immediately for commands which won't
return. This prevents double-sending a response for the disable-jump
command.
2) Remove references to the POWER_ON flag. This was never implemented
or used, since with EC software sync the EC always powers on after
rebooting.
3) Fix help text for reboot_ec command. (Both "A" and "RW" still do the
same thing, but "RW" is now the preferred option string.)
BUG=chrome-os-partner:12635
BRANCH=link (also applies to snow, but don't pick unless needed)
TEST=from a root shell,
flashrom -p internal:bus=lpc -r /tmp/ec.bin
flashrom -p internal:bus=lpc -w /tmp/ec.bin
ectool reboot_ec RW
ectool reboot_ec RO
ectool disable-jump
All commands should succeed.
Change-Id: Ibf5b4fb88d93e64fc7361a9f962ec7aa1df0cf3c
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34051
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
-rw-r--r-- | common/system_common.c | 12 | ||||
-rw-r--r-- | include/ec_commands.h | 3 | ||||
-rw-r--r-- | util/ectool.c | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/common/system_common.c b/common/system_common.c index 847e808fd2..d3f4f3f6fd 100644 --- a/common/system_common.c +++ b/common/system_common.c @@ -865,12 +865,14 @@ int host_command_reboot(struct host_cmd_handler_args *args) return EC_RES_SUCCESS; } - /* TODO: (crosbug.com/p/9040) handle EC_REBOOT_FLAG_POWER_ON */ - #ifdef CONFIG_TASK_HOSTCMD - /* Clean busy bits on host */ - args->result = EC_RES_SUCCESS; - host_send_response(args); + if (p.cmd == EC_REBOOT_JUMP_RO || + p.cmd == EC_REBOOT_JUMP_RW || + p.cmd == EC_REBOOT_COLD) { + /* Clean busy bits on host for commands that won't return */ + args->result = EC_RES_SUCCESS; + host_send_response(args); + } #endif CPRINTF("[%T Executing host reboot command %d]\n", p.cmd); diff --git a/include/ec_commands.h b/include/ec_commands.h index f30f6a71a4..ac7a06893f 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -1047,8 +1047,7 @@ enum ec_reboot_cmd { /* Flags for ec_params_reboot_ec.reboot_flags */ #define EC_REBOOT_FLAG_RESERVED0 (1 << 0) /* Was recovery request */ -#define EC_REBOOT_FLAG_ON_AP_SHUTDOWN (1 << 1) -#define EC_REBOOT_FLAG_POWER_ON (1 << 2) +#define EC_REBOOT_FLAG_ON_AP_SHUTDOWN (1 << 1) /* Reboot after AP shutdown */ struct ec_params_reboot_ec { uint8_t cmd; /* enum ec_reboot_cmd */ diff --git a/util/ectool.c b/util/ectool.c index 7ddaa07c06..f281fd62ac 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -110,7 +110,7 @@ const char help_str[] = " Set keyboard backlight in percent\n" " readtest <patternoffset> <size>\n" " Reads a pattern from the EC via LPC\n" - " reboot_ec <RO|A|disable-jump> [at-shutdown]\n" + " reboot_ec <RO|RW|disable-jump> [at-shutdown]\n" " Reboot EC to RO or RW\n" " rtcget\n" " Print real-time clock\n" |