Commit Graph

3556 Commits

Author SHA1 Message Date
Janusz Jankowski f99f276e49 kconfig: IS_ENABLED macro
Allows checking preprocessor symbols in compile-time.
Returns true for config with value 1, false for undefined
or any other value.

Expression like (CONFIG_MY ? a : b) rises compilation error when
CONFIG_MY is undefined, (IS_ENABLED(CONFIG_MY) ? a : b) can be
used instead of it.

It is intended to be used with Kconfig's bool configs - it should rise
error for other types, except positive integers, but it shouldn't be
used with them.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-19 13:33:43 +02:00
Marcin Rajwa 0652cb186d handler: rework ipc_cmd to return only once and log last request
This patch edit ipc_cmd (main ipc dispatcher) to return only at
the end of the function. This simplifies debugging a lot.
Along with that change additional log has been added at the
end of the function to show what was the the last request
and its return value.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-18 17:51:53 +02:00
Tomasz Lauda db000b3276 spinlock: detect_test: move forgotten includes
Moves forgotten includes to their right place.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-18 16:00:24 +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
Keyon Jie 200dee8cc7 alloc: fix the heap alloc trace infinite loop issue
The while loop in alloc_trace_runtime_heap() and
alloc_trace_buffer_heap() will always get the first matched heap from
get_heap_from_caps() and the loop will run infinitely.

This patch create a function alloc_trace_heap() which will be passed in
different heap_base and heap_count to fix the issue mentioned, and both
runtime_heap and buffer_heap can reuse this same function for tracing.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-18 12:04:13 +02:00
Bartosz Kokoszko b66a6d5c10 dai: use periods from sof_ipc_comp_config in dai_params()
In dai_playback_params() and dai_capture_params()
functions we do not have to take period values
from adjacent component. We can retrieve it from
dai component sof_ipc_comp_config struct.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-07-17 15:48:11 +02:00
Keyon Jie 720cdcda67 sof-ctl: fix ABI dumping doesn't work issue
For dumping to output file without '-r', we need to dump ABI header,
here fix it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-17 12:00:54 +02:00
Tomasz Lauda 62035b22fc host: move memory defines to appropriate header
Moves memory defines for host architecture to
memory.h.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-16 15:02:06 +02:00
Tomasz Lauda eb6378cb4b component: move DECLARE_MODULE macro
Moves DECLARE_MODULE macro from common.h to
audio/component.h header. It needs config.h
header, which shouldn't be included from common.h,
because it might be indirectly included by external
user applications.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-16 15:02:06 +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 fe342f020a lib: cleanup includes
Cleanups includes in all lib 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 b193c04d1c ipc: cleanup includes
Cleanups includes in all ipc 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 81f4b9229f schedule: cleanup includes
Cleanups includes in all schedule 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 34c76fc78f math: cleanup includes
Cleanups includes in all math 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 c5f9b1d7e9 task: cleanup includes
Cleanups includes in task file.
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 ba56ccac4f init: cleanup includes
Cleanups includes in init file.
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 c1439168a0 gdb: cleanup includes
Cleanups includes in gdb file.
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 b3a04c7477 audio: cleanup includes
Cleanups includes in all audio files.
Unused headers has been removed and needed
has been added.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-16 15:02:06 +02:00
Tomasz Lauda 38f3f3d7ba arch: cleanup includes
Cleanups includes in all architecture 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 77f94b8ce5 gdb: move xtensa specific defines to arch
Moves xtensa specific defines from generic code
to xtensa arch.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-15 13:29:29 +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 0317a7bce5 sof: change approach to including platform headers
Right now we have headers spread across main sof include
directory, arch include directory and platform include
directory. The same header e.g. cpu needs to be included
from sof, arch and platform. This creates long inclusion
lists and often we are missing many headers, but since
they are already included in some other headers, we don't
see the issue. This patch changes the approach to including
platform headers. It allows for inclusion only from main
header e.g. sof/cpu.h will include arch/cpu.h and platform/cpu.h.
If we want to use some cpu functionality we only need to include
sof/cpu.h and don't worry about the rest. If we have platform
header, which is only used inside of platform code, then
it can be directly accessed within.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-15 13:29:29 +02:00
Tomasz Lauda 807815f41b include: cleanup inclusions in ipc, kernel and user headers
Cleanups inclusions in ipc, kernel and user headers.
Some of the headers were missing and some weren't needed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-15 13:29:29 +02:00
Tomasz Lauda 0648828b2b cavs: allow for header inclusion only from platform code
Adds preprocessor check in cavs headers and throws error,
when they are included from outside of equivalent platform
headers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-15 13:29:29 +02:00
Tomasz Lauda ceb35857b6 arch: unify include guards naming
Unifies include guards naming in arch headers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-12 16:12:59 +02:00
Tomasz Lauda 58d3774948 platform: unify include guards naming
Unifies include guards naming in platform headers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-12 16:12:59 +02:00
Tomasz Lauda c33687544f sof: unify include guards naming
Unifies include guards naming in ipc, kernel, sof
and user headers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-12 16:12:59 +02:00
Tomasz Lauda 119746d206 common: replace __attribute__((packed)) with __packed
Replaces all occurrences of __attribute__((packed)) with
__packed macro.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-12 16:12:59 +02:00
Tomasz Lauda a46e786aed common: extract common helper macros to separate header
Extracts common helper macros to separate header called
common.h.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-12 16:12:59 +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
Tomasz Lauda ededbb65fe arch: xtensa: remove deprecated stack defines
Removes deprecated stack defines as they are no longer
needed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-12 15:05:57 +02:00
Seppo Ingalsuo 4870332719 Topology: Updates for single EQ pipeline definitions
This patch provides needed maintenance. The pipelines
missed the volume ramp tokens and caused topology build fail for
topologies those would use the pipeline macros
pipe-eq-fir-volume-playback.m4 and pipe-eq-iir-volume-playback.m4.

