blob: 65694507661ac3ab4d6d5a65cfbfc7bb6c27f6b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# 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.
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_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.
endif # PLATFORM_EC
|