diff options
author | Wei-Ning Huang <wnhuang@google.com> | 2017-04-22 06:26:39 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-04-27 06:38:14 -0700 |
commit | 4bc509b0608ef8ce41356415bc1bb1d1ec619a37 (patch) | |
tree | 250e3753761e1b9af2e5c12c352abbbfb9d9eaa7 /common/rwsig.c | |
parent | fb387c4f4a0fa38521d5e30fe971fef529f10548 (diff) | |
download | chrome-ec-4bc509b0608ef8ce41356415bc1bb1d1ec619a37.tar.gz |
rwsig: add host command for getting rwsig status
Add a new host command EC_CMD_RWSIG_CHECK_STATUS for getting rwsig
status and rw firmware hash. This command is used to check the RW
signature of newly updated RW image.
A new subcommand is also added to ectool.
BRANCH=none
BUG=b:37584134
TEST=on rose board `ectool rwsigstatus` works
Change-Id: I33d8709f5248d3a4b8bedb36ded84a93dc8c971f
Signed-off-by: Wei-Ning Huang <wnhuang@google.com>
Reviewed-on: https://chromium-review.googlesource.com/485079
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common/rwsig.c')
-rw-r--r-- | common/rwsig.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/rwsig.c b/common/rwsig.c index 600c3eeaad..efc8c03ee1 100644 --- a/common/rwsig.c +++ b/common/rwsig.c @@ -10,6 +10,7 @@ #include "console.h" #include "ec_commands.h" #include "flash.h" +#include "host_command.h" #include "rollback.h" #include "rsa.h" #include "rwsig.h" @@ -271,4 +272,18 @@ exit: while (1) task_wait_event(-1); } +#else /* !HAS_TASK_RWSIG */ +int rwsig_cmd_check_status(struct host_cmd_handler_args *args) +{ + struct ec_response_rwsig_check_status *r = args->response; + + memset(r, 0, sizeof(*r)); + r->status = rwsig_check_signature(); + args->response_size = sizeof(*r); + + return EC_RES_SUCCESS; +} +DECLARE_HOST_COMMAND(EC_CMD_RWSIG_CHECK_STATUS, + rwsig_cmd_check_status, + EC_VER_MASK(0)); #endif |