Commit Graph

2895 Commits

Author SHA1 Message Date
Tomasz Lauda 948b5518b5 imx: add missing headers
Adds missing header to clk and esai implementations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 29de310834 ipc: merge ipc_shared_context
Removes shared_ctx from ipc structure and add its members
directly to struct ipc. From now on ipc struct needs to
be shared to support SMP. It's done in order to eliminate
possible wrong pointer to shared_ctx, since it was a part
of cached data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Seppo Ingalsuo 9d4ca10639 Volume: Simplify volume synchronization to host
This patch removes a trivial function vol_update() and alters
vol_sync_host() to update all channels the same time into the
host data structure instead of per channel updates. There is no
other change to component operation.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-16 19:48:33 +00:00
Seppo Ingalsuo dcf722f826 Volume: Simplify ramp calculation and provide constant rate on/off
The earlier version of ramp step calculation was more complex than
necessary and there was no way to ensure the max. topology defined
ramp time happens in beginning of streaming so the step equation
was rewritten. The step value is rounded for better match with
topology defined ramp length.

Normally the ramp is constant rate type where the topology define
time happens for vol min-max transition. A smaller transition is
completed in less time.

The constant rate mode is not used for the first copy() triggered
ramp to ensure the ramp from vol min to used volume takes the
entire topology defined time. This mode is also as earlier used
for legacy kernels where the vol min/max information is not passed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-16 19:48:33 +00:00
Seppo Ingalsuo 901a963a67 Volume: Always launch ramp in beginning of copy() operations
This patch ensures that a ramp will happen in beginning of
streaming even if the driver control sequence would not launch
it by successive volume requests for mute and actual volume.

Also a check is added into volume ramp update to prevent a volume
command in component idle state to schedule repeatedly ramp
updates. In that case the volume can be set immediately to ramp
end value.

Also the ramp is updated for active channels only. There's no need to
update for the maximum channels count.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-16 19:48:33 +00:00
Seppo Ingalsuo e525c177b5 Volume: Fix for gain ramp step macro value
This patch fixes the calculation of macro VOL_RAMP_STEP_CONST
that is used in linear step size calculation. The previous version
calculated incorrectly the value as inverse. However with used ramp
update rate of 1000 us there were no issues seen because the value
and inverse were both 1.0. The bug would have triggered with with
a faster or slower ramp update rate.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-16 19:48:33 +00:00
Marcin Maka c4bb1958dc perf: agent: add perf counter to trace cpu load
Periodic stamp traces cpu ticks every time agent task run.
This peak value compared to cpu clock shows the peak load.
Platform art ticks are traced and allow for fine adjustment
of cpu ticks in case there is a jitter in agent task period.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-16 13:28:58 +00:00
Marcin Maka 85525efe59 perf: scheduler: add periodic ll exec performance counter
Simple measument of periodically run ll scheduler task
execution routine.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-16 13:28:58 +00:00
Marcin Maka 05f2a626d1 cnl: config: enable perf counters
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-16 13:28:58 +00:00
Marcin Maka 114a718e8d perf: add simple performance timestamps macros
Performance ts macros use both the platform timer and cpu timer
in case the latter is not always-running-timer.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-16 13:28:58 +00:00
Marcin Maka 8dcf0a7c89 timer: add cpu timer to sof global context
A cpu timer may be used with arch_timer api to read
a cpu timer in a common way including platforms that
have a dedicated platform timer and their platform_timer
api is not a simple redirection to arch_timer.

Sometimes it is important to have access to both, e.g.
when computing performance counters, since the platform
one is expected to be always running timer while the
cpu timer may be gated in idle.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-16 13:28:58 +00:00
Karol Trzcinski 426525b594 pcm_converter: Rename function argument in pcm_converter_setup_circular
arhument name 'source' (instead 'buffer') implies that this
parameter shouldn't be modified inside function, what is true.
This change improves code readability.

