diff options
author | Nicolas Boichat <drinkcat@google.com> | 2017-04-05 09:25:52 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-04-06 22:27:01 -0700 |
commit | e3f5e6bf6ad2d1e2c283a75cf08e17155633e0a5 (patch) | |
tree | 298b008619be3fd4dc7989e0c39ba2c2cbccbd0f | |
parent | a8e6b070cbd107d8c2f44f44ae8231a4f4efea90 (diff) | |
download | chrome-ec-e3f5e6bf6ad2d1e2c283a75cf08e17155633e0a5.tar.gz |
system: Fixups in emulated sysrq code
Follow-up to CL:456520, addressing a few more comments.
BRANCH=none
BUG=b:35775099
TEST=sysrq available in EC console
TEST=sysrq h => help message in AP console
TEST=sysrq b => AP reboots
Change-Id: I692afa7c911882f00d92b8e6d83889c52821e171
Reviewed-on: https://chromium-review.googlesource.com/468506
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | common/keyboard_mkbp.c | 2 | ||||
-rw-r--r-- | common/system.c | 2 | ||||
-rw-r--r-- | include/config.h | 5 | ||||
-rw-r--r-- | include/ec_commands.h | 5 | ||||
-rw-r--r-- | include/host_command.h | 8 | ||||
-rw-r--r-- | include/system.h | 8 |
6 files changed, 18 insertions, 12 deletions
diff --git a/common/keyboard_mkbp.c b/common/keyboard_mkbp.c index e592addf2f..204268e76f 100644 --- a/common/keyboard_mkbp.c +++ b/common/keyboard_mkbp.c @@ -260,7 +260,7 @@ void keyboard_update_button(enum keyboard_button_type button, int is_pressed) } #ifdef CONFIG_EMULATED_SYSRQ -void send_sysrq(uint8_t key) +void host_send_sysrq(uint8_t key) { uint32_t value = key; diff --git a/common/system.c b/common/system.c index 2ddcd570c2..25ba9dea2c 100644 --- a/common/system.c +++ b/common/system.c @@ -1126,7 +1126,7 @@ static int command_sysrq(int argc, char **argv) if (argc > 1 && argv[1]) key = argv[1][0]; - send_sysrq(key); + host_send_sysrq(key); return EC_SUCCESS; } diff --git a/include/config.h b/include/config.h index d3c661e52f..27afcbfb48 100644 --- a/include/config.h +++ b/include/config.h @@ -923,7 +923,10 @@ /* Support EC chip internal data EEPROM */ #undef CONFIG_EEPROM -/* Support for sending emulated sysrq commands to AP */ +/* + * Support for sending emulated sysrq events to AP (on designs with a keyboard, + * sysrq is passed as normal key presses). + */ #undef CONFIG_EMULATED_SYSRQ /* Support for eSPI for host communication */ diff --git a/include/ec_commands.h b/include/ec_commands.h index d10fca9df5..2e331637a1 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2797,7 +2797,10 @@ enum ec_mkbp_event { /* New Fingerprint sensor event, the event data is fp_events bitmap. */ EC_MKBP_EVENT_FINGERPRINT = 5, - /* Sysrq event */ + /* + * Sysrq event: send emulated sysrq. The event data is sysrq, + * corresponding to the key to be pressed. + */ EC_MKBP_EVENT_SYSRQ = 6, /* Number of MKBP events */ diff --git a/include/host_command.h b/include/host_command.h index acaa2a4f6b..aff1d1b8b5 100644 --- a/include/host_command.h +++ b/include/host_command.h @@ -281,4 +281,12 @@ int pd_host_command(int command, int version, */ int host_get_vboot_mode(void); +/* + * Sends an emulated sysrq to the host, used by button-based debug mode. + * Only implemented on top of MKBP protocol. + * + * @param key Key to be sent (e.g. 'x') + */ +void host_send_sysrq(uint8_t key); + #endif /* __CROS_EC_HOST_COMMAND_H */ diff --git a/include/system.h b/include/system.h index 32a544db49..26a57d9d61 100644 --- a/include/system.h +++ b/include/system.h @@ -507,12 +507,4 @@ uintptr_t system_get_fw_reset_vector(uintptr_t base); */ int system_is_reboot_warm(void); -/* - * Sends an emulated sysrq to the host, used by button-based debug mode. - * Only implemented on top of MKBP protocol. - * - * @param key Key to be sent (e.g. 'x') - */ -void send_sysrq(uint8_t key); - #endif /* __CROS_EC_SYSTEM_H */ |