Commit Graph

239 Commits

Author SHA1 Message Date
Tomasz Lauda e465bca588 spinlock: revert explicit allocation
This patch reverts explicit spinlock allocation in shared
memory. From now on we assume every spinlock is already part
of the shared memory. This helps us avoid unnecessary cache
evictions, when accessing spinlock's data. Also some of the
spinlock API functions require interrupt header, so they were
extracted in order to avoid circular dependency.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 80972f1d78 cavs: add section for shared data
This patch adds dedicated section for shared data
on cAVS platforms. This section will be used to store
static data, which can be accessed by multiple cores.
Access to this data will go through uncached memory region.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-16 21:58:10 +00:00
Marcin Maka 114a718e8d perf: add simple performance timestamps macros
Performance ts macros use both the platform timer and cpu timer
in case the latter is not always-running-timer.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-16 13:28:58 +00:00
Tomasz Lauda 1065e12a63 memory: add memory map to sof context
Adds memory map to sof main context. Also implements
getter to easily retrieve it through one point of access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 3f53d59e7b memory: pass sof context to platform_init_memmap
Changes platform_init_memmap function's argument list to take
sof context. It will be needed to add memory map pointer into
sof context.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 670246e2f8 timer: use platform_timer from sof context
Changes accesses across the code to use platform_timer saved
in sof context instead of using externed global variable.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 5f85648c5a alloc: create enum type for heap zones
Creates new mem_zone enum type for heap zones.
We don't want to leave them as flags and allow
zone combinations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda bc246b5da8 alloc: remove zone argument from balloc functions
Removes zone argument from balloc related functions.
They always use RZONE_BUFFER, so passing something else
is very misleading, especially it changes nothing.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda 6a8a3d02f1 alloc: extract flags to separate argument
Extracts flags from zone to use them as a separate argument
during allocations. It allows for addition of new zones and
also is more clear this way.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Marcin Maka 53eaa8c884 kpb: disable pm-runtime of master dsp core for data draining
Lower power state must be disabled before host wakes up and
sends 'quit D0ix' to make sure the draining goes at full speed.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-12-20 18:55:53 +01:00
Tomasz Lauda 8fe7b72682 edf_schedule: remove priority
Removes need to pass EDF task priority during initialization.
Also removes priority definitions, which were only used by
EDF scheduler. Priorities of EDF tasks are now deprecated.
We are scheduling based only on deadline.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda c42f9bd621 task: extract task ops to separate struct
Extracts task operations to separate struct. This way we can
add additional ops without need to endlessly adding parameters
to schedule_edf_task_init function.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda 2baeeadeda schedule: separate task init functions for schedulers
Separates task init functions for all currently supported schedulers.
Some of the parameters are not common, so there is no need to
artificially extend function signatures.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Janusz Jankowski 3d44dead6f Revert "kpb: refactor some of KPBs macros"
This reverts commit 0eabf51c9d.
2019-12-17 11:14:07 +01:00
Marcin Rajwa 0eabf51c9d kpb: refactor some of KPBs macros
This patch refactor KPBs macros:

KPB_SAMPLING_WIDTH to KPB_SAMPLES_PER_MS as this is
exactly what this macro stands for - the amount of
samples we take each milisecond.

