diff options
author | Bill Richardson <wfrichar@chromium.org> | 2012-05-24 12:17:31 -0700 |
---|---|---|
committer | Bill Richardson <wfrichar@chromium.org> | 2012-05-25 10:20:25 -0700 |
commit | cc778c70d6415e3133670131c21aeecf02571e6b (patch) | |
tree | f3361de92a8cf27d800bdae513f7c554e01faddb | |
parent | 61902efd16095af85764bd4b2df51415df49ea55 (diff) | |
download | chrome-ec-cc778c70d6415e3133670131c21aeecf02571e6b.tar.gz |
Add mmapinfo command to power_button.c
BUG=none
TEST=none
Change-Id: Id6ced0b87b354136e0b80026a537958586bb1325
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | chip/lm4/power_button.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chip/lm4/power_button.c b/chip/lm4/power_button.c index 685902c508..9ec258ba51 100644 --- a/chip/lm4/power_button.c +++ b/chip/lm4/power_button.c @@ -603,3 +603,25 @@ static int command_lidclose(int argc, char **argv) return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(lidclose, command_lidclose); + +static int command_mmapinfo(int argc, char **argv) +{ + uint8_t *memmap_switches = lpc_get_memmap_range() + EC_MEMMAP_SWITCHES; + uint8_t val = *memmap_switches; + int i; + const char *explanation[] = { + "lid_open", + "powerbtn", + "wp_off", + "kbd_rec", + "gpio_rec", + "fake_dev", + }; + ccprintf("memmap switches = 0x%x\n", val); + for (i = 0; i < ARRAY_SIZE(explanation); i++) + if (val & (1 << i)) + ccprintf(" %s\n", explanation[i]); + + return EC_SUCCESS; +} +DECLARE_CONSOLE_COMMAND(mmapinfo, command_mmapinfo); |