Commit Graph

3424 Commits

Author SHA1 Message Date
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
Marcin Rajwa 9f746c01c0 kpb: extend internal states
This commit adds more detailed states into KPB

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 6027b3e5f7 kpb: unregister kpb from notifications at free()
This change unregisters KPB from async
notifications during kpb_free(). Additionally
reset main history buffer pointer.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 0b279e06bc kpb: move history buffer allocation to prepare
This change moves history buffer allocation
from kpb_new() to kpb_prepare(). This is to
folow the calling convention with kernel.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 444effac9c kpb: pass component device in events
This patch passes comp device pointer to buffering
and draining function as this pointer is needed to
finish reset requests.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 0bb593b15e kpb: unify component data naming
This patch renames component data local
variables name from 'cd' to 'kpb'.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa d180cd343f memory: set LPSRAM related defines to zero if LP not configured
This patch sets all LPSRAM related memory defines to
zero if CONFIG_LP_MEMORY_BANKS is not defined.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa f0e5e484a6 kconfig: enable LPSRAM by default for CNL
This patch enables LPSRAM memory by default on
all APL platforms.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa 160dbf7441 kconfig: enable LPSRAM by default for APL
This patch enables LPSRAM memory by default on
all APL platforms.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa bcad85bf50 memory: fix LPSRAM defines on CANNONLAKE
Enable whole LPSRAM bank to be allocated by heap buffer.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa 01969e083a bootloader: enable LPSRAM depending on CONFIG
This patch changes the rules of LPSRAM enabling.
Now it is no longer platform dependent but rather
rely on config selection.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa 3e06a3569a Kconfig: add option to enable CONFIG_LP_SRAM
Choose to power ON LPSRAM banks in Kconfig menu.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa dcc4119ae2 shim: add LSPGCTL register relative offset
To be able to use register read interfaces like shim_read()
we need to specify offset. This patch adds such offset for
LSPGCTL register.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Adrian Bonislawski bb823ce7eb trace: fix build error if traces are disabled
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-07-30 19:20:40 +02:00