KPB_NR_OF_CHANNELS to KPB_NUM_OF_CHANNELS as the later
is more meaningful

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-12-16 15:58:19 +00:00
ArturX Kloniecki a88543a92c notifier: Refactor notifier interface and inner workings.
This patch changes usage of notifier, passing control over callbacks
allocation, allows nested callbacks processing and prepares interface
for future extenting.
This also optimizes unnecessary cache writeback/invalidation when
evaluating callback on the same core it was dispatched.

Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
2019-12-12 11:08:00 +01:00
Bartosz Kokoszko 74e1bcc786 component: move pcm params from component to buffer struct
Moving pcm params from component to buffer is the first
step to improve parameter propagation within pipelines. This commit
moves several pcm paremeters (framet_fmt, buffer_fmt, rate,
channels, chmap, except direction) to comp_buffer struct.
Some of specific parameters are moved to private host and
kpb data.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-11-29 10:58:33 +00:00
Tomasz Lauda e0491ff778 dai: volume: make pcm conversion in dai component
Changes processing flow and moves pcm frame format conversion
from volume to dai component. This way we'll no longer need to
artificially add volume into the pipelines, where it's not really
needed but frame format change is e.g. KPD topology. Dai is the perfect
place for conversion, since it's format is pretty much predefined and
comes from topology. Rest of the pipeline is configured from the host.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-26 13:42:17 +00:00
Janusz Jankowski 1d92e8e175 sof: use RELATIVE_FILE instead of __FILE__
Use RELATIVE_FILE because __FILE__ makes binary output
dependent on project location.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-11 12:50:30 +00:00
Karol Trzcinski 59a7e2819f kconfig: volume: test only supported data format
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>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 33d11ad659 kconfig: volume: group functions by supported data type
It will be helpful during next step - conditional code
compilation depending on configuration

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 20dabd5f1e kconfig: selector: test only supported by configuration data format
Do not carry test on unsupported data format for a five firmware
version.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 34be3cec87 kconfig: mux: test only supported data types
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>
2019-11-11 12:22:11 +00:00
Paul Olaru 5c7a49af38 sof: build: Disallow void pointer arithmetic
Add compiler flags so that void pointer arithmetic is not allowed.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-04 15:26:20 +01:00
Tomasz Lauda 8fa4b80213 component: do not set buffer sizes
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>
2019-10-24 10:17:03 +02:00
Tomasz Lauda df6017f950 buffer: add and init id, pipeline_id and caps fields
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>
2019-10-24 10:17:03 +02:00
Tomasz Lauda 6b22503e54 ipc: check whether pipeline id is already taken
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>
2019-10-17 13:39:41 +02:00
Tomasz Lauda 99c16a69e3 ipc: rename ipc_get_comp function
Renames ipc_get_comp function to ipc_get_comp_by_id.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:41 +02:00
Jakub Dabek 66b0a0f0b8 memory: Add alignment option for allocation
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>
2019-10-11 14:26:08 +02:00
Tomasz Lauda de7d4c95cf pipeline: allocate pipe_task only if needed
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>
2019-10-01 14:32:36 +02:00
Tomasz Lauda 3afc474518 task: add complete callback
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>
2019-10-01 11:24:40 +02:00
Tomasz Lauda eb0d309cf9 task: rename func to run
Renames task's func to run to better show intention of this callback.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-01 11:24:40 +02:00
Tomasz Lauda b80338c395 idc: move to cavs drivers
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>
2019-09-30 11:34:39 +02:00
Bartosz Kokoszko d42c01956f buffer: add overwrite in circular wrap case
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>
2019-09-24 12:44:16 +02:00
Tomasz Lauda 8c61213c37 schedule: support dynamic scheduler creation
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>
2019-09-11 16:24:00 +02:00
Tomasz Lauda 20acc16791 edf_schedule: implement the new version of EDF scheduler
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>
2019-09-06 15:51:02 +01:00
Tomasz Lauda d1ede217e8 test: alloc: remove tests which don't test anything
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>
2019-09-06 15:51:02 +01:00
Jaska Uimonen ebf406d084 unit tests: fix cmocka test for pipeline connect
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>
2019-08-15 14:29:22 +02:00
Tomasz Lauda 9a6616a89b spinlock: replace spin_lock_* with irq_local_*
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>
2019-08-07 14:22:52 +02:00
Tomasz Lauda ec9d1cad94 schedule: make some functions static inline
Transforms some of the short functions to static inline.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 18:51:20 +01:00
Tomasz Lauda 4100fa0ac3 schedule: make schedule functions return task state
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>
2019-08-06 18:51:20 +01:00
Tomasz Lauda 99005e21bc schedule: extract flags to generic task data
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>
2019-08-06 18:51:20 +01:00
Tomasz Lauda 2d16db19de ll_schedule: keep task period in private data
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>
2019-08-06 18:51:20 +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
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 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 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
Bartosz Kokoszko f3d79e7398 component: add comp_set_sink_buffer() function
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>
2019-07-27 13:30:18 +02:00
Tomasz Lauda 5449dc2a30 panic: keep interrupts disabled after panic
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>
2019-07-27 12:55:41 +02:00
Tomasz Lauda 418ddec569 panic: move panic related functions to new panic.h
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>
2019-07-27 12:55:41 +02:00
Tomasz Lauda 14b23ba5d3 task: move task structure and defines to the right header
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>
2019-07-19 15:50:35 +02:00
Tomasz Lauda 54d4d01d64 sof: move c files to dedicated directories
Moves c files to dedicated directories.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-18 16:00:24 +02:00
Tomasz Lauda 4ee9e1159c sof: move headers to dedicated directories
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>
2019-07-18 16:00:24 +02:00
Tomasz Lauda 1944052617 drivers: include: platform: cleanup includes
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>
2019-07-16 15:02:06 +02:00
Tomasz Lauda a990c611c4 sof: change approach to including arch headers
Further work, but now it's done for remaining arch headers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-15 13:29:29 +02:00
Tomasz Lauda 2eb5857c77 arch: xtensa: merge UP and SMP architectures
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>
2019-07-12 15:05:57 +02:00
Seppo Ingalsuo 34d0db94be Cmocka: Volume: Increase test coverage for S24_LE output format
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>
2019-07-09 15:15:15 +02:00
Janusz Jankowski 084e7d6e79 test: add realloc stubs
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-03 13:55:30 +02:00
Tomasz Lauda 25bbc9f5cd schedule: extract schedulers to separate directory
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>
2019-06-24 17:24:59 +01:00
Marcin Rajwa afbb2a6f53 memcpy: fix bug in memcpy_s for cmocka
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>
2019-06-18 23:16:21 +02:00
Adrian Bonislawski f1fe78367a memory: new memory layout for APL, ICL, CNL and SUE
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>
2019-06-11 13:49:37 +02:00
Marcin Rajwa fb111cdebe cmocka: update KPB tests for new dependencies
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>
2019-06-11 13:25:16 +02:00
Marcin Rajwa b33574ce65 cmocka: update kpb test case
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>
2019-06-06 09:47:33 +01:00
Tomasz Lauda 4d22a98f6c idc: change waiting code to be ms based
Changes waiting code in arch_idc_send_msg to be
milliseconds based instead of DSP cycles based.
This aligns nicely with the rest of waiting functions.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-05 21:22:50 +01:00
Janusz Jankowski 5dd9aaccb4 cmake: xtensa: use absolute paths for tools
CMake has convention of changing relative paths to absolute
for CMAKE_* variables. It does it automatically f.e. CMAKE_C_COMPILER.
However for our tools like objcopy we have to do it manually.
It also helps with integration of CMake in some IDEs.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-05 11:38:23 +02:00
Janusz Jankowski c6064624f6 cmake: add spdx license identifier
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski ecd506e16d license: use spdx in .c, .h and .S files with BSD3
Use SPDX License identifier in files that already
contain BSD-3-Clause license.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski 02ffbea1a1 test: kpb: add license
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski d59cedbe61 test: include: add license
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski e39ed5ebf4 include: split uapi headers into more directories
Some of interface headers are not needed by kernel,
but are needed by user-space applications, so we can split them
into multiple directories that indicate their purpose.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-31 20:10:45 +01:00
Daniel Bogdzia 17eba5b190 test: add rballoc tests
Rballoc tests check if the current heap is full
the succeeding one would be taken

