Commit Graph

152 Commits

Author SHA1 Message Date
Tom Burdick 88ca215eed i2c: Update API terminology
Updates the API and types to match updated I2C terminology. Replaces master
with controller and slave with target.

Updates all drivers to match the changed macros, types, and API signatures.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-06-29 17:51:31 +02:00
Ederson de Souza d497cca845 tests/boards/intel_adsp/smoke: Wait for host script to be ready
These tests work in tandem with the cavstool.py script: the script
receives IPC messages and properly acts on them. However, it may take
some time to the script execution arrive at the point in which it's
ready to receive incoming messages. This patch makes the test code wait
some arbitrary time to allow the script to reach the desired state.

Note that another IPC message could be used to this end, but since some
tests are actually testing the IPC mechanism, it seems unwise to assume
IPC works for set up steps.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-06-28 14:56:57 -04:00
Tom Burdick 81f3803927 dma: HDA DMA API test use alignment property
Use the DMA_BUF_ALIGNMENT macro and property in the hda test case.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-06-27 12:46:11 +02:00
Tom Burdick 1b1f0bb12b dma: HDA smoke test buffer alignment from DTS
Use the device tree defined buffer alignment for the smoke test.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-06-27 12:46:11 +02:00
Gerard Marull-Paretas 74ed64139c tests: remove redundant <zephyr/zephyr.h> includes
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:13:11 +02:00
Anas Nashif 411a91902f tests: remove intel_s1000_crb tests
Remove all tests specific to the intel_s1000_crb board.
The board is no longer supported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-13 16:19:51 -04:00
Andy Ross 5139d052d8 tests/intel_adsp/smoke: Revert WAIT_FOR breakage
The evolution of the original WAIT_FOR trick in this test, first to
move it to a generic spot and then to make it take a delay
paramatrization, have had the unfortunate side effect of breaking the
original usage.

And... it's really not following the design intent anyway.  The idea
here was to spin hard waiting on external hardware (a python script
running on the host) to deliver an interrupt.  Both of the new tricks
(suspending the thread with a sleep and hammering the HDA wall clock
for time) can affect interrupt delivery.

Just restore the original implementation (albeit with a new name,
"AWAIT", since the original was stolen) until someone has a chance to
make this work properly with the new API.  There's no reason it can't,
it just doesn't yet.

Fixes #43828

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-06-07 18:58:00 +02:00
Ederson de Souza 3209bc1a4a soc/xtensa/intel_adsp/tools: Make cavstool.py DSP resetting more stable
When using more than one core on cavs25, some hangs were made
"persistent", as it seems not all cores were being properly reset, thus
compromising tests - if a test hangs for any reason, subsequent tests
that were not restrict to a single CPU would also fail.

This patch mitigates these issues by two changes:
  - Closely mimics SOF Linux driver way of loading the firmware. So,
    explicit stall and reset (and "unstall" and "unreset") of cores, with
    appropriate checks that states have been reached;
  - More generous sleep before resetting the stream.

Also, the status of ADSPCS (Audio DSP Control and Status) register is
logged more thoroughly to aid debugging in case new issues arise.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-06-07 11:51:37 +02:00
Fabio Baltieri e24314f10f include: add more missing zephyr/ prefixes
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 15:20:27 -07:00
Tom Burdick 012836aeef tests: hda_log: cav15 timeout fixes
Fixes issues caused by the hda_log test for cavs15 caused by ipc
messaging issues. Wait for the ipc message to complete immediately after
sending it.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-05-17 11:12:57 -05: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
Maureen Helm f4a0854481 drivers: dai: Use dt_compat_enabled for Intel SSP driver default
Enables the Intel SSP driver by default when the DAI driver class is
enabled (CONFIG_DAI=y) and a compatible devicetree node
("intel,ssp-dai") is enabled.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-05-06 11:32:04 +02:00
Tom Burdick 6913da9ddd logging: cAVS HDA based logger
Adds a log backend that maintains a ringbuffer in coordination
with cAVS HDA.

The DMA channel is expected to be given some time after the logger
starts so a seperate step to initialize the dma channel is required.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-05-04 18:56:13 -04:00
Maureen Helm 5769dffc01 drivers: mm: Use dt_compat_enabled for Intel ADSP TLB driver default
Enables the Intel TLB driver by default when the MM driver class is
enabled (CONFIG_MM_DRV=y) and a compatible devicetree node
("intel,adsp-tlb") is enabled.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-04-25 11:41:31 -07:00
Tom Burdick 2f320730a1 dma/cavs_hda: Adds link in/link out compatibles
Adds hda link in and out drivers. The link in and link
out channels of HDA have small differences
with the host channels. Updates the existing
cavs_hda drivers and code to account for these
differences.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-18 19:19:40 -04:00
Jaska Uimonen 03e335ca6a tests: drivers: ssp: add ssp dai tests
Add tests for Intel dai ssp driver. These tests configure
the ssp driver and transfer data over loopback with dma.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-04-14 11:42:08 -04:00
Jaska Uimonen 8d38b64fdc drivers: dai: add dai driver subdir and ssp driver
Add Intel ssp driver using dai interface.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-04-14 11:42:08 -04:00
Yuval Peress 5416abfe5f util: convert wait_for macro to uppercase
This macro conflicts with C++'s std::condition_variable::wait_for
and makes it very difficult to use Zephyr with C++. Replace it with
an all uppercase name which fits the naming standard better.

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-04 09:50:28 -05:00
Tom Burdick 602ef3fb0e soc/intel_adsp: Require definitions for cavs_hda.h
Rather than defining them in the header, require a set of defines
be provided to cavs_hda.h as part of the expected input to the API.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Tom Burdick e018a3dff7 dma/cavs_hda: DMA driver for HDA on cAVS
Adds an initial driver for HDA streams on cAVS. A common code base is
provided for all HDA streams while the drivers are identified
differently as they have small behavior differences.

