diff options
author | Mary Ruthven <mruthven@google.com> | 2018-05-16 15:10:30 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-18 20:08:43 -0700 |
commit | 12b71fcbb0a90552f3124c2e776e9d61e3075bba (patch) | |
tree | 9b794c0913426adb3f1bc7a4f62475cf51832b19 | |
parent | f5d9109524f6e2625729d3317b4a7dedd2b37157 (diff) | |
download | chrome-ec-12b71fcbb0a90552f3124c2e776e9d61e3075bba.tar.gz |
cr50: include sleepmask in all images
sleepmask is really useful for debugging sleep issues. Add a read only
version of sleepmask to non-DBG images. It will only be accessible once
the console is unlocked.
BUG=none
BRANCH=cr50
TEST=make sure sleepmask can be modified in DBG images and can only be
read in prod images.
Change-Id: I31ef966f6302d4a7602a014cb08c9b972d13f41e
Signed-off-by: Mary Ruthven <mruthven@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1062804
Commit-Ready: Mary Ruthven <mruthven@chromium.org>
Tested-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | board/cr50/board.h | 2 | ||||
-rw-r--r-- | common/system.c | 9 | ||||
-rw-r--r-- | include/config.h | 1 |
3 files changed, 7 insertions, 5 deletions
diff --git a/board/cr50/board.h b/board/cr50/board.h index edbfe263f2..e0c38c6b2e 100644 --- a/board/cr50/board.h +++ b/board/cr50/board.h @@ -31,7 +31,7 @@ #undef CONFIG_CMD_CRASH #undef CONFIG_CMD_MD #undef CONFIG_CMD_RW -#undef CONFIG_CMD_SLEEPMASK +#undef CONFIG_CMD_SLEEPMASK_SET #undef CONFIG_CMD_WAITMS #undef CONFIG_FLASH #endif diff --git a/common/system.c b/common/system.c index 65c1d16681..64bfabbbc2 100644 --- a/common/system.c +++ b/common/system.c @@ -1224,6 +1224,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(syslock, command_system_lock, */ static int command_sleepmask(int argc, char **argv) { +#ifdef CONFIG_CMD_SLEEPMASK_SET int v; if (argc >= 2) { @@ -1242,14 +1243,14 @@ static int command_sleepmask(int argc, char **argv) sleep_mask = v; } } - +#endif ccprintf("sleep mask: %08x\n", sleep_mask); return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(sleepmask, command_sleepmask, - "[ on | off | <sleep_mask>]", - "Display/force sleep mask"); +DECLARE_SAFE_CONSOLE_COMMAND(sleepmask, command_sleepmask, + "[ on | off | <sleep_mask>]", + "Display/force sleep mask"); #endif #ifdef CONFIG_CMD_JUMPTAGS diff --git a/include/config.h b/include/config.h index 1c1a56af1c..4511fb39ea 100644 --- a/include/config.h +++ b/include/config.h @@ -876,6 +876,7 @@ #define CONFIG_CMD_SHMEM #undef CONFIG_CMD_SLEEP #define CONFIG_CMD_SLEEPMASK +#define CONFIG_CMD_SLEEPMASK_SET #undef CONFIG_CMD_SPI_FLASH #undef CONFIG_CMD_SPI_NOR #undef CONFIG_CMD_SPI_XFER |