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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>