Commit Graph

3387 Commits

Author SHA1 Message Date
Tomasz Lauda 397c1a0d94 pipeline: move check for xrun
Moves xrun check in pipeline_trigger after checking
if this pipeline is running on current core. Only owner
of the pipeline should access its data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 18:50:50 +01:00
Tomasz Lauda 39b59af35f idc: add missing cache invalidation
Adds missing comp_dev invalidation before accessing it.
We also need to move core check a little bit further,
since it also uses both comp_dev and pipeline objects.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 18:50:50 +01:00
Tomasz Lauda f5e9cf69e3 arch: xtensa: remove workaround for APL GCC compilation
Removes previously added workaround for APL GCC compilation.
Some of the coprocessor registers wasn't included in the
overlay. This patch will only work with the updated
xtensa-apl-overlay.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 13:54:05 +02:00
Tomasz Lauda 901be03a05 byt: update xtensa core headers
Updates xtensa core headers for byt and cht platforms.
The one previously used had wrong values for these
platforms.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 13:54:05 +02:00
Tomasz Lauda 312a7cdaee byt: cht: disable FIR and IIR components
Disables FIR and IIR components for byt and cht
platforms. These are not currently used, so we
can spare some space in IRAM.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 13:54:05 +02:00
Tomasz Lauda 5efd0c5e81 platform: byt: do not use vector addresses from core-isa.h
This patch copies vector addresses for baytrail platform
from core-isa.h to memory.h. This way we won't overwrite
default xtensa addresses, when updating xtensa headers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 13:54:05 +02:00
Bartosz Kokoszko bdde5013e1 host: add traces with id's
Traces with id's help to read logs,
especially when there are several
pipelines in topology.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-08-06 11:48:03 +02:00
Tomasz Lauda d0d4301c9c task: abstract slave core functions to arch layer
Abstracts slave core functions to arch layer. It doesn't
make sense to compile them, if they won't be used.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-05 13:59:10 +01:00
Tomasz Lauda f068ddd771 ll_schedule: fix possible race condition
Fixes very rare race condition, when multiple cores
schedule something in low latency scheduler. We should
allow for timer client to execute one more time after
being cancelled. There won't be any tasks on the list
to process, but at least we will stop everything
gracefully.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-05 13:56:10 +01:00
Tomasz Lauda ca45e75244 ll_schedule: zero queue by default
Changes ll_schedule_data allocation function from malloc
to rzalloc. It should be zeroed out in order to prevent
usage of any garbage data after slave core reenable
sequence.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-05 13:56:10 +01:00
Janusz Jankowski f837e57b6e test: mux calc_sample_s16le
Unit tests for calc_sample_s16le with up to 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski 1bf779eef7 test: mux calc_sample_s24le
Unit tests for calc_sample_s24le with up to 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski 21375d45a2 test: mux calc_sample_s32le
Unit tests for calc_sample_s32le with up to 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski cfa339fece test: mux_prepare
Unit tests for mux prepare with valid and invalid formats.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski b5654b851f test: demux_copy
Unit tests for demux copy with 1 source, 4 sinks and 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski a4dcabcfc6 test: mux_copy
Unit tests for mux copy with 4 sources, 1 sink and 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Tomasz Lauda d5a10013aa dw-dma: prevent from double stop sequence
Adds check in dw-dma to make sure the channel is in fact
in active state before doing anything.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-02 13:06:36 +02:00
Paul Olaru 3ed68f15af panic: Distinguish exceptions from other panics
On exceptions and panics, the code will reach panic_rewind. That
function will, among the other things it needs to do to dump the info,
will also dump the exception cause (exccause register). This means that
normally coredumps from panics and those from exceptions are
indistinguishable.

