This separation breaks a cyclic dependency between <sof/spinlock.h> and
<sof/drivers/interrupt.h> (which wasn't visible before).
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Recent changes in the tracing system removed the trace_value function
for it being not verbose enough to be helpful for debug. This hasn't
been caught due to debug not being tested in SOF CI.
This patch replaces this with trace_lock_error or trace_lock calls, and
adjusts the macros to support this replacement.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Moves sof structure initialization to master core to avoid
data being overwritten by slave cores in case of future use.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Makes schedulers and scheduling domains ops constant and effectively
puts them in rodata segment.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Fixes modulo bug in get_ptr_from_heap function,
where alignment can potentially be 0. Modulo zero
is undefined operation.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch changes usage of notifier, passing control over callbacks
allocation, allows nested callbacks processing and prepares interface
for future extenting.
This also optimizes unnecessary cache writeback/invalidation when
evaluating callback on the same core it was dispatched.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Increase amount of 64B-sized blocks on sys runtime heap in preparation
for increased usage by callback handles allocated by notifier.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Invalidates memory regions, which are requested to be uncached.
This way we can make sure we won't overwrite data by accident.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
On some platforms clocks may not be switched instantly and f.e.
there may be need to wait for clock availability before switching to it.
That's why there is need for mask that is used for checking status.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
DMA trace is supported since this platform has a working host DMA. This
patch enables it for this platform.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Fetches channels and frame_fmt from sink buffer (sink
buffer params are set in pipeline_set_params()
before mux_params()).
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Fetches frame bytes from sink buffer (sink buffer params
are set in pipeline_set_params() before mixer_params()).
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
A new config option allows to select between the default
ring oscillator used to clock the dsp core and memory
on Intel Cannonlake platform.
CANNONLAKE_LPRO sets the default clock to 120MHz low power
oscillator, otherwise 400MHz oscillator is used.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
The assumption is that load_mips equals MCPS (million cycles per second).
Then only a fraction of MCPS has to be consumed for each processing frame
depending on a frame length and a sampling rate.
Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
Moving pcm params from component to buffer is the first
step to improve parameter propagation within pipelines. This commit
moves several pcm paremeters (framet_fmt, buffer_fmt, rate,
channels, chmap, except direction) to comp_buffer struct.
Some of specific parameters are moved to private host and
kpb data.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This patch adds the ASRC component and the new tokens into topology
parser and testbench component loader.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds a single 4 kB space for allocation. The 2 kB space
is added as well but configured to zero available. The ASRC typically
needs 2 - 4 kBytes of dynamically allocated storage.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the new ASRC feature to SOF. It supports both
optimized HiFi3 build with xt-xcc and generic C version for
gcc build. The generic C version is currently feasible only
for testbench run due lack of sufficient speed for realtime but
will be optimized later.
The feature is disabled by default for BYT, CHT, BDW, and HSW
platforms to save RAM.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the FIR filter coefficients and filter parameters
header files for the ASRC.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The previous version changes behavior on the BYT platform.
Fixes: ee9283c159 ("sof: lib: notifier: Do not break build on platforms
without CLK_SSP").
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Reimplements buffer_copy functions to use memcpy_s instead of
fragment API. Based on my tests it gives 20% better performance
than previous implementation. Note that memcpy_s function
uses vec_memcpy when built using XCC.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes unused code from dai_config. Frame bytes are always
calculated from scratch in dai_params, so no point in keeping
this dead code.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes processing flow and moves pcm frame format conversion
from volume to dai component. This way we'll no longer need to
artificially add volume into the pipelines, where it's not really
needed but frame format change is e.g. KPD topology. Dai is the perfect
place for conversion, since it's format is pretty much predefined and
comes from topology. Rest of the pipeline is configured from the host.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements functions for sample bytes and frame bytes calculations
based on provided frame format and channels.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
HiFi3 implementation of PCM converter is optimized to
process either two samples at once for 32 bit data or
four samples for 16 bit data.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements generic version of PCM converter library component.
This module provides static functions, which allows to copy
buffer data with frame format conversion.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes signatures of copy DMA buffer functions to differentiate
between source and sink bytes. Process function from now on will
work on provided samples to handle different formats on input and output.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
xcc build will have bigger TEXT.
Need to keep the total block size unchange as the block need to be
4k align.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
SAI hardware needs on capture side to have SYNC mode set as
'Synchronous with receiver' in order to work properly
Set this field on Capture register RCR2, transmitter side
must be configured in asynchrounous mode
Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
Compiler options has to be changed in order to compute
the literal block address correctly.
Some literals must be declared explicitly and loaded
indirectly to make sure that compiler does not optimize
the out to another shared region.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
The i.MX8 platform doesn't have an SSP clock. We had a fake define for
this platform due to prior inflexibility in SOF itself. Now that said
lack of flexibility is gone, this patch removes all such references.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Some platforms do not have a SSP clock, so a dummy define for CLK_SSP
and related macros shouldn't be required to exist in order for the
firmware to build.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
It didn't work correctly if multiple cores write to "sw regs"
allocated on the same cache line.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Enables DW-DMA channel linear link position counter based
on the selected peripheral connection. It can be used
to retrieve timestamping information on platforms supporting it.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Cleanups definitions of GPDMA shim registers for all cAVS platforms
and extends them by adding support for channel linear link position
control register.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
After disabling tracing code have compilation error because of
implicit declaration of platform_trace_point function.
After calling through trace_point it is replaced with empty
define after disabling trace.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Xtensa ABI requires the stack to always be aligned to a multiple of 16
bytes. This commit aligns the stacks used for interrupt handling.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Create abstract interface for clocks and move platform specific
clocks code to platform folders.
It was also necessary to move SSP clocks declarations to
SSP driver code to decouple clocks logic from mandatory
SSP clocks.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
The changes fix command unbalanced groupings and remove discrepancy
between parameters in function declaration & definition of
set_power_gate_for_memory_address_range() function.
Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
The description says that any LX6 Xtensa architecture revision DSP
should have this enabled, and the particular DSP in the i.MX8 does fit
this description.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
This change adds stream map and channel map structures
used for channel re-routing and stream aggregation.
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
This patch enables separate scheduling of connected
pipelines. It allows for different scheduling periods
between connected pipelines and flexible controlling
of such topologies.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Uses pipeline_task in DMA domains to check, if tasks should be even
registered on interrupts. Non registrable tasks are the one,
whose pipelines are not the owners of scheduling component e.g.
host pipelines connected to mixer pipeline. Such tasks are still
added to the scheduler's list and executed, but they are driven
by the pipelines with scheduling component.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds definition of pipeline_task. It's a task type registered
by pipelines and used in DMA scheduling domains.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes SOF_SCHEDULE_FLAG_SYNC and SOF_SCHEDULE_FLAG_ASYNC.
They are no longer used nor needed.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes ll scheduler implementation to use synchronous property
of domain to check if given task should be scheduled synchronously
or asynchronously. It makes sense, since it's heavily dependent
on particular domain functionality.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds new synchronous field to indicate if tasks registered
to this domain should be scheduled synchronously or asynchronously.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Instead of taking the name from an array of strings (which is allowed by
GCC) I compose the name directly inside the IRQSTR_CASCADE_TMPL_DECL
macro. GCC is able to detect that the name is a compile time constant
and allows the old code, XCC does not and requires this change.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
This allows the SGN macro to no longer generate a warning on the "-1"
case and thus allows building with XCC. GCC doesn't seem to care about
this one. No actual change in the logic itself.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
PADC means to have ESAI pad samples with zeros instead of sign-extending
them when they are smaller than the (32-bit) container. This doesn't
make senseon capture and indeed that specific bit is hardware reserved.
So don't use it.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Generally comment cleanups but also moving the "|" operator to be at
the end so that the various options in dai_update_bits are aligned.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
The configurations will be mostly similar to those used for playback,
but while the ESAI is master on playback it must be slave on capture
as a workaround due to hardware limitations. These differences must be
hardcoded due to the topology not specifying these configurations for
each direction of the link.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Currently this just returned a zero and wasn't able to correctly
interpret the direction of the channel.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
The direction was already configured correctly in the component during
dai_new, and the IPC data is shared for both instances of the DAI
component (playback and capture).
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Use block expression instead of do {} while(0) macro
in spin_try_lock in order to return its value in a
safer way.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
The base irq of the first created cascaded struct is currently equal to
PLATFORM_IRQ_HW_NUM, which is 32 on HIFI4.
On IMX platform the number of children per such a struct is equal to 64
(as per IMX steer IRQ mapping).
Since steer irq in range [0-63] are not routed to the DSP on IMX8 it is
possible to create the cascaded structs only from 64.
Starting them from 32 creates a bias in the management of interrupts,
making the storing of the irq-handlers un-natural and complicated.
This commit wants to replace the initialization of cascade_root.last_irq
by a new constant PLATFORM_IRQ_FIRST_CHILD which would be defined at
platform level.
In the case of IMX it takes value 0, while in all other platform it takes
the value PLATFORM_IRQ_HW_NUM in order to keep things as they are.
Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
The previously used cast of pointer to size_t (unsigned int)
has worked but it's horrible way to do it. Cast to uint8_t *
should be clean portable code.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add two parameters to comp_dev struct in order to allow
configuration of the component processing variable frames.
Added parameters are:
- min_sink_bytes - min free sink buffer size measure in bytes
required to run component's processing;
- min_source_bytes - amount of data measured in bytes
available at source buffer required to component's
processing.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This patch contains maintenance for module traces. Some redundant
traces are removed and some new traces with useful information are
added, especially if they are related to an error with configuration
request. The long trace strings are shortened to and split to
several lines at numbers print when possible.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds capability to equalizer to switch response during
audio playback or capture. The glitches are minimized by check
and apply of the filter configuration before each copy()
operation.
The existing only halfway implemented SOF_CTRL_CMD_ENUM for quick
stored presets switching during streaming is removed for now
since there is no driver support.
The internal code cleanup includes extract of two functions from
eq_iir_setup() for check and initialize of coefficients and
initialize of filter delay lines. It helps to better understand
the setup flow.
The extrapolation of channels to response assign map is changed
to use previous channel response instead of first if the stream
contains more channels than the response definition. The
procedure was changed to avoid a code static analysis issue. The
behavior is not specified so this simpler way was chosen.
To minimize number of duplicated functions in generic and HiFi3
version a new module iir_generic.c is created for the filter
core. After the change iir.c contains only the common code for
both implementations.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Use RELATIVE_FILE because __FILE__ makes binary output
dependent on project location.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Include in footprint only support for selected
data formats. It may make footprint lighter.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Include in footprint only support for selected
data formats. It may make footprint lighter.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Include in footprint only support for selected
data formats. It may make footprint lighter.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Include in footprint only support for selected
data formats. It may make footprint lighter.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Include in footprint only support for selected
data formats. It may make footprint lighter.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It will be helpful during next step - conditional code
compilation depending on configuration
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Include in footprint only support for selected
data formats. It may make footprint lighter.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Include in footprint only code needed to support selected
data formats. It may make footprint lighter.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Include in footprint only support for selected
data formats. It may make footprint lighter.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It will be helpful in next step -
- selective function compilation by
supported data type
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Compile support only for data types selected in configuration.
It may make footprint smaller.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It will be helpful in next step - conditional code compilation
according to configuration
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Use introduced configuration option in mux component to make
firmware footprint smaller.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It will be helpful during next step - conditional code
compilation depending on configuration
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It will be used to make footprint smaller by selective
compilation of supported data format in components
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
In order to avoid dead locks in dmic_work I've replaced
spin_lock() with spin_try_lock(). In case when
spin_try_lock() fails we reschedule dmic work.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Adds return to spin_try_lock() in order to retrieve status
from arch_try_lock() function.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
The test determinating the current SAI mode (M/S) was buggy.
As a consequence SAI generated bit clock and FS clock when the codec was
in master mode (which is the default configuration for SAI currently with
SOF). This bug didn't prevent the DAI to function and to have good sound.
Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
Use of low power sequencer lowers power consumption, since
DSP may be completely turned off when calling waiti and then
powered on interrupt, booting via restore vector installed in
lpsram.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
We need this in order to match the exact comment from the
similar file in the Linux kernel.
sof_ipc_effect_type was the old name of the component no longer
used now.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
It isn't necessary to do a dai_get this early for the ESAI; the SAI
doesn't even have one.
Calling dai_probe() after dai_get() is pointless since dai_probe() was
already called from a previous dai_get() with CREAT flag (in particular
the one which incremented sref from 0 to 1).
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Use optimization configs that come from Kconfig in CMake
to set appropriate compiler flags.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
SAI is one of the DAIs found on i.MX8 platforms. Introduce
sai_params used to pass configuration from topology via AP to DSP.
Only MCLK and TDM related params for now.
Because this is a new struct, increment only ABI MINOR version
which makes the SOF FW backward compatible with older kernel
versions.
Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
To repair tracev_mux_with_ids macro.
Because with current macro definition
and enabled CONFIG_TRACEV macro code won't compile.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Power control hw programming should go through the pm_runtime
interface. It provides more granular control over the power
gating of each single dsp core.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
get() operation called for dsp core resource disables
power gating of that core so it is locked in d0 state.
This is a default power state when the core is running.
put() operation enables power gating of the core, so
that the core goes to d3 every time it enters idle
(waiti is called and there is no interrupt to handle).
This handler should be called before the waiti is called
if pm-runtime for the core is enabled (see pm_runtime_enable()).
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
There might be other flows defined in future, that would
need to reprogram hw registers only while preserving
the content of memory windows.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Access to vecbase, excsave2/3/4/5 is required for saving
the dsp core context while internal d0/d3 transitions
initiated by the low power sequencer.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
This will prevent from compiler warnings when
local variables are used only in trace log and
trace is disabled.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
UNUSED macro should prevent compiler from throwing warnings
about unused wariables during conditional builds.
Usable for example in trace logs.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It was needed to define empty implementation of error and verbose
macros in two places what is not compliant with DRY methodology.
It is done by moving trace defs around, outside #if CONFIG_TRACE block.
After changes it is defined in only one place.
Also trace_*_comp should be defined once bacause it may be
independent from CONFIG_TRACE values.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Because those functions was hardly used in source code.
Moreover it is better practise to add short trace
description, at least variable name instead of trace
with only variable value.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
cavs specific set d0ix message is read directly from ipc
registers and does not use mailbox located in SRAM which is
the only safe way to send a message to the cAVS DSP when
the DSP is in a lower power state.
The message is translated to SOF_IPC_PM_PWR_GATING message.
Response always use the mailbox since there is no way to write
the *T registers back with the current bi-directional communication
implemented using a single *T register set.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
A new message that may be used by the driver to configure
power gating and clock gating using platform specific method.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Returns current config on COMP_CMD_GET_DATA. It fixes the problem
with wrong demux configuration after suspend. Kernel doesn't cache
initial kcontrol config and overwrites it with configuration returned
from component.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Since SOF requires CLK_SSP to be defined and the SSP clock should be
separate from the actual CPU clock increasing the array size to 2 should
fix it.
This is a hack because i.MX doesn't actually have a SSP clock but SOF
unconditionally uses CLK_SSP macro.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
The SAI doesn't use channel 0, but channels 14 and 15. The handshake
contains the correct channel number.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Old switch macro traces didn't have VA_ARG arguments.
It will be helpful during debugging components
to see correlated pipeline id after using with_ids macros.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Trace verbose and trace error macros positions
is swapped to be more consistent with rest of files
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
During compilation as library there was unused id_0
and id_1 in _log_message preprocessor function.
Solved by casting parameters to void type.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It makes trace macros in component space much shorter
and simpler so trace module will be more reliable.
Thanks to usage one preprocessor macro in each type of
_comp traces, code is more flexible and consistent.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Remove spinlock_init() in dw_dma_probe() function
in order to avoid memory leaks. spinlock_init() is
invoked in dmac_init() platform/*/lib/dma.c
files.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
_trace_error_atomic doesn't exist, so this commit replaces it with
what was probably intended in the first place.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
src/include/sof/schedule/ll_schedule_domain.h: In function 'domain_init':
src/include/sof/spinlock.h:87:9: error: 'domain->lock' is a pointer; did you mean to use '->'?
(lock)->user = __LINE__; \
^~
src/include/sof/schedule/ll_schedule_domain.h:71:2: note: in expansion of macro 'spinlock_init'
spinlock_init(&domain->lock);
^~~~~~~~~~~~~
Plus specific errors related to the platform, like:
src/platform/imx8/lib/dma.c: In function 'edma_init':
src/include/sof/spinlock.h:87:9: error: 'dma[i].lock' is a pointer; did you mean to use '->'?
(lock)->user = __LINE__; \
^~
src/platform/imx8/lib/dma.c:54:3: note: in expansion of macro 'spinlock_init'
spinlock_init(&dma[i].lock);
^~~~~~~~~~~~~
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Moves kpb task initialization from kpb_prepare()
to kpb_new() (kpb_prepare() can be invoked several times
for one kpb instance). Adds schedule_task_free() to
kpb_free() in order to avoid memory leaks.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Moves dmic task initialization from dmic_set_config()
to dmic_probe() in order to avoid memory leaks - in theory
driver could send dmic_set_config() ipc many times without
releasing resources. Also adds schedule_task_free() in
dmic_remove().
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Added break statement after error, as it was before refactoring
this part of code in commit <89ef0af07612c0bcf1a85fec3871d0c31e60087b>
("ipc: Refactor ipc_comp_dai_config function").
While at it, also removed additional parenthesis around trace_ipc_error.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit allows code such as:
if (ret < 0)
trace_error("error: %d", ret);
return ret;
to work properly.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
If the assert semantics are changed to be the more usual ones, on
disabling asserts the calls that I changed would have also removed the
desirable side effects when the assertion itself passed (no memcpy_s
would have occurred, in particular). I have changed the usage of the
assert() macro so that the code becomes immune to such a change.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Memory allocated for p->pipe_task should be freed
in pipeline_free() in order to avoid memory leaks.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Refactors code for underrun and overrun detection. We should report
an xrun only if DMA get data size or DMA copy fails. In other case
even 0 available copy bytes doesn't mean anything, because we are always
copying as much as possible. Buffer could potentially be filled up front.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements proper flow for underrun and overrun checking.
DW-DMA should verify whether the channel running on hardware
linked list is still enabled.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements proper overrun and underrun detection flow.
We should return error in case HDA-DMA link detects one.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
dtrace_event...() is protected by dmatb.addr verification
which may be assigned while other buffer attributes are
not set yet. It results in assert in case the initialization
is pre-empted by a code that attempts to log something.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Adds config option to enable system agent. It can be disabled
on the still unstable systems, which cannot guarantee that
agent will execute on time.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
FW sends stream position message to kernel for its version before
3.11. In kernel, no_stream_position will be set to 1 for FW version
after 3.10, and host_period_bytes will be set to 0 for other versions.
So in host_update_position, the condition is always true for hd->report_pos
>= dev->params.host_period_bytes for FW version before 3.11
Now check the condition dev->params.host_period_bytes != 0 according to
commit:b39b17ddf3e
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Changes scheduler_init_edf and task_main_init function
definitions as sof structure is no longer needed. It was
only used to pass agent object to main idle task.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes disable and enable functions, because they
are no longer needed. Agent will now update its lat_check
time above passive level, so every long running task will
be preempted.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Refactors agent's functionality to really verify DSP
responsiveness. Instead of updating last_idle time
on passive level before entering waiti, let's change it
to last_check and update it on actual scheduler task
execution. Task is executed above passive level, so it
should preempt every other long running processing.
Since we don't have any additional precautions to guarantee
that low latency tick will happen exactly at the scheduled time,
let's define warning and panic thresholds to control stability
of the system.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes PLATFORM_LL_DEFAULT_TIMEOUT definition. It has been
replaced by CONFIG_SYSTICK_PERIOD.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds additional CONFIG_SYSTICK_PERIOD to Kconfig,
which is used to drive timer based low latency scheduler
and also will be used as a timeout check value for system agent.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes flow of dai_copy to call dma_copy even if there is no data
available. This way we make sure that all DMA needed procedures are
executed, since buffers pointers won't be changed anyway.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Change flow of components to not resize sink buffers.
We should just check the size of the allocated buffers
and let the topology define the maximum sizes.
Components can easily work with non aligned buffer sizes.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes buffer cache operations done based on the fact,
whether buffer is used by DMA or not. From now on DMAs have
their own dedicated buffers with dedicated copy functions,
so this code is no longer needed.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Currently DMAs are using buffers on pipelines connected to either
host or dai components. This causes many problems in firmware logic
e.g. we need to preload playback pipelines with data or we need
to manually override buffer sizes, if the buffer isn't complaint
with specific DMA requirements. Also it requires from topology
creators to know some hardware specific things on each platform
like that for timer based scheduling on cAVS platforms we need
to have 3 periods in buffers connected to dai components.
This patch allocates separate buffers for DMAs, which are made
complaint by using different DMA attributes first. We no longer
need to preload playback streams, because we can start DMA
right away and just let it transfer zeroes before any valid
data will come.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
DW-DMA has no specific alignments regarding buffer and copy sizes.
However setting it to 32 bytes breaks stream formats with period
sizes lower than 32 bytes, as linked list is being configured
incorrectly.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements copy functions from/to DMA buffer. They take care
of cache operations and also can perform custom processing
during copy. By default it will be usual buffer copy, but in the future
it can be replaced with pcm conversions, so we don't need volume
into the pipelines just for that operation.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds new DMA attribute DMA_ATTR_BUFFER_PERIOD_COUNT and implements
it for every DMA. This attribute says how many periods should DMA
buffer consist of.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>