Signed-off-by: Daniel Bogdzia <danielx.bogdzia@linux.intel.com>
2019-05-30 12:02:05 +02:00
Tomasz Lauda ca45bc8303 audio: put multifile components to directories
This patch moves multifile components to separate
directories. All component headers are also moved to
include/sof/audio.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-05-17 17:39:45 +02:00
Jakub Dabek 3020d4aba4 memory: changed memcpy_s error handling
Failing to copy will result in FW panic

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-05-11 09:08:31 +02:00
Keyon Jie 72360bd42f kpb: fix kpb reset issue to make the consequent iteration work
We need reset kpb->state to KPB_STATE_BUFFERING, and unregister notifier
in .reset() as we will register it again at next .prepare(), otherwise,
the consequent record won't work.

Add definition of notifier_unregister() into cmoka fix the link error to
avoid breaking UT at the same time.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-05-07 12:26:56 +02:00
Janusz Jankowski 3a65b78f5f host: replace CONFIG_HOST and CONFIG_LIB with CONFIG_LIBRARY
We don't need 3 symbols - they all are used in the same case.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-07 08:49:48 +02:00
Seppo Ingalsuo adf8d66caf Volume: Improve coverage of cmocka tests
To help catching overflows this patch exercises the volume
component test with larger absolute value test data, both
positive and negative numbers. A test generator is added for
S24_4LE format.

