Commit graph

328 commits

Author SHA1 Message Date
Lucas Tamborrino
4f1fd56b36 tests: boards: espressif: add esp32s3 to cache coex test
Test esp32s3 for cache coexistence. Update test documentation.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-07-26 14:42:20 +02:00
Marek Matej
3776402f40 boards: xtensa: esp32 board split
Remove virtual esp32 board and replace it with the
real word boards:

- esp32_devkitc_wroom
- esp32_devkitc_wrover (with PSRAM option)

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-25 18:12:33 +02:00
Andrey Borisovich
23b3cae1b1 inte_adsp: ipc: prevent ipc message send during Device power transition
When CONFIG_PM_DEVICE is enabled IPC Device may be during power transition
during a call to intel_adsp_ipc_send_message function.
Changed signatures of intel_adsp_ipc_send_message and its sync version
to return int and negative error codes on error.
On attempt to send IPC message during Device power transition
-ESHUTDOWN error code is returned, on busy state -EBUSY.
Updated all function references.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-06-22 06:14:57 -04:00
Adrian Warecki
2958a407f8 adsp: dmic: Add source clock selection support
The dmic driver has been expanded to support different clock sources.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-06-20 14:19:13 -04:00
Lucas Tamborrino
556fca4ef5 tests: boards: esp32: cache_coex: add esp32s2
Add esp32s2_saola to supported platforms

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-05-27 06:22:50 -04:00
Manimaran A
224a72427f test: boards: qspi: mchp: Overlay file updated for Quad mode
Updated the overlay file to enable spi quad IOs.
Fix: #55078

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2023-05-24 19:40:12 -04:00
Fabio Baltieri
7d898edfc5 boards: nrf52_bsim: always allow testing with no optimization
Since f5830f3c3f, running tests with no optimization has to be confirmed
by setting ZTEST_ALLOW_NO_OPTIMIZATIONS. This is normally done on a per
test basis, but since nrf52_bsim disables optimizations in the
defconfig, the default option has to be flipped at board level so that
every test for this board builds correctly.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-23 15:28:44 +09:00
Fabio Baltieri
f5830f3c3f ztest: error out when building tests with no compiler optimizations
Many tests are known to fail when built and no compiler optimizations.
Add a CMake check to error out when building a ztest based test with no
optimization, ask not file issues about it but also adds an opt-out
option to bypass the error for tests are actually designed to work in
this setup.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-22 12:25:43 -04:00
Gerard Marull-Paretas
93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Cyril Fougeray
1be72d9888 dma: callback with 2 status codes for successful transfers
Make use of positive status values in the DMA callback to pass
info to the DMA client after a successful DMA operation.
A completed DMA transfer uses the status 0 while a reached
water mark uses the status 1.

Signed-off-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
2023-05-08 09:57:32 +02:00
Adam Wojasinski
0caa249f90 tests: boards: nrf52_bsim: egu: Replace obsolete timer frequency API
New nrfx release removes depricated `nrf_timer_frequency_set()`
function. Instead of it `nrf_timer_prescaler_set` is used with
`NRF_TIMER_PRESCALER_CALCULATE()` and `NRF_TIMER_BASE_FREQUENCY_GET()`
macros.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-05-05 11:47:53 +02:00
Anas Nashif
6388f5f106 xtensa: use sys_cache API instead of custom interfaces
Use sys_cache instead of custom and internal APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-26 07:31:22 -04:00
Gerard Marull-Paretas
1cf1994686 tests: mec15xxevb_assy6853: qspi: make module vars static
Make some module variables static, limiting their scope and guaranteeing
zero-initialization. This allows to remove some redundant code as well.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-24 21:29:55 +02:00
Keith Packard
0b90fd5adf samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Most of these changes were automated using coccinelle with the following
script:

@@
@@
- void
+ int
main(...) {
	...
-	return;
+	return 0;
	...
}

Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Ederson de Souza
38d9da7266 tests/boards/mec15xxevb_assy6853/qspi: Fix typo in test
Actually, more of a name mismatch between suite declaration and usage.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2023-04-07 13:39:17 +02:00
Anas Nashif
633e614589 tests: intel_adsp: remove reference to old platforms
CAVS platfroms up to CAVS25 (excl.) are removed, so remove reference in
test code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-06 18:51:56 +02:00
Anas Nashif
fcefc27823 tests: remove intel adsp cavs platforms from filters
Remove all filters related to dropped platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-06 18:51:56 +02:00
Robert Gałat
85b4143ecc nrf52_bsim: Add tests of EGU
Adds automated tests for EGU peripheral.
These tests can be run on nrf52840dk_nrf52840
or on nrf52_bsim.

Signed-off-by: Robert Gałat <robert.galat@nordicsemi.no>
Co-authored-by: Filip Zajdel <filip.zajdel@nordicsemi.no>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-02-22 16:15:20 +01:00
Jaska Uimonen
18ce85c201 tests: intel_adsp: ssp: fix dma data sizes
Dma data sizes were incorrect causing segfault in the test, thus fix
them.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2023-02-07 01:23:01 -08:00
Fabio Baltieri
a2e5bd1928 yamllint: fix all yamllint comments errors
Fix all hyphens errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(comments)'