The embedded filter coefficients in these pipelines were replaced
by included default FIR and IIR filter coefficients to fix ABI
incompatibility in the configuration blobs and ease future
maintenance of these pipelines.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-07-12 09:24:51 +02:00
Keyon Jie 09b416bb5a topology: sof-cml-rt5682-max98357a: switch to use kwd pipelines
Switch to use sof-cml-rt5682-kwd.m4 which can support Keyword Detect
feature.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-11 15:32:01 +02:00
Keyon Jie b56fcbc44a topology: sof-cml-rt5682-max98357a: change BE id to align with machine
driver

The BE id for amplifier pipeline should be changed to 6 to align with
machine driver (The commit ASoC: Intel: sof-rt5682: correct naming for
dmic16k).

Cc: Sathya Prakash M R <sathya.prakash.m.r@intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-11 15:32:01 +02:00
Keyon Jie d1ae32a322 topology: sof-cml-rt5682: refining for dmic16k pipeline
Add volume component, change to use 16KHz sample rate, and modify the
PCM ID from 5 to 8, as it is in lower priority comparing with pipelines
like amplifier.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-11 15:32:01 +02:00
Tomasz Lauda 4cbfd88731 platform: cpu: extract core defines to separate headers
Extracts DSP core defines to the separate platform headers.
It was partially done before for cAVS platforms.
It's a step forward towards full header cleanup.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-10 07:58:44 +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 27cdfbdb40 m4: support for ssp bclk_delay token
BCLK delay is optional last value (after quirks),
in SSP_CONFIG_DATA.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-05 11:55:51 +02:00
Janusz Jankowski 098636c098 ssp: bclk delay parameter
Some codecs require BCLK to be on for some time,
before sending any data. It can be achieved with delay between
enabling BCLK and DMA that should be given in topology.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-05 11:55:51 +02:00
Keyon Jie 7e0d2661c7 pipeline: disable FW xrun recovery at the moment to rescue logs
Xrun recover failure will flush all over the memory window that we can't
get the log of the first error, let's disable it before the flag is
moved to kconfig and fw_ready IPC, to rescue logs and debugging.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-05 11:37:44 +02:00
Keyon Jie 40c2b9e80c dw-dma: add more logs when get avail/free data fail
We should not get 0 size from dw_dma_avail_data_size() and
dw_dma_avail_data_size(), if that happened, something might be wrong,
e.g. the dma channel is not enabled, here logging out the channel
enabling status for debugging.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-05 11:37:44 +02:00
Keyon Jie fcd727678e detect-test: refine the detect function
We should use the absolute value for the activation comparing, and no
need to take extra handling to those samples with low enough level.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-04 07:43:34 +01:00
Keyon Jie d2e5c6a78a sof-ctl: split and move ctl_setup out of main()
Move ctl_elem pointers and buffer initialization out of main(), and
replace calling alloca APIs with malloc ones to make they are shareable
between different functions.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie d5f359c0f4 sof-ctl: add '-t' to support specifying the component type
Firmware may use different component specified type in abi header, to
support more than one kcontrols for the same component, here add '-t' to
support specifying this component specified type in the abi header.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie a29032420b sof-ctl: add labels to handle failure paths
Add labels in main() to handle kinds of failure cases, with the code
cleanup together.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie e86ba1dcbf sof-ctl: add '-o' support to dump ctl data to a specified file
Here add '-o' to support output control data to the specified file, in
binary format.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie cc717a539e sof-ctl: add separated function for control set/get
Add a separated function ctl_set_get() for tlv set/get, and call it from
main().

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 5de89ad8c1 sof-ctl: add functions for buffer allocate and free
Split buffer allocating and freeing part from main(), add separated
functions and call them from main().

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie f3bc979112 sof-ctl: add macros for buffer offsets
Add macros for offsets in the ctl_data buffer, and switch to use them.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00