This commit introduces the ingredients required for adding
fuzzing support in SOF. The main ingredients are as follows:
QEMU bridge: This creates the IO bridge to communicate with
the QEMU DSP
Core IA host support for BYT/CHT platforms: Provides the host
support for intializing the platform and communicating with
the QEMU DSP
Main application: The fuzzing application that sets up the
platform and initializes the communication with the QEMU DSP
Currently, running the fuzzer application only sets up the
platform IO bridge for communicating with the QEMU DSP,
boots the FW, parses the topology file and sets up the components
and connections in topology by sending the IPC messages to
the QEMU DSP. The next step is to add the fuzzing component
which will be responsible for sending fuzzed IPC messages
and monitoring the status.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The topology parser in testbench can be re-used for
the other applications like the fuzzer. In order to
accomplish this, this commit does the following:
1. Separate the topology parser into a separate project
(tplg_parser) which implements the callbacks for parsing
all the components in topology.
2. Add support for parsing new components such as host
pcm, dai and mixer
3. Include the topology parser as an external project
in the testbench.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Adds cache operations to alloc functions to get full
synchronized memory map between different cores.
Memory allocations aren't done so often so we can
afford to go through cache and perform so many
wtb/inv operations. This change allows slave cores
for allocation from runtime heap, buffer heaps etc.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Refactors timer a little bit, to make better usage
of timer id values. Right now every timer has also irq
field, which is used to identify which interrupt line
to enable/disable. We don't longer need timer id to represent
also timer irq, so let's set custom ids and simplify
things.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Instead of returning next period, schedule functions should return
state of the executed task. Period of the tasks is set during
initialization and doesn't change dynamically, so it doesn't make
sense to return it. With the new added SOF_TASK_STATE_RESCHEDULE
we can easily decide if the task is completed or maybe need to
be run once again.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Extracts flags to generic task data, so there is no need
for ll_schedule to keep them privately. Also changes the
way they are passed. From now on flags should be set only
during task initialization and not when starting scheduling.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds new period field to task private data to keep
period set during schedule. Tasks shouldn't change
their period dynamically and in fact there is no
such task.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Decreases code of schedule and reschedule functions by
removing small helper methods, which weren't needed.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds cache operations in task init and schedule functions.
It allows to put tasks' private data in cached memory, which
will be needed in the near future with new EDF implementation.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes usage from arch_cpu_get_id to cpu_get_id.
We always should go through generic function version.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Extracts check whether the pipeline should be executed
on the current core to separate method.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Function responsible for putting FW notifications into the
queue is shared between all cores. In this function we should
access _ipc object only through uncached memory region to not cause
random data overwrite.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes accesses to the _ipc object to go through uncached
memory region. This way slave cores can safely read shared_ctx
without causing random overwrite of the data.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>