Default config would be to require two spaces after the start of the
comment, proposing to keep it on 1, inline with the Linux binding
config, that is:

```
-  comments:
-    min-spaces-from-content: 1
```

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Anas Nashif
ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Adrian Warecki
aac03280ec dma: dts: Rename of the dma_buf_alignment to dma-buf-addr-alignment
Renamed the dma-buf-alignment field to a more explicit
and descriptive name dma-buf-addr-alignment.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-11-23 15:36:31 -05:00
Kumar Gala
ba0617417a tests: intel_adsp: smoke: Convert CONFIG_MP_NUM_CPUS handling
Move runtime checks to use arch_num_cpus().  This is to allow runtime
determination of the number of CPUs in the future.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-27 09:54:22 -04:00
Kumar Gala
a1195ae39b smp: Move for loops to use arch_num_cpus instead of CONFIG_MP_NUM_CPUS
Change for loops of the form:

for (i = 0; i < CONFIG_MP_NUM_CPUS; i++)
   ...

to

unsigned int num_cpus = arch_num_cpus();
for (i = 0; i < num_cpus; i++)
   ...

We do the call outside of the for loop so that it only happens once,
rather than on every iteration.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-21 13:14:58 +02:00
Andrey Borisovich
56e1c5061d soc: ace: add external IPC completion to ipc done handler
Sometimes IPC message acknowledgement should be done by external
code to provide sufficient timing (example assemble code related
to powering down). Added bool return type to ipc message done handler
that if callback function returns true, IPC API skips writing
IPC message completion bits.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-10-20 18:52:42 -04:00
Kumar Gala
4f0166088c tests: move to using CONFIG_MP_MAX_NUM_CPUS
For tests that set CONFIG_MP_NUM_CPUS, switch to using
CONFIG_MP_MAX_NUM_CPUS instead as we work to phase out
CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-20 22:04:10 +09:00
Gerard Marull-Paretas
178bdc4afc include: add missing zephyr/irq.h include
Change automated searching for files using "IRQ_CONNECT()" API not
including <zephyr/irq.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-17 22:57:39 +09:00
Kumar Gala
c778eb2a56 smp: Move arrays to use CONFIG_MP_MAX_NUM_CPUS
Move to use CONFIG_MP_MAX_NUM_CPUS for array size declarations instead
of CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-17 14:40:12 +09:00
Andrei Emeltchenko
98580f1c22 tests: espressif_esp32: Fix docs generation issue
Fixes following bug:
...
Warning, treated as error:
../espressif_esp32/cache_coex/README.rst:4:Title underline too short.
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-10-08 18:33:21 +02:00
Daniel Leung
ff46de7838 tests: intel_adsp/smoke: wait longer for sched IPI
This lengthens the CPU_IPI_DELAY as some hardware require
a bit more time for IDC to propagate.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-10-07 18:12:34 -04:00
Ederson de Souza
0e6aee3479 tests/boards/intel_adsp: Add cache related tests
Tests that exercise z_xtensa_cache_[flush|inv|flush_inv]_all()
functions.

These tests are at board level because what is mapped into memory is
SoC/board dependent - no one wants side effects due writing to some
inappropriate address.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-10-07 17:48:39 -04:00
Andrei Emeltchenko
5d2d1fba86 doc: tests: trivial: Add missing line
Fix README.rst.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-10-05 12:02:17 +00:00
Hu Zhenyu
59bc1c52a5 tests: Enable the pca9555 chip on mec172xevb_assy6906
Enable the pca9555 chip on mec172xevb to test the I2C function
1. Add tests/boards/mec172xevb_assy6906/i2c_api
2. The HW connections are described in README.txt
3. Use I2C01 to connect the PCA9555, as I2C00 is for UART2

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-09-13 08:54:25 +00:00
Tom Burdick
9b3a2f1938 tests: hda_log: Increase timeout for testing
The tests can take a bit of time as they try and work with real world
buffer settings and excercise wrapping the ring buffer many times. It's
important to do this as the padding and wrapping code may have sharp
edges that are better caught in a test.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-09-12 15:57:57 -04:00
Michał Barnaś
dae8efa692 ztest: remove the obsolete NULL appended to zassert macros
This commit removes the usage of NULL parameter as message in
zassert_* macros after making it optional

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Ederson de Souza
68e8eddca6 tests/boards/intel_adsp: Fix SSP test build
Test wasn't building since 8dd57467c made Intel DAI SSP depend on power
management. This patch fix this by adding the required configs to the
test prj.conf.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-09-08 18:03:33 -04:00
Ederson de Souza
578e8ee964 soc/xtensa/intel_adsp/cavs: Fix CPU sporadically not idling
Sometimes, on CAVS 25, the CPU may fail to idle. This was due a failure
during test initialisation - the test is supposed to run from CPU0, and
halt and restart the other ones. However, code to pin thread to CPU was
incorrect - a running thread can't be pinned to a CPU (the
k_thread_cpu_mask* calls were returning error).