Uses dma_status to describe the positions for read/write. Uses dma_reload
to inform when to move the read/write positions. This closely follows
how HDA is being used in SoF

Simple test case is provided for both drivers.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Tom Burdick cc6e9c094a soc/intel_adsp: Low level HDA driver and tests
Adds a header only low level driver for HDA streams along with smoke
tests to ensure basic host in and out stream functionality.

The tests require host side interaction. In cavstool a new HDAStream
class encapsulates somewhat a single stream and its registers. This
is manipulated in the tests using IPC with the Host ensuring that a
specific order of operations is done.

This low level driver allows testing certain hardware configurations
and flows with easy to use register dump debugging. It is not
intended to be the end API an application might use. That would be
a DMA driver using this.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Tom Burdick 345a536794 soc/intel_adsp: common testing code in cavstool.h
The IPC enum definition and WAIT_FOR macro are useful outside of
the board smoke tests for intel_adsp. They can be commonly used
by other board tests for a variety of peripherals that require
DSP and Host interaction (using cavstool).

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Gerard Marull-Paretas 2925ecc935 tests: boards: espressif_esp32: cache_coex: use DEVICE_DT_GET
The flash controller can be obtained at compile time using
DEVICE_DT_GET. In this case, the device is not optional since tests fail
without it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-31 13:55:10 +02:00
Emil Gydesen ae55dae454 sys: util: Change return type of ARRAY_SIZE to size_t
The ARRAY_SIZE macro uses sizeof and thus the return
type should be an unsigned value. size_t is typically
the type used for sizeof and fits well for the
ARRAY_SIZE macro as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-23 14:09:23 +01:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Tom Burdick c3c6bf9f2a tests/boards/intel_adsp: CPU halt timeout test fix
Smoke test was timing out in a WAIT_FOR macro on my up xtreme tgl board.
Enabling this sleep fixes it.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-03-07 12:00:23 -05:00
Andy Ross fd929f5190 tests/boards/intel_adsp: Add ipm_cavs_host test
Add a fairly simple test of the IPM-over-IPC driver.  This hits all
the code, but works by implementing the host side of the protocol
partially in the C test code.  The message is sent with an initial
payload, and then IPC commands from the firmware copy the data over
into the "inbox" region to simulate data being sent via the host.
Then we make sure it lands correctly as if the host driver had done it
directly.

This requries a new command in the cavstool script that will copy a
word from the "outbox" region to the "inbox" region (both are just
different SRAM windows, conceptually no different than the way the
script is already managing log output), but no significant surgery.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-01 09:59:15 -05:00
Andy Ross 3da9c9213e tests/intel_adsp: Add clock calibration test
Now that we have easy access to code on the host, it's trivial to
check the clock against host timestamps with high precision.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-01 09:59:15 -05:00
Andy Ross 45242d9214 tests/intel_adsp: MP core power fixups for older cAVS platforms
On cAVS before 2.5, core power was controlled by the host.  Add a
command to the cavstool.py script to allow us to do that under test
command so we can exercise multiprocessor startup/shutdown outside of
SOF.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-01 09:59:15 -05:00
Andy Ross 438219c466 tests/intel_adsp: Force cpu_halt case to run on CPU 0
This test obviously only works correctly if it's run from core 0 (the
only CPU that doesn't shut down).  It was true essentially by
accident, but add some cpu_mask trickery to force things.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-01 09:59:15 -05:00
Andy Ross ae499454a1 tests/intel_adsp: Move IPC commands into shared header
It's useful for tests other than the IPC case to be able to
communicate with the script on the host, so generalize the interface
and move it to tests.h.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-01 09:59:15 -05:00
Andy Ross 4d4687dfe1 tests/boards/intel_adsp/smoke: Add cpu halt/restart case
Add code to exercise soc_adsp_halt_cpu() and validate the cores can be
restarted with the kernel z_smp_start_cpu() API.

Note that this interface is for 1.8+ devices only.  On cAVS 1.5, the
core power is actually controlled by the host.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-01 09:59:15 -05:00
Andy Ross 0fb42d84c7 tests/boards/intel_adsp/smoke: Add board hardware features smoke test
These are descended from a private collection of test rigs I've been
semi-curating.  Getting cache, clock and memory space setup consistent
is mildly complicated on these devices and we've had bugs in all these
areas.

