MKBP was originally used to send keyboard events to AP OS. Later, more functionalities were added and more types of events can be sent using this protocol. It can transfer information about keystrokes, sensors, switches, fingerprints and more.
| Kconfig sub-options | Default | Documentation |
|---|---|---|
CONFIG_PLATFORM_EC_MKBP_INPUT_DEVICES | n | MKBP input devices |
CONFIG_PLATFORM_EC_MKBP_EVENT | n | MKBP event |
The following options select the delivery method of MKBP messages.
| Kconfig sub-options | Default | Documentation |
|---|---|---|
CONFIG_PLATFORM_EC_MKBP_USE_GPIO | y | MKBP gpio |
CONFIG_PLATFORM_EC_MKBP_USE_HOST_EVENT | n | MKBP host event |
CONFIG_PLATFORM_EC_MKBP_USE_GPIO_AND_HOST_EVENT | n | MKBP gpio and host event |
CONFIG_PLATFORM_EC_MKBP_USE_CUSTOM | n | MKBP custom |
The EC can wake up the AP from sleep modes based on multiple event types. A wake-up mask specifies which specific event types are able to wake the AP.
For x86 based Chromebooks, the wake-up mask is controlled by the AP firmware directly using host commands EC_CMD_HOST_EVENT_SET_SMI_MASK, EC_CMD_HOST_EVENT_SET_SCI_MASK and EC_CMD_HOST_EVENT_SET_WAKE_MASK.
For ARM based Chromebooks, the wake-up mask is defined as device tree nodes, one for MKBP events and one for generic host events. They have respective Kconfig options, which must be enabled to take the masks into account.
The Kconfigs responsible for enabling the wake-up masks are automatically selected if the device tree nodes are specified. See Device Tree nodes paragraph for details.
Both masks have to be compatible with binding file: MKBP event mask yaml
Possible enums to use in these nodes are specified in file: MKBP event mask enums
/ {
ec-mkbp-host-event-wakeup-mask {
compatible = "cros-ec,mkbp-host-event-wakeup-mask";
wakeup-mask = <(HOST_EVENT_LID_OPEN |
HOST_EVENT_POWER_BUTTON |
HOST_EVENT_AC_CONNECTED |
HOST_EVENT_AC_DISCONNECTED |
HOST_EVENT_HANG_DETECT |
HOST_EVENT_RTC |
HOST_EVENT_MODE_CHANGE |
HOST_EVENT_DEVICE)>;
};
ec-mkbp-event-wakeup-mask {
compatible = "cros-ec,mkbp-event-wakeup-mask";
wakeup-mask = <(MKBP_EVENT_KEY_MATRIX |
MKBP_EVENT_HOST_EVENT |
MKBP_EVENT_SENSOR_FIFO)>;
};
}
For detailed descriptions of the MKBP and host event types, please see ec_commands.h header file.