Since the reference float arithmetic sometimes calculates the
sample with less accuracy than fixed point firmware code the
error is asserted when delta of reference and firmware is larger
than one LSB. The float code is off by one sometimes with negative
samples. To not complicate the test code this simple relaxation is
proposed.

The table of test inputs is commented with numbers to help to quickly
find a failing test case function if such happens from printed output
from cmocka test run.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-04-29 09:57:16 -07:00
Keyon Jie cbf2be22ed component: refine state change for xrun handling
When trigger xrun arrives, we will reset the component state to be
READY, which means prepare will needed before we can recover.

Update state machine diagram and cmoka unit test cases also.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-04-24 22:38:26 +01:00
Marcin Rajwa 304336ba60 CMOCKA-KPB: test and verify internal buffering
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa e39d0729e7 CMOCKA-KPB: perform copy test and its verification
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa e6967498c1 CMOCKA-KPB: connect sink and source to KPB device
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa 827b240847 CMOCKA-KPB: fill source buffer with test data
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa fb8a650877 CMOCKA-KPB: create dummy source && sink buffers
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa 3ff3b61886 CMOCKA: removed old memory allocation in testcases of KPB
The KPB component has changed its buffering
algorithm therefore its test cases needs to
be changed accordingly.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Seppo Ingalsuo 50bd96ded4 Volume: Allow use of extended volume scale up to 42 dB
This patch alters the volume IPC and ramp to use sQ8.16 gain
values instead of previous Q2.16 kind of unsigned gain value.
The driver has never set the min/max volume values in volume
new() IPC so the macro values VOL_MAX (+42 dB) and VOL_MIN (mute)
are used instead as limits.

The overflow in generic C code with s16 format is fixed. The
comments about volume Q format are updated.

The optimimized xt-xcc version of volume is changed to use 64
bits for multiply result to avoid loss of LSB bits in left shift
after multiply. With 64 bit result there is no need to scale the
volume multiplier as it was done with use of 32 bit multiply
result.

The cmocka volume type is changed to signed integer to match
component type used in this patch. The xtensa AE integer types
are signed so better to avoid unsigned gain values. The volume
scale in reference volume does a small error and cannot handle
above 0 dB max so it is changed as well. The test levels are
changed to exercise gains above and below 0 dB.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-04-18 22:06:13 +02:00
Slawomir Blauciak 0b56f064c2 kpb: rename comp_data struct to avoid conflicts
The kpb's comp_data struct is located in a public header,
which will be used by different components.
As such, it would cause conflicting definitions.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-04-18 12:51:01 +01:00
Janusz Jankowski c93670853f test: pipeline: remove mock for removed scheduler function
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Janusz Jankowski adc6cbe1be test: component: add missing header
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Janusz Jankowski 426647343f test: selector: remove unused variables
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Janusz Jankowski 51ef2db3d2 test: fix kpb compilation with -Werror
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Janusz Jankowski cfc78646e6 test: fix mixer compilation with -Werror
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Seppo Ingalsuo 22ecaa41e1 Component: Add comp_get_copy_limits() function for copy() preparations
This patch adds into component.c/h an utility function and
a data structure to simplify audio component's copy() method code.

The do-nothing function pipeline_xrun() is added to avoid cmocka test
fail due to adding function comp_get_copy_limits().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-04-02 09:53:29 +01:00
Tomasz Lauda c14554349f component: add check if optional comp_ops are available
Adds check if optional comp_ops are available.
This patch also adds assert for mandatory ops.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-04-01 14:54:43 +01:00
ArturX Kloniecki 25cd7795cc debugability: extend core dumps to provide AR registers.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-03-27 21:10:48 +00:00
Janusz Jankowski d33f8c99a1 test: rename CHECK to UNIT_TEST
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-03-25 14:11:47 +00:00
Jakub Dabek f8703cd32c memory: changed memcpy calls to memcpy_s in audio lib
Signed-off-by: Jakub Dabek <jakub.dabek@linux.intel.com>
2019-03-21 16:51:51 +00:00