Suggested-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-16 15:19:55 +02:00
Karol Trzcinski e0aaafabf5 pcm_converter: Use endif with condition description
pcm_converter is plenty of preprocessor conditional build so it's
easy to be puzzled.
Added comments improve code readability.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-16 15:19:55 +02:00
Karol Trzcinski a577f0ef14 pcm_converter: buffer: Mark source buffer as const
Input buffer should be explicit marked as const to indicate
that input samples and other comp_buffer fields shouldn't
be modified (especially r_ptr/w_ptr).

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-16 15:19:55 +02:00
Karol Trzcinski e2b21c0359 pcm_converter: Use converter function pointer typedef
In pcm, host and dai was implicit data definition corresponding
to defined in pcm 'converter' function pointer.
Using common function interface improve code coherence.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-16 15:19:55 +02:00
Seppo Ingalsuo 0a4f809a7b ASRC: Fix xt-xcc build for non-HiFi3 platforms
This patch enables the generic C version code when xt-xcc compiler
is used for e.g. HiFi2EP platform like BYT. The intrinsics in
HiFi3 version are not compatible with the elder xtensa architecture
and cause build fail.

There will be need for update here for architectures after HiFi3 where
HiFi3 version might be as such applicable while a dedicated optimized
version is missing but it will be done later.

The patch includes some comments additions/changes to help follow
the nested #if #else #endifs.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-16 13:06:36 +01:00
Keyon Jie 7aa01e77b9 ipc: take NO_TRACE flag of SETD0IX IPC from host
When entering D0ix, we can run FW with either DMA trace on (e.g. the
host system is in S0) or off (e.g. the host system is in S0ix), here
take the NO_TRACE flag passed from host and response to it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-01-16 11:49:57 +00:00
Marcin Maka e69938583a trace: ll_scheduler: add traces for task (un)register and cancel
Improves debugability of the cpu load related issues.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-14 21:34:53 +00:00
Marcin Maka 7e705d078c ll_sched: task run loop refactored
By reverting the condition, there is one indentation less
so readability improved a bit and gives more space for
longer lines.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-14 21:34:53 +00:00
Marcin Maka c1be66930a trace: timer_domain: trace args in (un)register
Move also aborted calls to verbose level.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-14 21:34:53 +00:00
Amery Song 8e9df078e1 kpb: get correct threshold with valid bits
We should get threshold with valid bits rather
than sample width.

Signed-off-by: Amery Song <chao.song@intel.com>
2020-01-14 20:48:25 +00:00
Karol Trzcinski 3fe9e7d74e pcm_converter: Remove unused code from volume
There is no need to keep dead code.
Currently host and DAI component is responsible for format conversion -
- using pcm_converter functions.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-14 16:40:38 +00:00
Karol Trzcinski c2cdd4356d kwd: Set activation threshold for s32 format
Revert changes introduced in commit 7003c1f for s32 format.
Moreover explicity declare threshold for s32 on same level as
for s24 to indicate that it is intentional.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-14 13:57:29 +00:00
Daniel Baluta 921fd951fa drivers: imx: interrupt: Fix IRQSTEER address
Use specific CONFIG_ to select correct address for
IRQSTEER on i.MX8/i.MX8X.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-01-13 20:17:19 +02:00
Daniel Baluta d44130e994 platform: Add support for i.MX8X
DSP integrations for i.MX8 and i.MX8X are very similar
from the DSP point of view.

The only notable difference at this point is the IRQSTEER
address.

i.MX8 means for now i.MX8QM.
i.MX8X means for now i.MX8QXP.

There might be other variants in the future.

https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i.mx-applications-processors/i.mx-8-processors:IMX8-SERIES

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-01-13 20:17:19 +02:00
Daniel Baluta e6e17b00d1 drivers: imx: Add separate config option for IMX drivers
Future i.MX platforms will use this config option
to compile NXP specific drivers.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-01-13 20:17:19 +02:00
Seppo Ingalsuo fd6804ced4 Volume: Avoid unnecessary error trace about limiting to VOL_MIN
The trace issue is only cosmetic since VOL_MIN is currently defined
to zero. There linear gain value was not altered despite the emitted
trace. With this change the limiting no more happens for input value
zero.

The related trace messages are improved to show the defined limits
for easier adjust the offending topology volume scale if this
happens. The string split style is also updated to current.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-13 16:56:55 +00:00
Seppo Ingalsuo b77c7dc27c EQ FIR: Add trace verbosity and align with IIR trace output
This patch unifies the configuration blob parsing related traces
with IIR. The low importance trace for response start index is
removed and a note about setting a channel to bypass is added. The
illegal channel map response index is traced with error.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-13 16:44:44 +00:00
Seppo Ingalsuo cc96385589 EQ FIR: Extrapolate channels response map with last valid
Response channel map extrapolation uses now last valid channel
response instead of first response when there are more stream
channels than channel map on configuration blob. The change is
done for similarity with IIR. It prevents a false issue report
from static code analysis.