+ Check cache/uncache memory space setup, and make sure that the
  incoherent cache is operating as expected.

+ Make sure all cores agree with clocking setup.

+ Quickly benchmark a two-instruction loop to detect messups with
  instruction caching.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-01 09:59:15 -05:00
Andy Ross 318aecb86f tests/boards: Add intel_adsp board integration/smoke test
As Zephyr begins to absorb drivers for these platforms that had
previously been managed by the SOF app, there's a need for a rapid
board-specific smoke test to use during development.

This starts with the smp_boot_delay test (itself a unit test for a
SOF-derived feature) and adds a host IPC case (that needs to match
code in cavstool.py on the other side of the PCI bus!).

It will grow more features over time as needed.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-01 09:59:15 -05:00
Gerard Marull-Paretas aa660bf7b3 tests: boards: intel_s1000_crb: fix k_sleep arguments
k_sleep was still called with integer arguments, however, an initialized
k_timeout_t is expected. Use K_MSEC for that.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-31 15:25:42 -05:00
Andy Ross 96b4a86a51 test: boards/intel_adsp: Add test of adsp_mem API
Add a simple board-specific test of the memory mapping driver.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-18 19:18:30 -05:00
Tomasz Bursztyka f6be2835bd drivers: Apply SPI API change to relevant places
Mostly drivers, but also one sample and one test.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-19 11:50:38 +01: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
Martí Bolívar bcf8e560c5 dts: rename 'nios2,i2c' compatible to 'altr,nios2-i2c'
The original NIOS-II developer and former vendor is Altera, which is
now part of Intel. Let's not add a new vendor prefix for something
that already exists and has been acquired; move it to use the existing
'altr,' prefix instead.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-17 17:51:57 -04:00
Johann Fischer 3240e0cc51 tests: remove USB configuration option
Remove USB configuration option, replace it where necessary
with USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Anas Nashif aaae4e5d07 tests: ivshmem: move test to more generic location
Make this test part of drivers rather than have it be board specific
with the hope that we can add more tests and configurations supported in
the future.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-19 11:38:59 -04:00
Glauber Maroto Ferreira ee6b33feeb esp32: cache: test: add Flash/SPIRAM cache test
Add SPI Flash/SPI RAM coexistence test.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-06-29 11:32:32 -04:00
Johann Fischer 1787644930 tests: intel_s1000_crb: remove unused and wrong implemented callbacks
This test has implemented USB HID class callbacks that
actually have no function and should not return 0.
Remove unused and wrong implemented callbacks.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-20 15:06:35 +02:00
Andrzej Puzdrowski 53f9a931f4 tests/tree-wide: remove flash_write_protection_set() usage
flash_write_protection_set() was deprecated.
This patch removes usage of it.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-03-29 13:43:55 -04:00
Andrzej Puzdrowski c603641eb5 tests/boards/altera_max10/qspi: remove flash_write_protection_set() usage
This patch removes scenario which was testing deprecated
API behaviors. Needed as As flash_write_protection_set() was
deprecated and became no-operation.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-03-29 13:43:55 -04:00
peng1 chen e31547dc96 qspi_testcase: modify the value used to check whether qspi is enabled
if qspi mode is enabled, the status register will be like xxxxxx1x,
so we should compare with value 2 to check whether qspi mode
is enabled successfully.

Signed-off-by: peng1 chen <peng1.chen@intel.com>
2021-03-10 14:26:00 -05:00
Andy Ross 64cf33952d arch/xtensa: Add non-HAL caching primitives
The Xtensa L1 cache layer has straightforward semantics accessible via
single-instructions that operate on cache lines via physical
addresses.  These are very amenable to inlining.

Unfortunately the Xtensa HAL layer requires function calls to do this,
leading to significant code waste at the calling site, an extra frame
on the stack and needless runtime instructions for situations where
the call is over a constant region that could elide the loop.  This is
made even worse because the HAL library is not built with
-ffunction-sections, so pulling in even one of these tiny cache
functions has the effect of importing a 1500-byte object file into the
link!

Add our own tiny cache layer to include/arch/xtensa/cache.h and use
that instead.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 11:14:27 -05:00
Kumar Gala 403e6e3517 drivers: i2c: nios2: get IRQ and IRQ priority from DTS
Move the I2C IRQ information to devicetree similar to what most all
other drivers are doing.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-03 11:55:03 -06:00
Kumar Gala b60b4be4e3 drivers: dma: nios2_msgdma: Conver to devicetree
Conver the NIOS-II mSGDMA driver to be devicetree based.  Add node for
dma controller into nios2f.dtsi.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-02 08:36:58 -06:00
Kumar Gala 345c9c0acc tests: intel_s1000_crb: Convert dma to use DEVICE_DT_GET
Convert how the dma test gets the dma device to use DEVICE_DT_GET
and remove use of CONFIG_DMA_0_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-01 15:14:35 -05:00