diff options
author | Simon Glass <sjg@chromium.org> | 2020-11-06 11:21:07 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-07 01:26:10 +0000 |
commit | c28fa1ade5eb35534a85ce82060cf955151c6337 (patch) | |
tree | 98b97d3cc57b3c083a098ccf1175ce95942147a2 | |
parent | 9af5df80b12b7a4d1462507e23d4b3100f6f371b (diff) | |
download | chrome-ec-c28fa1ade5eb35534a85ce82060cf955151c6337.tar.gz |
zephyr: Enable the '8042' command
This is used to provide information about the keyboard operation.
Enable this command and its subcommands.
Note that in ECOS these subcommands are also top-level commands, but
this is not the case in Zephyr, since it seems unnecessary.
Note also that changing these to console sub-commands may end up making
FAFT testing more difficult since the invocation on the EC UART would
be different.
BUG=b:167405015
BRANCH=none
TEST=make BOARD=volteer
zmake configure .../zephyr-chrome/projects/experimental/volteer \
-B /tmp/z/cos
zmake build /tmp/z/cos
Run on volteer and try out '8042 kbd', etc.
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ia11092af350247ac98681485a9ddd309c7192272
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523452
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | common/keyboard_8042.c | 38 | ||||
-rw-r--r-- | zephyr/Kconfig | 13 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
3 files changed, 36 insertions, 20 deletions
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c index 12a7da2560..9fbde467a0 100644 --- a/common/keyboard_8042.c +++ b/common/keyboard_8042.c @@ -1070,10 +1070,6 @@ static int command_typematic(int argc, char **argv) ccputs("}\n"); return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(typematic, command_typematic, - "[first] [inter]", - "Get/set typematic delays"); - static int command_codeset(int argc, char **argv) { @@ -1093,10 +1089,6 @@ static int command_codeset(int argc, char **argv) ccprintf("I8042_XLATE: %d\n", controller_ram[0] & I8042_XLATE ? 1 : 0); return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(codeset, command_codeset, - "[set]", - "Get/set keyboard codeset"); - static int command_controller_ram(int argc, char **argv) { @@ -1115,9 +1107,6 @@ static int command_controller_ram(int argc, char **argv) ccprintf("%d = 0x%02x\n", index, controller_ram[index]); return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(ctrlram, command_controller_ram, - "index [value]", - "Get/set keyboard controller RAM"); static int command_keyboard_log(int argc, char **argv) { @@ -1161,11 +1150,6 @@ static int command_keyboard_log(int argc, char **argv) return EC_SUCCESS; } -#if CMD_KEYBOARD_LOG -DECLARE_CONSOLE_COMMAND(kblog, command_keyboard_log, - "[on | off]", - "Print or toggle keyboard event log"); -#endif static int command_keyboard(int argc, char **argv) { @@ -1181,10 +1165,6 @@ static int command_keyboard(int argc, char **argv) ccprintf("Enabled: %d\n", keyboard_enabled); return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(kbd, command_keyboard, - "[on | off]", - "Print or toggle keyboard info"); - static int command_8042_internal(int argc, char **argv) { @@ -1229,6 +1209,24 @@ static int command_8042_internal(int argc, char **argv) return EC_SUCCESS; } +/* Zephyr only provides these as subcommands*/ +#ifndef CONFIG_ZEPHYR +DECLARE_CONSOLE_COMMAND(typematic, command_typematic, + "[first] [inter]", + "Get/set typematic delays"); +DECLARE_CONSOLE_COMMAND(codeset, command_codeset, + "[set]", + "Get/set keyboard codeset"); +DECLARE_CONSOLE_COMMAND(ctrlram, command_controller_ram, + "index [value]", + "Get/set keyboard controller RAM"); +DECLARE_CONSOLE_COMMAND(kblog, command_keyboard_log, + "[on | off]", + "Print or toggle keyboard event log"); +DECLARE_CONSOLE_COMMAND(kbd, command_keyboard, + "[on | off]", + "Print or toggle keyboard info"); +#endif static int command_8042(int argc, char **argv) { diff --git a/zephyr/Kconfig b/zephyr/Kconfig index 82637ff5cd..73e1a0feec 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -53,6 +53,19 @@ config PLATFORM_EC_KEYBOARD_PROTOCOL_8042 endchoice # PLATFORM_EC_KEYBOARD +config PLATFORM_EC_CONSOLE_CMD_KEYBOARD_8042 + bool "Enable the keyboard commands" + default y if PLATFORM_EC_KEYBOARD_PROTOCOL_8042 + help + Enable the '8042' command, which includes the following subcommands: + + codeset - Get/set keyboard codeset + ctrlram - Get/set keyboard controller RAM + internal - Show internal information + kbd - Print or toggle keyboard info + kblog - Print or toggle keyboard event log (current disabled) + typematic - Get/set typematic delays + menuconfig PLATFORM_EC_TIMER bool "Enable the EC timer module" default y diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index a9a0bb651a..511d934bc5 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -29,6 +29,11 @@ #define CONFIG_CMD_GETTIME #endif /* CONFIG_PLATFORM_EC_TIMER_CMD_GETTIME */ +#undef CONFIG_CMD_KEYBOARD +#ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_KEYBOARD_8042 +#define CONFIG_CMD_KEYBOARD +#endif + #undef CONFIG_KEYBOARD_PROTOCOL_8042 #ifdef CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042 #define CONFIG_KEYBOARD_PROTOCOL_8042 |