diff options
author | Caveh Jalali <caveh@chromium.org> | 2020-09-30 17:43:18 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-02 13:03:30 +0000 |
commit | 54a10bd3295c065c146931a51284252da606f945 (patch) | |
tree | 4f0a5c9b9aaad052b5de0a1247e82253bbdb8dff /common/system.c | |
parent | 214989b70231d9536211255f255d10297047f78f (diff) | |
download | chrome-ec-54a10bd3295c065c146931a51284252da606f945.tar.gz |
npcx psl: reject hibernate request with timeout
Some Nuvoton NPCX chips support PSL (power state logic) to put the
chip in a very low power state. When this feature is utilized, the
alarm feature is off, thus it is not possible to hibernate for a
specific period of time. Reject CLI requests to do so.
BRANCH=none
BUG=b:144427579
TEST=verified non-zero timeout is reject on volteer
Change-Id: I17537b4724f03bd8f58ee81b80e374629c8b9b88
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2442037
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r-- | common/system.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/system.c b/common/system.c index fbf5895492..206f74181c 100644 --- a/common/system.c +++ b/common/system.c @@ -1070,9 +1070,14 @@ __maybe_unused static int command_hibernate(int argc, char **argv) if (argc >= 3) microseconds = strtoi(argv[2], NULL, 0); - if (seconds || microseconds) + if (seconds || microseconds) { + if (IS_ENABLED(CONFIG_HIBERNATE_PSL)) { + ccprintf("Hibernating with timeout not supported " + "when PSL is enabled.\n"); + return EC_ERROR_INVAL; + } ccprintf("Hibernating for %d.%06d s\n", seconds, microseconds); - else + } else ccprintf("Hibernating until wake pin asserted.\n"); /* |