Commit graph

210 commits

Author SHA1 Message Date
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
Enjia Mai b5679278d4 tests: boards: native_posix: move the test rtc to new ztest API
Migrate the testsuite tests/boards/native_posix/rtc to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-23 16:22:19 +02:00
Enjia Mai 81311a0b02 tests: boards: intel_adsp: move the hda test to new ztest API
Migrate the testsuite tests/boards/intel_adsp/hda to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-22 16:37:25 +00:00
Enjia Mai fab3438556 tests: boards: intel_adsp: move the hda_log test to new ztest API
Migrate the testsuite tests/boards/intel_adsp/hda_log to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-22 16:37:25 +00:00
Enjia Mai aa95e4e051 tests: boards: intel_adsp: move the smoke test to new ztest API
Migrate the testsuite tests/boards/intel_adsp/smoke to the new
ztest API.

Also splitting them into 2 test suites can be run independently.
But the boot test has a strict order so we changed the name of
the test cases to keep them running in a specified order.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-22 16:37:25 +00:00
Enjia Mai 6db5e59af2 tests: boards: intel_adsp: move the ssp test to new ztest API
Migrate the testsuite tests/boards/intel_adsp/ssp to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-22 16:37:25 +00:00
Enjia Mai c895d33ebf tests: boards: intel_adsp: move the mm test to new ztest API
Migrate the testsuite tests/boards/intel_adsp/mm to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-22 16:37:25 +00:00
Gerard Marull-Paretas a202341958 devices: constify device pointers initialized at compile time
Many device pointers are initialized at compile and never changed. This
means that the device pointer can be constified (immutable).

Automated using:

```
perl -i -pe 's/const struct device \*(?!const)(.*)= DEVICE/const struct
device *const $1= DEVICE/g' **/*.c
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-22 17:08:26 +02:00
Gerard Marull-Paretas e0125d04af devices: constify statically initialized device pointers
It is frequent to find variable definitions like this:

```c
static const struct device *dev = DEVICE_DT_GET(...)
```

That is, module level variables that are statically initialized with a
device reference. Such value is, in most cases, never changed meaning
the variable can also be declared as const (immutable). This patch
constifies all such cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas 979fcc6fe8 tests: boards: intel_adsp: initialize devices at compile time
Initialize devices at compile time so that pointer can be constified.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas 305c5a4c28 tests: boards: mec15xxevb_assy6853: initialize device at compile time
Initialize SPI at compile time, allowing to constify the device pointer.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Tom Burdick efc0928570 dma/hda: Use the correct register block size for each IP block
Previous versions were using, incorrectly, the host in/out regblock size
of 40 bytes for all peripherals when in fact the link in/out regblock size
is 20 bytes in size.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-08-18 14:54:57 -05:00
Katarzyna Giadla eae01f0fc5 samples: tests: Rename duplicated testcases
Names of some testcases are duplicated in another files.
This change rename duplicated testcases.

Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
2022-08-17 12:11:00 +02:00
Kumar Gala 78745b2de9 flash: nios2_qspi: Convert driver to be devicetree based
Do simple conversion of driver to have driver enabled by devicetree
in Kconfig and struct device created based on basic devicetree
data.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-12 08:11:42 -04:00
Tom Burdick 88de59043f tests: boards: frdm_k64f i2c test against fxos8700
Adds a simple test case against the FXOS8700 sensor and its
built in FIFO using i2c. Pulls data from the sensor using both
synchronous and asynchronous transfers.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-08-11 14:12:13 -04: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
Kumar Gala 4d49ba67b5 i2c: remove defconfig/proj setting of I2C drivers
Now that I2C drivers are enabled based on devicetree we can remove
any cases of them getting enabled by *defconfig and proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-01 18:01:44 +02:00
Kumar Gala 71691e8533 tests: intel_adsp: Convert to test to use use DEVICE_DT_GET_ONE
Update test to use DEVICE_DT_GET_ONE to remove usage of
device_get_binding.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 14:31:08 +00:00
Anas Nashif 43371d0414 intel_adsp: move cavs to be a series
Intel ADSP CAVS is now a proper series with all CAVS SoCs running under
it. This will give us to Intel ADSP series:
- CAVS
- ACE v1.x

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-25 16:50:24 -04:00