This patch adds the initialization to testbench start code. Without
it the notification from buffer consume/produce causes segfault.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The change adds power gating of unused memory banks for cavs 2.0/2.5
hardware on top of previously enabled flow for cavs 1.8.
Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
Boot loader code was modified to more readable by renaming functions that
are used to actually power up memory banks during memory initialization
routine.
Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
wm8960 codec drivers the master clock and for s24le we cannot easily
derive the bitclk.
So, switch to s32le. SAI supports s32le format. The initial s23le was
added because topology was based on sof-imx8qxp-cs42888.m4 which uses
ESAI and that's limited to s24le.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
For now we are using generic simple-card as a machine driver, and
the DAI name must follow certain pattern <dai-name>-<codec-name>.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Platforms with cAVS version 1.8 & 2.0 have hardware requirement that
DSP should use LPRO as clock source in waiti.
This patch adds config for that and enables it for platforms that
need it.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
On some platforms there is a need to perform tasks after
coming back from waiti.
There is no central interrupts processing function in SOF.
Every interrupt is registered separaterly, so we need to execute
'wake up' functions in xtos interrupts handlers.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Add freq indexes for LPRO and HPRO, to be able to request
clock source by providing specific frequency index
instead of frequency in Hz.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Add support for a simple IPC polling API that will allow clients to
poll IPC messages and status. This is runtime mutually exclusive to
the default IPC IRQ mode.
IPC polling mode is only intended for certain use case where simplicity
or reduced footprint are required like GDB stub and bootloader stub users.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Trace entry fields for IDs may be used by dai traces
for type and index to track down each trace entry to
a specific dai instance.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Since this is the code of 'dai component', the trace macros
are renamed to avoid collisions with names of 'dai'
(ssp, dmic, ...) trace macros.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
This patch corrects the shown parameters orders for help text
and updates the copyright text style.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes a mistake that forces generation of rate into
fs_inout matrix diagonal. The purpose of this test is to enable
SRC to pass equal input and output rate, so in case not equal
input and output rates the generator would not disable such
conversion if requested.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Dispel possible doubts about content of struct fields by adding
descriptive comment to each one.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Field frame_fmt is treated as sof_ipc_frame in code so data type
in declaration should be same. Update field comment to be more
appropriate with new data type.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
During working with algorithms on special data types there may be need
to convert and store input samples before algorithm run in temporary
buffer. Same situation may happen on the algorithm output.
Size of this buffer may be big enougth to always convert source
data stream in one pass and converter interface doesn't need to be
changed but then capacity of this buffer must be same as source stream
(in samples). In this scenario memory management is very inefficient,
espially with grow of number of components with such a need.
There are also a few solution to use smaller buffers instead.
It can by achieved by:
1) manually moving r_ptr in source stream in component copy() routine,
what shouldn't happen in such a place
2) calling buffer_consume() after each portion of samples, what leads
to data fragmentation and performance issues
3) introducing offset argument in converter interface
As we can see, solution number 3 is best one.
Moreover introducing data offset for processing function is common
technique and doesn't introduce visible performance issues.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Implements new platform specific method, which allows for
retrieving linked list item from memory. The best example
are cAVS platforms, which need read it through uncached
memory region. Rest of the platforms currently don't need
the implementation, since they don't support hardware linked list.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Extracts mailbox_sw_reg_write() function to platform specific code.
For cAVS platforms we want to have it go through uncached memory
region, which can be unavailable on other platforms.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
GCC 9.x introduces checks for packed data alignment when being passed or
cast as different types.
Add an alignment macro so that we can tell GCC that packed data alignment
is assumed to be valid for certain casts.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
GCC 9.x introduces checks for packed data alignment when being passed or
cast as different types.
Pass LLI by pointer instead of SAR* and DAR* which results in packed
alignment error.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Probes are a feature that will allow user to extract and inject data
from/into buffers at runtime.
Basic flow is as follows:
1. Initialization of probes subsystem, allowing for simultaneous
configuration of DMA for extraction. If extraction DMA is not setup
during init, extraction probes will be disabled.
2. Configuration of probe points, preceded by DMA configuration in case
of injection probes.
3. Probes are now in operation and will send single multiplexed stream from
extraction probe points and inject data into specified buffers.
4. State of probes and associated DMAs may be retrieved via INFO functions.
5. Removal of probe points.
6. Removal of injection DMAs.
7. Deinitialization of probes subsystem.
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
This commit introduces proper calculation of buffered_data,
which should not exceed buffer_size value. Firstly, we calculate
free space in history buffer and we add minimum value from
copy_bytes and hb_free_space.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This patch adds the missing use and initialization of ASRC for
pull mode. Pull mode is used typically in audio capture where
the DAI is not synchronous with rest of SOF. The previous version
used push mode for both plaback and capture that can work only with
a synchronous DAI.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
While the functions were unused I missed to name them properly. With
the prefix the names are consistent with push mode functions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds two new test topologies. One is for testing ASRC
timestamp retrieving from HDA and one for WM8804 slave SSP interface
for APL. It is useful with UP^2 board with HiFiBerry Digi+ SPDIF
interface.
The asynchronous mode token is switched on in ASRC capture and
playback pipelines. It switches on DAI skew tracking feature
in ASRC.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the DAI skew tracking and filtering to fine
adjust the conversion factor of the ASRC. The ASRC finds the
pipeline DAI from downstream in push mode (playback) and from
upstream in pull mode (capture).
To avoid code hang to infinite loop the modification to asrc_farrow.c
adds a safe bail out if skew factor related number of samples to
compute exceeds buffer space. The streaming continues but there
can be a glitch in audio if the skew is bad enough to exceed the
buffer margin. The error trace helps to see if such can happen in
real use cases.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to the DAI component new operations dai_ts_config(),
dai_ts_start/stop(), and dai_ts_get() to support timestamp retrieving
from audio interface hardware for use of other components, especially
in the asynchronous sample rate converter.
The support for HW timestamps is enabled in Intel cAVS HW drivers for
SSP (I2S), HDA, and DMIC.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Up^2 boards have a DMIC connector. Add support for such DMIC add-on
boards. Also adjust iDisp interface DAI IDs to match the new
sof_pcm512x.c Linux machine driver.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
HiFiBerry DAC+ADC codec card also contains a line-in jack for analog
audio recording. This patch adds support for it.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Removes no longer needed code, which was used in previous
implementation of SMP. With the latest implementation we are
going full SMP, so every core creates and configures its
own components. We no longer need to control cache in order
to synchronize data between cores.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Moves notifier_register and notifier_unregister calls to original
valid locations. It has been moved previously to comp_trigger due
to the specific implementation of SMP. Now they can be moved back,
since every component is created on dedicated core.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
DMA channel's private data and also DMIC's private data no longer
need to be allocated as shared. They're only owned by one core at
a time and holds data valid for this particular run.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes data cache line size alignment for active_cores_mask.
They are accessed only by master core and with shared data
implementation there is no risk of random data overwrite
in bss.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Writebacks pointer to sof context instead of the whole bss.
Every call to global structures is now going through this pointer
and static global data is implicitly shared.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Checks what core should process current IPC message
and forwards it to given core. Every component, buffer
and pipeline are created directly on the chosen core,
so we have full SMP now. DAI config checks whether
there are matching components on all the cores and
redirects IPC accordingly.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds pointer to mn struct to sof context. Also implements
getter, so it can be retrieved through one point of access.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements new IDC message for IPC processing.
From now on master core can pass IPC message to be processed
on chosen slave core. Slave core is also responsible for
sending IPC reply.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>