The extrapolation behavior is not critical and in effect type of
usage where it is common to apply the single defined response for
every channel so in that case there is no change.

In transducer equalization the blob needs to define usually a different
for every channel so also in that case extrapolation is not feasible
to let happen and a full length channel map need to be defined anyway.

The firmware trace shows which response # gets applied for channel. So
when unsure the parsing of configuration blob can be quickly checked.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-13 16:44:44 +00:00
Seppo Ingalsuo 0d8e63b8e9 EQ FIR: Remove handling of set/get value commands
This patch removes the command handler stubs for COMP_CMD_SET_VALUE
and COMP_CMD_GET_VALUE. A proper error is issued if these commands are
passed to FIR.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-13 16:44:44 +00:00
Seppo Ingalsuo c0b9b4057e EQ FIR: Add support for runtime reconfiguration
This patch adds similarly as done for IIR capability to change the
configuration during playback or capture. The previous version
returned an error to driver in such case even with a valid request.
Due to driver logic of caching the controls (no separate handling for
EBUSY) the rejected request caused all successive streaming attempts
to fail.

Support for SOF_CTRL_CMD_ENUM to control preset-EQ is removed since
the driver does not support the feature. The implementation would
need a change anyway so better to remove it now and reintroduce it
if needed later.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-13 16:44:44 +00:00
Tomasz Lauda 418c77e6de ipc: use ipc_get() instead of global pointer
Uses ipc_get() to retrieve ipc structure pointer instead
of global pointer. This way we have one point of access
and avoid unnecessary cache accesses.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 04c9ac9bf4 ipc: add structure getter
Adds getter to easily retrieve ipc structure
through one point of access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda e57f8f0e92 dma: add DMA info to sof context
Adds DMA info to sof main context. Also implements
getter to easily retrieve the info through one point
of access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 4ca20db161 dma: moves dma_info structure to header
Moves dma_info structure to header, so it will become
available to other multiple modules.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda a64f6029f1 dma: pass sof context to dmac_init
Changes dmac_init function's argument list to take
sof context. It will be needed to add dma list pointer
into sof context.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 772028e9a4 imx: replace edma_init() with generic dmac_init()
Replaces edma_init() with generic dmac_init().
It's better in terms of future refactors.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 370f672cd2 dma: move dmac_init to common header
Moves dmac_init function from platform to common header.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 781ccb10c7 dai: add DAI info to sof context
Adds DAI info to sof main context. Also implements
getter to easily retrieve the info through one point
of access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 81730d4da8 dai: moves dai_info structure to header
Moves dai_info structure to header, so it will become
available to other multiple modules.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 85e69f8009 dai: pass sof context to dai_init
Changes dai_init function's argument list to take
sof context. It will be needed to add dai list pointer
into sof context.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 019f02e023 dai: move dai_init to common header
Moves dai_init function from platform to common header.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 3231717232 notifier: add notify_data to sof context
Adds notify_data to sof main context. Also implements
getter to easily retrieve the pointer through one point
of access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 1af651ac5a notifier: pass sof context to init_system_notify
Passes sof context pointer to init_system_notify.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 72150acfd5 init: pass sof context to slave_core_init
Passes sof context pointer to slave_core_init.
This will allow to pass context even further.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 82ea5c1bf1 notifier: move notify_data definition to header
Moves notify_data struct definition to notifier header.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda af79cf4656 pm_runtime: add pm runtime data to sof context
Adds pm runtime data to sof main context. Also implements
getter to easily retrieve the data through one point of access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 41a5e795a7 pm_runtime: pass sof context to pm_runtime_init
Changes pm_runtime_init function's argument list to take
sof context. It will be needed to add pm runtime data pointer
into sof context.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 1065e12a63 memory: add memory map to sof context
Adds memory map to sof main context. Also implements
getter to easily retrieve it through one point of access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 3f53d59e7b memory: pass sof context to platform_init_memmap
Changes platform_init_memmap function's argument list to take
sof context. It will be needed to add memory map pointer into
sof context.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00