This patch solves this by creating a thread that is pinned to CPU0
before it is run.

While at it, add some more checks for returned values.

Fixes: #49790

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-09-08 16:23:29 -04:00
Tom Burdick
54474510b3 logging: adsp hda backend refinements and additional test
Additional testing showed that when using printk the logger would start
sticking and spitting out nulls which is wrong. This made it appear as if
the firmware had locked up. The issue seems to have been caused by the
initial ipc message to read all the dma buffers on the host.

Removing that, the issue seems to have been solved.

This also improves the test case to ensure printk with LOG_PRINTK=y
works as expected. It also adds a last log message between some
timeouts of the flush timer length to ensure the padding and timer
flush are working properly.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-09-07 20:27:44 -04:00
Gerard Marull-Paretas
79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Enjia Mai
633db922c9 tests: boards: mec15: move the qspi test to new ztest API
Migrate the testsuite tests/boards/mec15xxevb_assy6853/qspi
to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-05 10:16:18 +02:00
Enjia Mai
152190ad61 tests: boards: mec15: move the i2c test to new ztest API
Migrate the testsuite tests/boards/mec15xxevb_assy6853/i2c_api
to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-05 10:16:18 +02:00
Andrey Borisovich
2e04bfdfe0 soc: intel_adsp: Refactored IPC/IDC
Changes to code:
1. Renamed CAVS_IPC API from common/include/cavs_ipc.h to
common/include/intel_adsp_ipc.h. Renamed all API functions and structs -
added "intel_adsp_" prefix.
2. Moved definitions from intel-ipc-regs.h and ace-ipc-regs.g to SOC
specific headers include/<soc_name>/adsp_ipc_regs.h.
3. Added new common intel_adsp_ipc_devtree.h header with new
macros to retrieve IPC and IDC nodes and register addresses.
Put those new macros in code replacing hardcoded values outside of
devicetree.
4. Changed documentation of IDC and renamed IDC register struct
to have common name between all intel adsp socs.
5. Removed excessive docs description on cAVS IPC protocol.

Changes to Devicetree:
1. Renamed in all CAVS boards .dtsi files content in IPC nodes:
   - "cavs_host_ipc" node labels to "adsp_ipc" labels.
   - compatible "intel,cavs-host-ipc" renamed to
     "intel,adsp-host-ipc".
2. Added (previously missing) yaml file for "intel,adsp-host-ipc"
   compatible.
3. Renamed in all CAVS boards .dtsi files content in IDC nodes:
   - "idc" node labels to "adsp_idc" labels.
   - compatible "intel,cavs-idc" renamed to "intel-adsp-idc"
4. Renamed intel,cavs_idc.yaml file to intel,adsp_idc.yaml
   so it is suitable for both CAVS and ACE SoC family.
   Moved it from ipm bindings to ipc bindings where it belongs.

Changes to Kconfig:
1. Renamed existing Kconfig option CONFIG_CAVS_IPC to
   INTEL_ADSP_IPC.
2. For renamed INTEL_ADSP_IPC addded default value based on
   status of the "adsp-ipc" and "adsp-ipc" node.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-09-02 08:18:32 -04:00
Tom Burdick
3a4864bdd2 logging: adsp hda backend improvements
* Adds a default hook and init function for cavstool.
* Adds an optional padding on flush feature to ensure all data is written.
* Fixes an error in cavstool.py for correctly wrapping the ring buffer.
* The test case now ensures wraps and flushes occur numerous times.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-08-26 21:33:10 -04:00
Kumar Gala
05faddc923 dma: remove defconfig/proj setting of DMA drivers
Now that DMA drivers are enabled based on devicetree we can
remove any cases of them getting enabled by *.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-26 14:27:23 +00:00
Enjia Mai
8ae7fd7bd9 tests: board: esp32: move the cache_coex test to new ztest API
Migrate the testsuite tests/boards/espressif_esp32/cache_coex/
to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-26 14:27:12 +00:00
Enjia Mai
4f3761cb8d tests: boards: altera_max10: move the sysid test to new ztest API
Migrate the testsuite tests/boards/altera_max10/sysid to
the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-23 14:41:44 +00:00
Enjia Mai
5c8080285e tests: boards: altera_max10: move the qspi test to new ztest API
Migrate the testsuite tests/boards/altera_max10/qspi to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-23 14:41:44 +00:00
Enjia Mai
4be4376bc4 tests: boards: altera_max10: move the msg dma test to new ztest API
Migrate the testsuite tests/boards/altera_max10/msgdma to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-23 14:41:44 +00:00
Enjia Mai
ba0e277da2 tests: boards: altera_max10: move the i2c test to new ztest API
Migrate the testsuite tests/boards/altera_max10/i2c_master to
the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-23 14:41:44 +00:00
Enjia Mai
8dc769d64c tests: boards: native_posix: move the test cpu_wait to new ztest API
Migrate the testsuite tests/boards/native_posix/cpu_wait to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-23 16:22:19 +02:00