Commit Graph

4258 Commits

Author SHA1 Message Date
Tomasz Lauda 2095ab0df7 dai: make dai_info and dai_type const
Makes dai_info and dai_type structures constant.
Pointer to dai array should not change during the lifetime of DSP.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 854aa7d181 notifier: use platform_shared_commit()
Uses new platform_shared_commit() function to commit
shared notify data. Notify data no longer needs to be explicitly
aligned to data cache line size. It is implicitly handled by
SHARED_DATA macro.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 46f0b58314 notifier: remove unnecessary lock
Removes unnecessary lock from notifier. Notification list
is allocated in core context, so it's not shared between
cores. There is no need to lock during unregistration.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda a8d2c73c46 clk: use platform_shared_commit()
Uses new platform_shared_commit() function to commit
shared clock info data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 10261ef8d4 platform: remove unused global platform_timer
Removes unused global platform_timer pointers. They have been
moved to sof context.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 49fe994e4b timer: use platform_shared_commit()
Uses new platform_shared_commit() function to commit
shared timer data. Timers can be shared between cores,
so let's use new shared API in timer API.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 925da68b63 timer: replace timer_data
Replaces void pointer to timer_data with pointers to
timer handler and handler data. We had multiple definitions
of timer_data structure and they were all the same.
This way we can remove unnecessary static data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 0ad546d73d ll_schedule: use platform_shared_commit()
Uses new platform_shared_commit() function to commit
shared domain data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda e46579c4c2 dma-trace: use platform_shared_commit()
Uses new platform_shared_commit() function to commit
shared dma-trace data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 16e35e61e4 trace: use platform_shared_commit()
Uses new platform_shared_commit() function to commit
shared trace data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 8e76346741 trace: add missing spinlocks
Adds missing spinlocks in trace_on(), trace_off() and
trace_flush() functions.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 93be71b1a7 alloc: mark memory map as shared
Marks memory map as shared data and refactors code in alloc
to use new platform_shared_commit function. Memory map is
accessed from SMP code, so it should be explicitly marked
as shared resource. Newly introduced API makes code more generic.
We no longer need explicit cache operations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 82b8d08a28 memory: add platform_shared_commit function
Adds platform_shared_commit function for keeping shared data
synchronized. It's used after usage of data shared by different
cores. Such data is either statically marked with SHARED_DATA
or dynamically allocated with SOF_MEM_FLAG_SHARED flag.
cAVS platforms use uncached memory region, so no additional
synchronization is needed, but for SMP platforms without
uncache this function should writeback and invalidate data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda f190608d76 memory: implement SHARED_DATA macro
This patch implements universal macro for shared data
modified at runtime by different cores. On platforms
with uncached memory region all this data can be placed
into dedicated section, so it can be later accessed through
uncache without worrying about cache line alignment and random
cache evictions. Other SMP platforms without uncache can implement
it in some other way, but it's highly advised this macro should
align data to cache line size in such cases.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 80972f1d78 cavs: add section for shared data
This patch adds dedicated section for shared data
on cAVS platforms. This section will be used to store
static data, which can be accessed by multiple cores.
Access to this data will go through uncached memory region.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda dc6e48121f library: add missing function
Adds missing function to host arch build.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
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
Seppo Ingalsuo e0a9afe6a7 Topology: Apply high-pass for HDA capture streams
This patch replaces in topology sof-hda-generic.m4 the use of macro
pipe-volume-capture.m4 usage with a new macro pipe-highpass-capture.m4.
The used 40 Hz cut-off is sufficient to suppress the DC pulse in the
beginning of capture from headset with minimal impact to other
applications such as recording music.

The capture volume ramp length is changed from 250 ms to 400 ms. The
longer ramp is feasible because the microphone path seems to open
at 500 ms from capture. It helps to attenuate the remaining noises
in the beginning of capture.

The patch also adds additional high-pass responses macros for
topology with different 20-50 Hz cut-off frequencies into
SOF/tools/topology/m4.

The changes for Matlab/Octave script example_iir_eq.m that
generated the filter coefficients are included here as well.

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
Pan Xiuli 8b7cefedb5 CI: travis: add IMX8X build check
Enable imx8x build check in travis.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-01-16 13:48:18 +02: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 faa9cf9132 scripts: add build for im8x
Add build scripts for i.mx8x with gcc and xcc support.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-01-14 14:12:50 +01: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 5f0b1fd4f4 rimage: Add support for i.MX8X
i.MX8X is very similar with i.MX8. Memory layout is the same
except IRQSTEER address.

Code will be shared but there will be different firmware binaries
named:
	* sof-imx8.ri, for i.MX8
	* sof-imx8x.ri, for 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