Use RELATIVE_FILE because __FILE__ makes binary output
dependent on project location.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Do not run unit tests on unsupported by configuration
data types. See CONFIG_FORMAT_* macro.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It will be helpful during next step - conditional code
compilation depending on configuration
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Do not include data type test when it is not supported by
some platform or firmware version.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Change flow of components to not resize sink buffers.
We should just check the size of the allocated buffers
and let the topology define the maximum sizes.
Components can easily work with non aligned buffer sizes.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds and initializes id, pipeline_id and caps fields in buffer struct.
This is the only data needed after buffer creation. It allows us to
remove the whole sof_ipc_buffer struct from the buffers.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
When new pipeline is created we need to also verify whether
given pipeline id is already taken.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Add alignment option for memory requests.
Fix alloc definitions for UT.
Function definitions were using defines in their body
which blocked usage of const values in said defines.
Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
Changes implementation of pipe_task allocation and initialization
to happen in prepare call instead of during pipeline creations.
It might be that the pipeline will never be used.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds complete callback to task. Some EDF tasks will need to have
additional callback on task completion, which will be executed
in critical section along the setting task state to complete.
Doing it during regular execution is not enough, because it's done
on passive level and we want to avoid any race condition.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Moves idc implementation to cavs drivers instead of keeping
it in generic xtensa arch directory. IDC is specific for
SMP cAVS platforms.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
In case when we overwrite "old" data in buffer
(when buffer is full) we should align r_ptr
with w_ptr.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Refactors schedule code in order to allow dynamic scheduler
creation. We don't want to add every new scheduler to the static
array of scheduler_ops and also we don't want to have every
scheduler created on every platform. Maybe some of the platforms
won't need some of the future scheduler types.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch implements the new version of EDF scheduler.
This is the first basic implementation, which can be easily extended
in the future.
Previous implementation had two major flaws:
- Tasks could only be preempted based on the interrupt level on which
they have been scheduled, so it was limited based on the hardware.
- This led to the system not fully utilized, so we could never achieve
full EDF functionality.
The new implementation uses only one software interrupt and allows for
dynamic context switching between different tasks based on the deadline.
Also for some cases priority is taken into consideration e.g. for idle
and almost idle tasks, which don't have deadline at all and should be
executed only if the system is free. All other normal tasks should have
the same priority. Task chosen to be run is executed on passive level,
so automatically can be preempted by every interrupt. Every task has
its own private stack on which current context is saved and restored
if needed. Note that main firmware loop is task scheduled with
idle priority, so it will be executed only after every other task
is completed.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes two tests which don't really test anything
and are based on magic numbers. Changing memory map
can easily break them.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
cmocka pipeline connect unit test is checking the successful
connection from frames count set in components. However the frames
are not set in pipeline complete if we set the frames from stream
parameters. So check now that the pipeline pointer has been set
and matches the pipeline in high level test function.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Replaces spin_lock_* macros with irq_local_* macros
in many places. Most of the code doesn't need to keep
synchronization between cores. Setting critical section
by disabling local interrupts is enough. Spinlocks should
be used only in the places, where both cores have access.
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>
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 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 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>
Component in comp_prepare() should change sink buffer
only when sink component is not connected to dma.
comp_set_sink_buffer() checks whether sink component
is not connected to dma and in that case it try to
resize sink buffer.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This patch fixes the issue, where we've reenabled
the interrupts for the DSP, which sometimes caused
immediate DSP exception and overwrite of our dump.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Moves panic related functions from arch/sof.h to newly created
arch/debug/panic.h. Also change definition of arch_dump_regs
function to take dump buffer from caller. It decreases the
number of included headers in arch/debug/panic.h.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Moves task structure and defines to the sof/task.h,
where they should be from the beginning. sof/schedule.h is
just for scheduler related things.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Moves headers to dedicated directories in sof/include,
arch/include and platform/include. File tree was too flat,
so some of the files has been moved.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Cleanups includes in all drivers, include and
platform files. Unused headers has been removed
and needed has beed added.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Merges xtensa UP and SMP architectures.
The amount of code which were duplicated by creating
SMP architecture as separate instance is too big
to maintain. I've decided to merge both architectures,
change explicit selection of SMP to be dependent on
configured number of cores (> 1) and add branching in
xtos based on currently used processor configuration.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch adds check for sample to not exceed S24_LE range that
could happen in int32_t type storage. The existing check for
abs(delta) > 1 does not cover such case if e.g. the reference
volume code would output e.g. INT24_MAX and the FW component
INT24_MAX + 1.
Similar check is added for every reference volume function that
outputs S24_LE format.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Extracts schedule related implementations to the separate
directory to make it easier to locate and implement new
schedulers in the future.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
memcpy_s has wrong check condition for
overlapping sections. The copy from adjacent memory
bloks will result in dsp panic while it should be
allowed. This patch fixes the issue for cmocka
tests.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This will optimize memory usage and introduces two significant optimizations:
> Separate the memory (heaps, stack) by cores so if we will turn off a specific core we can also turn off all memory of this core.
> Remove fixed defines and gaps, previously stack was at fixed position: end of memory and buffer heap was everything between stack and fw. Now everything will be packed at sof_fw memory segment and takes only this memory which is really needed, everything else we can turn off.
Changelog:
BSS section now includes heaps and stack
Removed many heap fixed position defines
Removed gap before fw text section
memmap init is using real linker positions for heaps
Temporary stack for boot_ldr placed in heap_hp_buffer (safe)
sof fw max_size and segment limited to memory configured by memory banks count
Using new macro to stack init per core
Stack is no longer a one big block for all cores (core_count*stack_size)
System_runtime_heap and system_heap are no longer a one big block for all cores
For suecreek memory it will also introduce similar changes previously introduced
in other platforms
(One shared memory block SOF_FW for SOF_TEXT, SOF_DATA and SOF_BSS sections
Moved fw_ready near to .rodata and .data)
Memory layout for every slave core aligned to hw memory bank:
--align to memory bank--
system_heap
system_runtime_heap
stack
--align to memory bank--
next slave core..
Similar layout applies to master core
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
KPB source code started to use timer related features
therefore cmocka tests need to include these
dependencies.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
KPB_MAX_BUFFER_SIZE has changed therefore cmocka test
which uses this macro needs to be changed accordingly.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>