In this commit I reserve the maximum value for exccause (63) to signify
that the dump actually came from a panic instead of a hardware
exception. The easiest way I could see that would not duplicate code is
to simply set the exccause register to this reserved value (otherwise it
could be undefined, as it's not initialized at boot).

I also update the core dumper tool to use 63 as the value reserved for
panics instead of 0 (which is IllegalInstructionCause, a valid hardware
exception).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-08-01 14:17:18 +02:00
Zhang Keqiao 2d0759dd02 topology: add demux pipeline to CML max98357a tplg
This topology will add a mux pipeline to support echo reference for CML.

Signed-off-by: Zhang Keqiao <keqiao.zhang@linux.intel.com>
2019-08-01 07:05:27 +02:00
Paul Olaru 9d28da9c98 arch: xtensa: Fix exception handlers
Before the commit the C exception handler table was declared empty
(suspiciously). This also caused my own tests to fail to call the panic
code whenever an exception occurred.

This commit fixes this by actually declaring the slots themselves and
initializing them to xtos_p_none, and also setting the correct size
(64 * 4 instead of 0).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-07-31 10:27:52 +02:00
Pan Xiuli c6dd479787 [skip ci]scripts: update glib support for fuzzer
Install libglib2.0-dev with apt.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-07-31 07:57:36 +02:00
Marcin Rajwa 9152ba748a memory: change size of single HP buffer
This patch changes size of single HP buffer block
from 0x180 to 0x100. Smaller blocks scale better
allowing for performance improvements and more
efficient memory usage.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 22:00:04 +02:00
Marcin Rajwa ae14528327 memory: increase hpsram buffer size for CNL
This patch increases HPSRAM buffer size. This
additional space is needed for KWD functionality.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 22:00:04 +02:00
Marcin Rajwa 33388bbe56 kpb: return -EIO if copy was called with wrong state
This patch makes kpb_copy() to return -EIO
if it was called while KPB was in wrong state.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa e7db11b6af kpb: fix states at prepare time
This patch switches KPB into RUN state after
prepare. This is expected state once KPB
was properly initialized.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 5e3b739043 kpb: disable sys_agent before draining
Draining task can take a long time depending
on various params. This patch disables system
agent which raises DSP PANIC in case firmware
is hanged. However draining task can look to
system agent in exactly the same manner thus
we disable it right before draining task and
reenable after draining is done.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa ad59cf465a kpb: forbid draining requests bigger than history_buffer
This patch adds a check if history depth request is
bigger than history buffer size. If so refuse to drain.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 3bdc499467 kpb: update kpb_copy_samples() to support 24b samples
This patch updates function kpb_copy_samples() which
copies samples from KPB source buffer to sink buffer
to support 24b & 32b samples.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa dc8679aaca kpb: update kpb_drain_samples() to support 24b samples
This patch updates function kpb_drain_samples() which
copies samples from history buffer to host buffer
to support 24b & 32b samples.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 2abe83886c kpb: take care of real time stream during draining
This patch checks if real time stream provided new data
while we were draining. If so we need to continue
draining that new data which are wainiting in history
buffer.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 68c2cf87e2 kpb: change kpb buffer if at the end od draining r_ptr == buff->end_addr
This patch takes care of changing kpb buffer if last
drained size made read pointer equal to buffer
end address. This is important since in slow draining
cases we might need to update history size by real
time stream and therefore continue draining.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 67225ccfdb kpb: limit draining speed to match host params
This patch limit the speed of draining to the speed
of host reads. We fill half of the host buffer and
give a time of one period to read it.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 34f495ecce kpb: rework calculations of time taken to drain data
This patch makes calculation of time taken to drain
history buffer more evident and clear.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa b2c637f2da kpb: add secure reset to draining task
This patch adds a check in draining task for reset
request. If it happened while we were draining then
draining task shall me carefully terminated.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 4e5f16bc78 kpb: pause selector before draining starts
This patch stops selector copy before draining starts.
This is temporary change as driver should take care of
it.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa ed9f915ed6 kpb: change KPB state to draining only if draining started
This patches moves the switch of KPB state from RUN
to DRAINING at the time draining task starts.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 7e05a95693 kpb: add sanity check of host params
This patch checks if host period size and well as
host buffer size are sane and can be used for draining
calculations.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 6c865fc681 kpb: log requested draining
This patchs logs requested draining length in
milliseconds in kpb_init_draining() procedure.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 4f1b438656 kpb: introduce draining intervals
This patch introduces and calulates draining intervals
as well as bytes limit per interval. It is all needed
to synchronize firmware draining speed with host read
speed. Basically in one period we fill half of host
buffer and give host some time (period_interval)
to read the data.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 9ba1814d1d kpb: change draining copy type to normal
This change dma-copy type from blocking to
normal. This is because blocking mode slows down
draining considerably and from safety standpoint
we cover it by period-interval now.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 6fbe4a9589 kpb: don't allow draining if KPB is in wrong state
This patch checks if KPB is in proper state beforeinitialize draining.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 943f2e0eb9 kpb: calculate history depth depending on sample container size
This patch covers calculations of history depth
based on sample container size rather than sample
width itself.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 0683635252 kpb: record history buffer update while draining
This patch enables draining task to know how
much data was buffered since draining task
has been started.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 39f24fbc2a kpb: add secure reset while buffering
This patch takes care of secure reset while
KPB is in buffering state.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 60f4f9baa9 kpb: change input parameter to kpb_buffer_data()
Due to secure reset procedure this function needs
a pointer to component device now.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 053f4f90fe kpb: add timeout for buffering function
This patch adds timeout to buffering. So now
if we are stuck in buffering due to i.e
pointers corruption we can detect that, log
error message and leave that procedure.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa d150379651 kpb: rework main copy function
This patch reworks kpb_copy() adding
explicit state handling. Improves redability and
function performance. This way we don't need to
search for things that are not needed at the time.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 7c4764cfa4 kpb: block KPB prepare() if reset is not done
This patch checks if reset request has been
completed before KPB can be prepared again.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa f27cd973f1 kpb: add function to reset history buffer pointers
This adds function to reset history buffer key
pointers.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 8994a7ff81 kpb: make reset more secure
This patch takes care of secure reset.
Now we check in what state KPB currently is.
If this state involves some ongoing work
like draining or buffering then KPB will
register reset request and terminate this
job gracefully.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00