# Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. menuconfig PLATFORM_EC bool "Enable building code from the platform/ec Zephyr module" imply PRINTK imply SHELL help The platform/ec Zephyr module allows some code from the existing Chrome OS EC project to be "shimmed" into Zephyr. if PLATFORM_EC # Below is a hack to use CONFIG_ZEPHYR in platform/ec code before # config.h has been included. There is some tricky ordering in some # header files that we cannot use config.h (e.g., common.h and # compile_time_macros.h), as many board.h and config_chip.h files # use these macros, and thus would be included by an include of # config.h. We work around this by initially defining CONFIG_ZEPHYR # in Kconfig as an invisible symbol (it should always be enabled). # Then, once config.h gets included, it subsequently gets undef'ed by # config.h, and then redefined by config_chip.h in the Zephyr shim. config ZEPHYR bool default y help This should always be enabled. It's a workaround for config.h not being available in some headers. config PLATFORM_EC_EXTPOWER_GPIO bool "Enable the GPIO-based external power detection module" depends on PLATFORM_EC_HOOKS && PLATFORM_EC_HOSTCMD help Enable shimming the extpower_gpio module, which provides GPIO-based external power presence detection features. The project should define a GPIO pin named GPIO_AC_PRESENT, with extpower_interrupt configured as the handler in gpio_map.h. 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 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 help Enable compilation of the EC timer module if PLATFORM_EC_TIMER config PLATFORM_EC_TIMER_CMD_GETTIME bool "Enable the gettime command" default y help Enable the "gettime" command config PLATFORM_EC_TIMER_CMD_TIMERINFO bool "Enable the timerinfo command" default y help Enable the "timerinfo" command config PLATFORM_EC_TIMER_CMD_WAITMS bool "Enable the waitms command" default y help Enable the "waitms" command endif # PLATFORM_EC_TIMER config PLATFORM_EC_HOOKS bool "Enable hooks and deferred compatibility shim" default y help Enable translation of DECLARE_DEFERRED and hook_call_deferred to Zephyr's work queues, and a compatible DECLARE_HOOK implementation. config PLATFORM_EC_HOSTCMD bool "Enable host commands shim" default y if AP help Enable the host commands shim in platform/ec. config PLATFORM_EC_LID_SWITCH bool "Enable the lid switch module" help Enable shimming the lid switch implementation and related commands in platform/ec. This requires a GPIO named GPIO_LID_OPEN to be defined in gpio_map.h. config PLATFORM_EC_I2C bool "Enable the EC i2c module" default y help Enable compilation of the EC i2c module. Once enabled, it will be possible to make calls using the old platform/ec i2c APIs defined in include/i2c.h and implemented in common/i2c_master.c. Doing so should make shimming other platform/ec modules which rely on i2c communication "just work" without requiring any further code changes. config PLATFORM_EC_POWER_BUTTON bool "Enable the power button module" depends on PLATFORM_EC_HOSTCMD help Enable shimming the power button implementation and related commands in platform/ec. This requires a GPIO named GPIO_POWER_BUTTON_L in gpio_map.h. endif # PLATFORM_EC