2020-08-31 15:53:42 -06:00
|
|
|
# Host command handler functionality
|
|
|
|
|
|
|
|
# Copyright (c) 2020 Google LLC
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
menu "Host command handler subsystem"
|
|
|
|
|
|
|
|
config EC_HOST_CMD
|
|
|
|
bool "Support Embedded Controller host command handler subsystem"
|
|
|
|
help
|
|
|
|
Enable host command processing for embedded controllers on notebook
|
2022-11-18 12:08:33 +00:00
|
|
|
computers.
|
2020-08-31 15:53:42 -06:00
|
|
|
|
|
|
|
if EC_HOST_CMD
|
|
|
|
|
2022-11-18 12:08:33 +00:00
|
|
|
module = EC_HC
|
|
|
|
module-str = ec-host-commands
|
|
|
|
source "subsys/logging/Kconfig.template.log_config"
|
|
|
|
|
2020-08-31 15:53:42 -06:00
|
|
|
config EC_HOST_CMD_HANDLER_STACK_SIZE
|
|
|
|
int "Stack size for the EC host command handler thread"
|
2022-06-08 16:08:28 +02:00
|
|
|
default 800
|
2020-08-31 15:53:42 -06:00
|
|
|
|
2023-04-17 10:55:06 +02:00
|
|
|
config EC_HOST_CMD_HANDLER_TX_BUFFER_SIZE
|
2020-08-31 15:53:42 -06:00
|
|
|
int "Buffer size in bytes for TX buffer shared by all EC host commands"
|
2022-11-18 12:08:33 +00:00
|
|
|
default 0 if EC_HOST_CMD_BACKEND_ESPI
|
|
|
|
default 0 if EC_HOST_CMD_BACKEND_SHI
|
2023-01-03 10:18:16 +00:00
|
|
|
default 256 if EC_HOST_CMD_BACKEND_UART
|
2023-03-22 07:04:11 +00:00
|
|
|
default 552 if EC_HOST_CMD_BACKEND_SPI
|
2020-08-31 15:53:42 -06:00
|
|
|
default 256
|
2022-11-18 12:08:33 +00:00
|
|
|
help
|
|
|
|
Buffer size in bytes for TX buffer defined by the host command handler.
|
|
|
|
Some backend layers can define their own buffer, so the size can be zero to
|
|
|
|
avoid duplicating buffers. If multiple backends are used, the size has to be
|
|
|
|
set by user to the largest one.
|
|
|
|
|
2023-04-17 10:55:06 +02:00
|
|
|
config EC_HOST_CMD_HANDLER_RX_BUFFER_SIZE
|
2022-11-18 12:08:33 +00:00
|
|
|
int "Buffer size in bytes for RX buffer shared by all EC host commands"
|
|
|
|
default 256 if EC_HOST_CMD_BACKEND_ESPI
|
|
|
|
default 0 if EC_HOST_CMD_BACKEND_SHI
|
2023-01-03 10:18:16 +00:00
|
|
|
default 544 if EC_HOST_CMD_BACKEND_UART
|
2023-03-22 07:04:11 +00:00
|
|
|
default 544 if EC_HOST_CMD_BACKEND_SPI
|
2022-11-18 12:08:33 +00:00
|
|
|
default 256
|
|
|
|
help
|
|
|
|
Buffer size in bytes for TX buffer defined by the host command handler.
|
|
|
|
Some backend layers can define their own buffer, so the size can be zero to
|
|
|
|
avoid duplicating buffers. If multiple backends are used, the size has to be
|
|
|
|
set by user to the largest one.
|
2020-08-31 15:53:42 -06:00
|
|
|
|
2022-06-08 16:08:28 +02:00
|
|
|
config EC_HOST_CMD_HANDLER_PRIO
|
|
|
|
int "Priority of host command task"
|
|
|
|
default 13
|
|
|
|
help
|
|
|
|
Priority of the kernel task that handles the host commands.
|
|
|
|
If the priority is too low (high in value), the host commands handler may be unable to
|
|
|
|
process the command on time and the AP will abort the waiting for response and be unable
|
|
|
|
to boot the system properly.
|
|
|
|
|
2022-11-18 12:08:33 +00:00
|
|
|
config EC_HOST_CMD_INIT_PRIORITY
|
|
|
|
int "Initialization priority"
|
2023-03-22 07:04:11 +00:00
|
|
|
default 80
|
2022-11-18 12:08:33 +00:00
|
|
|
range 0 99
|
|
|
|
help
|
|
|
|
Initialization priority for Host Command. It must be higher than the initialization
|
|
|
|
priority of the used backend device.
|
|
|
|
|
|
|
|
config EC_HOST_CMD_HANDLER_TX_BUFFER_DEF
|
|
|
|
bool
|
2023-04-17 10:55:06 +02:00
|
|
|
default y if EC_HOST_CMD_HANDLER_TX_BUFFER_SIZE > 0
|
2022-11-18 12:08:33 +00:00
|
|
|
help
|
|
|
|
The handler defines common tx buffer
|
|
|
|
|
|
|
|
config EC_HOST_CMD_HANDLER_RX_BUFFER_DEF
|
|
|
|
bool
|
2023-04-17 10:55:06 +02:00
|
|
|
default y if EC_HOST_CMD_HANDLER_RX_BUFFER_SIZE > 0
|
2022-11-18 12:08:33 +00:00
|
|
|
help
|
|
|
|
The handler defines common rx buffer
|
2023-02-03 07:57:57 +00:00
|
|
|
|
2024-11-22 16:50:02 +01:00
|
|
|
config EC_HOST_CMD_NOCACHE_BUFFERS
|
|
|
|
bool "Place RX and TX buffers in __nocache section"
|
|
|
|
default y if DCACHE && DMA
|
|
|
|
depends on EC_HOST_CMD_HANDLER_TX_BUFFER_DEF || EC_HOST_CMD_HANDLER_RX_BUFFER_DEF
|
|
|
|
help
|
|
|
|
DMA is often use for communication, however it usually requires
|
|
|
|
uncached memory. Add possibility to place the RX and TX buffers in the
|
|
|
|
__nocache section.
|
|
|
|
|
2023-04-26 06:11:20 +00:00
|
|
|
config EC_HOST_CMD_INITIALIZE_AT_BOOT
|
|
|
|
bool "Initialize the host command subsystem automacitlly"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Automatically initialize the host command subsystem with the chosen backend.
|
|
|
|
The ec_host_cmd_init function is called by the chosen backend.
|
|
|
|
|
2023-05-17 12:32:23 +00:00
|
|
|
config EC_HOST_CMD_DEDICATED_THREAD
|
|
|
|
bool "Create a new task for host command"
|
|
|
|
help
|
|
|
|
The ec_host_cmd_init function creates a new thread dedicated for Host Command.
|
|
|
|
Otherwise the ec_host_cmd_task function has to be called within another thread.
|
|
|
|
|
2023-06-12 07:58:50 +00:00
|
|
|
config EC_HOST_CMD_IN_PROGRESS_STATUS
|
|
|
|
bool "Save status of last IN_PROGRESS command"
|
|
|
|
default y if EC_HOST_CMD_BACKEND_SHI
|
|
|
|
help
|
|
|
|
Enable support for saving final status of a last command that has sent
|
|
|
|
EC_HOST_CMD_IN_PROGRESS status. The saved status can be get with the
|
|
|
|
ec_host_cmd_send_in_progress_status function.
|
|
|
|
|
2023-05-31 07:48:40 +00:00
|
|
|
source "subsys/mgmt/ec_host_cmd/Kconfig.logging"
|
2022-11-18 12:08:33 +00:00
|
|
|
source "subsys/mgmt/ec_host_cmd/backends/Kconfig"
|
|
|
|
|
2023-05-31 07:48:40 +00:00
|
|
|
endif # EC_HOST_CMD
|
|
|
|
|
2020-08-31 15:53:42 -06:00
|
|
|
endmenu
|