summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-11-04 16:51:58 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-06 03:42:15 +0000
commit8f91458a1b888bb75f6f4d3ffe4d0de1a221a589 (patch)
tree894dccba23a7a475dd63d4f3770ea4a4714a8abe /zephyr
parent29c78b9d50929ae3a2d78752a50314305ab515da (diff)
downloadchrome-ec-8f91458a1b888bb75f6f4d3ffe4d0de1a221a589.tar.gz
zephyr: Allow keyboard_8042 to build with zephyr
Make a few changes so that this file can build. It does not work yet. 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 See there are no errors Change-Id: If68cc8e4541f513013481bde859fbe2f4681a0bc Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521358 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/CMakeLists.txt2
-rw-r--r--zephyr/Kconfig25
-rw-r--r--zephyr/shim/include/config_chip.h5
3 files changed, 32 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index 3a0530e782..c9aa8bf115 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -36,5 +36,7 @@ add_subdirectory_ifdef(CONFIG_PLATFORM_EC "shim/src")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC "${PLATFORM_EC}/common/base32.c")
zephyr_sources_ifdef(CONFIG_SHELL "${PLATFORM_EC}/common/gpio_commands.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042
+ "${PLATFORM_EC}/common/keyboard_8042.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC "${PLATFORM_EC}/common/queue.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_TIMER "${PLATFORM_EC}/common/timer.c")
diff --git a/zephyr/Kconfig b/zephyr/Kconfig
index 8a534f8eb6..82637ff5cd 100644
--- a/zephyr/Kconfig
+++ b/zephyr/Kconfig
@@ -28,6 +28,31 @@ config ZEPHYR
This should always be enabled. It's a workaround for
config.h not being available in some headers.
+menuconfig PLATFORM_EC_KEYBOARD
+ bool "Enable keybaord support"
+ default y
+ help
+ Enable compilation of support for scanning a keyboard and providing
+ the resulting input to the AP over the host interface. This consists
+ of a keyboard-scanning task which provides key scans via it calling
+ keyboard_state_changed() (for i8042) or its client calling
+ keyboard_scan_get_state() (for MKBP).
+
+choice "Protocol select"
+ prompt "Select the keyboard protocol to use"
+
+config PLATFORM_EC_KEYBOARD_PROTOCOL_8042
+ bool "i8042"
+ help
+ Use the i8042 protocol to communicate with the AP. This dates from the
+ Intel 8042 keyboard controller chip released in 1976. It uses two-way
+ communication via a few 8-bit registers, allowing key codes to be
+ sent to the AP when keys are pressed and released.
+
+ See here for docs: https://wiki.osdev.org/%228042%22_PS/2_Controller
+
+endchoice # PLATFORM_EC_KEYBOARD
+
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 dc5f14865c..a9a0bb651a 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_KEYBOARD_PROTOCOL_8042
+#ifdef CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042
+#define CONFIG_KEYBOARD_PROTOCOL_8042
+#endif /* CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042 */
+
#undef CONFIG_CMD_TIMERINFO
#ifdef CONFIG_PLATFORM_EC_TIMER_CMD_TIMERINFO
#define CONFIG_CMD_TIMERINFO