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>
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>
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>
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>
This patch increases HPSRAM buffer size. This
additional space is needed for KWD functionality.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This patchs logs requested draining length in
milliseconds in kpb_init_draining() procedure.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>