Commit Graph

18 Commits

Author SHA1 Message Date
Anas Nashif
345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Dawid Niedzwiecki
aa0c0727b4 mgmt: ec_host_cmd: add config to create a dedicated thread
Add a config to decide if a new dedicated thread for Host Command is
created during initialization.

If not, the ec_host_cmd_task has to be called by another thread to
handle host commands.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-05-23 16:19:53 +02:00
Maciej Perkowski
75b062a6d6 tests: samples: Resolve duplicates in names.
Several duplicates were found with
scripts/twister -T samples/ -T tests/ --dry-run --list-test-duplicates
This is an issue since duplicated names causes overwriting of
results. Most duplicates looked like obvious copy-pase errors.
New names where addopted looking at other tests in the same yaml
or looking at the directory/descriptio.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-05-16 06:21:25 -04:00
Dawid Niedzwiecki
4ef47888ef ec_host_cmd: add UART backend
Add a new backend for Host Commands that uses UART. The backend bases
asynchronous UART API.

The UART backend is mainly used by FPMCU.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-04-07 13:05:59 +02:00
Dawid Niedzwiecki
73480edf00 ec_host_cmd: update test the directory structure
Create a separate directory per backend.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-04-07 13:05:59 +02:00
Dawid Niedzwiecki
2d0a784c41 subsys/mgmt/ec_host_cmd: rework Host Command support
Rework the Host Command support. It includes:
-change API to backend
-change a way of defining rx and tx buffers
-fix synchronization between the handler and backend layer
-simplify the HC handler

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Dawid Niedzwiecki
b2674a4b34 subsys/mgmt/ec_host_cmd: rename peripheral to backend
Follow naming pattern in the subsystems(logging or shell) and name
the layer between generic handler and peripheral driver "backend".

The name doesn't suit that well to the SHI backend, because there isn't
SHI API itself and the SHI interface is used only for the host
communication. So the backend code includes the peripheral driver itself.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Dawid Niedzwiecki
e734adfb78 subsys/mgmt/ec_host_cmd: update directory structure
The Host Commands can be used with different transport layers e.g. SHI
or eSPI. The code that provides the peripheral API and allows sending
and receiving Host Commands via different transport layers is not
actually drivers of a peripheral, so move it to the
subsys/mgmt/ec_host_cmd folder.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Michał Barnaś
b91849c4bd ec_host_cmd: add missing fields and improve compatibility
Add missing fields in structure containing the arguments used by
the host commands handlers and change the order of parameters
in macro used for defining the handlers.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-11-18 10:11:40 +01:00
Michał Barnaś
369596dc95 ec_host_cmd: increase stack size, change thread priority and alignment
This commit increases the stack size for thread handling the host
commands requests. It was required due to the stack being
corrupted using earlier default size. The thread priority is now
configurable using the Kconfig.
It also adds alignment to the tx_buffer since the npcx MCU requires it
to work correctly and removes clearing the buffer before use due to
the hard time requirements. Tests checking if buffers are cleared
are also removed.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-11-18 10:11:40 +01:00
Anas Nashif
61b56cae44 tests: mgmt: fix tags and identifiers
Fix tags and identifiers for all mgmt subsys tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-15 05:32:28 -05:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Keith Packard
fb1d092955 tests: ec_host_cmd: Make sure expected_dut_to_host fits in buffer
If struct tx_structure is too large than the buffer that
expected_dut_to_host references, leading the compiler to generate a warning
about the possibility of buffer overflow.

Leave out the 'struct ec_response_too_big' so that 'struct tx_structure'
fits within the 256 byte buffer.

This was caught when using GCC 11.3.0 building the test for native_posix.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-07-04 16:11:51 +02:00
Yinfang Wang
08dadc3c30 tests: subsys: mgmt: move ec_host_cmd to new ztest API
Move test ec_host_cmd to use new ztest API.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-07-01 11:37:41 +02:00
Gerard Marull-Paretas
ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Torsten Rasmussen
1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Kumar Gala
043891e1ea include: Move ec_host_cmd.h to mgmt/ec_host_cmd.h
Move ec_host_cmd.h out of the top level include/ dir into
include/mgmt/ec_host_cmd.h and deprecated the old location.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-22 12:51:16 -04:00
Jett Rink
1972f0b7f4 ec_host_cmd: add ec host command handler framework
Add a generic host command handler framework that allows users to
declare new host command handlers with the HOST_COMMAND_HANDLER macro
at build time. The framework will handle incoming messages from the
host command peripheral device and forwards the incoming data to the
appropriate host command handler, which is looked up by id.

The framework will also send the response from the handler back to the
host command peripheral device. The device handles sending the data on
the physical bus.

This type of host command communication is typically done on an embedded
controller for a notebook or computer. The host would be the main
application processor (aka AP, CPU, SoC).

Signed-off-by: Jett Rink <jettrink@google.com>
2020-09-04 14:50:45 -04:00