Commit Graph

4563 Commits

Author SHA1 Message Date
Constantin Raducanu 9662439b8e alloc: Remove the unnecessaries spaces after casts
This commit removes the unnecessaries spaces after casts, fixing
the checkpatch error: "No space is necessary after a cast".

Signed-off-by: Constantin Raducanu <raducanu.costi@gmail.com>
2020-03-04 22:20:06 +00:00
Fred Oh 752f086bdc topology: add platform sku files to config platform settings
icl, cml whl are sharing some toplogy files. Create platform specific files
including DSP configuration, SSP setting and DMIC to simplify platform
settings.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-03-04 22:17:15 +00:00
Janusz Jankowski 9e1a2b251a panic: noreturn attribute for scan build
Add noreturn attribute to decrease number of
false positives when using assert / panic.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-04 11:02:56 +01:00
Janusz Jankowski 1ff2760500 panic: ignore asm in scan build
Clang cannot compile some xtensa-specific ASM, so it
has to be ignored when running static analysis.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-04 11:02:56 +01:00
Janusz Jankowski 4d02a1faf7 script: clang scan-build for xtensa
Add utility scripts for launching clang static analyzer.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-04 11:02:56 +01:00
Janusz Jankowski 4da2c9659c xtensa: cmake: clang scan build support
Add support for compiling FW with settings acceptable for clang,
in order to let it perform static analysis on the code.

Clang works mostly on ASTs made out of C code, so there is
no need to build complete signed binary for it.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-04 11:02:56 +01:00
Janusz Jankowski 6f7bf63417 cmake: build option for clang static analyzer
Add option for building FW for clang's scan-build.
This static analyzer works out-of-the-box only for compilers
compatible with Clang. For most of embedded compilers
there will be some adjustment needed when BUILD_CLANG_SCAN
is enabled. This flag is not suitable for every build scenario,
it has to be supported for given toolchain / architecture.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-04 11:02:56 +01:00
Janusz Jankowski 9cfe3eb8b0 xtensa: cmake: refactor fw postprocessing
Separate post-processing steps to not have fw image parts building
mixed with tools processing.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-04 11:02:56 +01:00
Tomasz Lauda 70ab103e88 mixer: fix state transition
Mixer shouldn't go into COMP_STATE_PREPARE if there is at least
one source in COMP_STATE_PAUSED.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-04 09:25:49 +01:00
Daniel Baluta 182e62a198 drivers: sai: Add support for SAI new version
New IP version introduces Version ID and Parameter registers
and optionally added Timestamp feature.

VERID and PARAM registers are placed at the top of registers
address space and some registers are shifted according to
the following:
    Tx/Rx data registers and Tx/Rx FIFO registers keep their
    addresses, all other registers are shifted by 8.

SAI Memory map is described in chapter 13.10.4.1.1 I2S Memory map
of the Reference Manual [1].

In order to make as less changes as possible we attach an offset
to each register offset to each changed register definition. The
offset is specified via CONFIG option. We now that this new SAI
version is supported only for i.MX8M.

[1]https://cache.nxp.com/secured/assets/documents/en/reference-manual/IMX8DQXPRM.pdf?__gda__=1583251106_f508ef5d5353cd8fc33150778708874b&fileExt=.pdf

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-03 20:45:40 +02:00
Daniel Baluta b2254b34b0 drivers: sai: Make indentation consistent
Always use one tab between a macro name and its definition.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-03 20:45:40 +02:00
Karol Trzcinski 2746df76b9 ssp: Use *BIT* macros instead of raw bit operations
Introduced solution is more elegant and reliable because of
masking given argument in SET_BITS.
Moreover remove unused masks which usability is taken by SET_BITS
macro with given bits range.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-03 10:47:09 +00:00
Seppo Ingalsuo 4230375781 Rename sample_bytes() and frame_bytes() to avoid variables shadowing
The two functions in sof/audio/format.h are renamed to more descriptive
get_sample_bytes() and get_frame_bytes() to avoid potentially same
name variables to shadow the inline functions defined in the header.

The shadowing happened in component ASRC. The DAI component and another
header audio_stream.h uses these functions and needed minor edits.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-03 10:34:38 +00:00
Seppo Ingalsuo 0110241b0d SRC: Remove non-used local variables updates
This patch removes redundant code. The local variables update were
remains of executing the changed if statements as while loop. Since
it is no more done the code can be simplified.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-03 10:34:38 +00:00
Pierre-Louis Bossart c2c7e117b5 ipc: dai: remove unused hdr field in params
We don't use this field, move back to reserved.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-03-03 10:07:59 +00:00
Bartosz Kokoszko 4f3f93d929 comp: remove output_rate field from comp_dev struct
This commit removes unused output_rate field from
comp_dev struct. If needed, component can retrieve
rate parameter from sink/source buffers.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-03-02 19:12:30 +00:00
Bartosz Kokoszko 01b41286fd dai: overwrite hardware frame_fmt parameter with private frame_fmt
Overwrite frame_fmt hardware parameters with DAI private frame_fmt
in dai_comp_get_hw_params() function as DAI component is able to
convert stream with different frame_fmt's

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-03-02 19:00:54 +00:00
Tomasz Lauda 3609fa6fc6 ipc: use notifications allocated by sources
Changes implementation of notifications allocation.
Instead of using common empty list of messages let's
switch to allocating message per source of notification.
This way we won't have problem with memory and lack of
empty messages and also we will be able to optimize memory.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-02 13:28:52 +01:00
Tomasz Lauda 9e36c5c985 ipc: add helper methods for notification allocation
Adds helper methods for IPC notifications allocation and free.
This way we can allocate only the size we need without preallocating
the maximum size. Free operation automatically handles synchronization.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-02 13:28:52 +01:00
Tomasz Lauda 3329db0a1d ipc: add helper methods for building notifications
Adds helper methods for initial building of IPC notifications.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-02 13:28:52 +01:00
Tomasz Lauda ab2878e527 ipc: add improved functions to sending notifications
Adds improved implementation for sending IPC notifications
to host. New function takes ipc_msg directly and adds
it to message queue if message is not already there.
Also critical notifications will be sent right away
or added to the beginning of the queue if sending fails.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-02 13:28:52 +01:00
Tomasz Lauda 854ed29153 ipc: return status on notification sending
Returns status -EBUSY, when IPC upstream channel is
currently busy and notification cannot be sent.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-02 13:28:52 +01:00
Tomasz Lauda 363d5e4b45 ipc: add is_notification_pending parameter
Adds additional parameter to control whether upstream IPC
channel is currently free or not. It's helpful in case
for some reason checking IPC bits is not enough.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-02 13:28:52 +01:00
Karol Trzcinski c3db256ac5 bit: Upgrade BIT macro to use 1UL instead of 1
In such a solution it is possible to assign BIT(31) to
uint32_t register value without any warning.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-28 21:13:41 +00:00
Diana Cretu c41aa4e8d1 CI: travis: Add boot test for i.MX8X
i.MX8X is now supported in qemu up to boot. So, add
it to boottest list.

Signed-off-by: Diana Cretu <diana.cretu@nxp.com>
2020-02-28 16:50:56 +00:00
Diana Cretu 866ddf874c scripts: qemu: Add qemu check for i.MX8X platform
Enable checks to i.MX8X platform of QEMU now.

Signed-off-by: Diana Cretu <diana.cretu@nxp.com>
2020-02-28 16:50:56 +00:00
Pan Xiuli ee8e4bfcbb scripts: fix issue in qemu-check.sh
Fix false positive return value for upsupported platforms.
Fix wrong parameter passed in when mutliple platform test.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-02-28 16:38:20 +00:00
Bartosz Kokoszko 6b250ff8a9 mux: move fetching proc function from prepare() to set_values()
This commit moves fetching mux/demux processing functions from
mux_prepare() to mux_set_values(). It insures us against
situation when we fetch proc_func in mux_prepare() and
after that comes mux_set_values() with new mux config.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-28 16:21:59 +00:00
Pierre-Louis Bossart a86cb76eb8 src: align prototype arguments
Fix cppcheck warning:

[src/include/sof/audio/src/src.h:118] -> [src/audio/src/src.c:96]:
(style, inconclusive) Function 'src_buffer_lengths' argument 1 names
different: declaration 'p' definition 'a'.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-28 15:18:58 +00:00
Pierre-Louis Bossart fda44df9bd gpio: fix operator precedence warning
fix cppcheck warning:

[src/drivers/dw/gpio.c:38]: (style) Clarify calculation precedence for
'&' and '?'.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-28 15:18:58 +00:00
Pierre-Louis Bossart 332d422ac1 dw-ssi-spi: comment out unused field
Fix cppcheck warning:

[src/drivers/dw/ssi-spi.c:111]: (style) struct member
'spi_reg_list::ctrlr1' is never used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-28 15:18:58 +00:00
Pierre-Louis Bossart 675c984b32 dw_dma: fix operator precedence warning
Fix cppcheck warning

[src/drivers/dw/dma.c:292]: (style) Clarify calculation precedence for
'&' and '?'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-28 15:18:58 +00:00
Pierre-Louis Bossart 73dce1cef5 kpb: fix unused variable warning
Fix cppcheck warning

[src/audio/kpb.c:1233]: (style) Unused variable: dst
[src/audio/kpb.c:1376]: (style) Unused variable: dst
[src/audio/kpb.c:1377]: (style) Unused variable: src

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-28 15:18:58 +00:00
Pierre-Louis Bossart 85896a4c58 kpb: remove useless assignments
Fix cppcheck warnings

[src/audio/kpb.c:202]: (style) Variable 'temp_ca_size' is assigned a
value that is never used.

[src/audio/kpb.c:742]: (style) Variable 'current_time' is assigned a
value that is never used.

[src/audio/kpb.c:946]: (style) Variable 'local_buffered' is assigned a
value that is never used.

[src/audio/kpb.c:948]: (style) Variable 'drain_interval' is assigned a
value that is never used.

[src/audio/kpb.c:954]: (style) Variable 'period_bytes_limit' is
assigned a value that is never used.

[src/audio/kpb.c:984]: (style) Variable 'local_buffered' is assigned a
value that is never used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-28 15:18:58 +00:00
Pierre-Louis Bossart 023292c66b detect_test: fix strange code pattern
Fix cppcheck warning (ret not modified between two returns).

[src/audio/detect_test.c:700] -> [src/audio/detect_test.c:710]:
(warning) Identical condition 'ret', second condition is always false

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-02-28 15:18:58 +00:00
Pan Xiuli f933116807 scripts: docker: update the qemu branch to sof-v4.2
Update qemu docker branch to sof-v4.2

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-02-28 15:17:19 +00:00
Pan Xiuli af8843d110 CI: travis: add host build
host build is missing during previous scripts refine.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-02-28 15:17:19 +00:00
Karol Trzcinski d313bcf9fc ssp: Use register name instead of bit value
Introduce SSTSA_TXEN and SSRSA_RXEN macro to define bit value in
header file instead of usage raw value in source code.
Moreover use SET_BITS to set Rx/Tx slot value.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-28 11:15:31 +01:00
Karol Trzcinski 37fc1b6322 ipc: Remove SOF_IPC_EXT_DMA_BUFFER
This enum code, and whats more important, related structures is
unused in whole source code, so it shouldn't be kept.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-27 19:55:45 +00:00
Karol Trzcinski 8015acfddc ipc: Make sof_ipc_ext_data enum value more rigid
It's a part of ABI interface, so enum value shouldn't change
for example after removing some old enum code.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-27 19:55:45 +00:00
Karol Trzcinski 69b03e4310 ssp: Move conversion from SSCR3 value to RFL to bit description section
This conversion in source code looks quite magic. It should be described
in header file where are registers bits description.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-27 19:30:46 +00:00
Karol Trzcinski f606940480 rimage: Return error code when problem with file opening
When some error occur during fopen routine, then errno should be
returned instead of success code.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-27 18:04:55 +02:00
Marcin Maka 22ddf1e210 abi: define debug abi version for user space dbg interfaces
The sof-logger and potentially other debug API clients perform ABI
compatibility check using the single FW ABI version. The same one is used
by the primary FW client which is the kernel driver. If there is a change
made to the debug API, the main ABI has to be updated to protect integrity
of the debug tools while such a change may not affect the kernel driver
at all.

This patch introduces new debug ABI version to be increased when changing
user space debug interfaces while the the main ABI is not affected.
Recompilation and installation of the new driver every time the tunneled
debug protocol is upgraded may be avoided.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-27 13:07:17 +01:00
Karol Trzcinski 51a3234458 testbench: Fix build error
There was missing argument in file_get_hw_params, what breaks compilation.

Fixes: 2b84838 ("Testbench: Instantiate file component as host")
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-27 11:19:39 +02:00
Seppo Ingalsuo 109450e6fd Tools: Test: Update SRC testbench run script
This patch updates the SRC to run with the updated test topologies
set. The script is also cleaned up a bit.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-26 22:29:10 +00:00
Seppo Ingalsuo a4c663fbd7 Tools: Fix build of fuzzer due to testbench topology parser updates
This patch updates the load_aif_in_out(), load_dai_in_out(),
and load_pipeline() calls similarly as done for testbench to
prevent the Fuzzer build fail.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-26 22:29:10 +00:00
Seppo Ingalsuo 0bce9e4f36 Testbench: Instantiate file component as host or DAI and other updates
This patch fixes the fail to execute tests due to recent pipeline
updates. Now the fileread and filewrite component is instantiated
as host or DAI depending on stream direction. The DAI file component
is added the capability to report HW stream parameters. In testbench
case the stream parameters originate from command line parameters.

The file params() handling is updated to be similar as in other
components to successfully propagate the parameters.

The added capture pipelines support is not fully functional and will
be fixed later.

The testbench cleanup includes elimination of global variables for
certain component ids. The needed misc parameters were added to
testbench parameters struct that is passed through most topology
parsing functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-26 22:29:10 +00:00
Seppo Ingalsuo fc167f5e56 Tools: Test: Clean up test topologies build and update pipeline macros
This patch updates the tplg-build.sh script by omitting DMIC capture
test topologies generation, tone topolgies generation due to no
use and no maintenance. They can be fixed later.

The all DAI permutations are generated only for volume pipeline. The
src is removed. Instead a new algorithms topologies generation loop
is added for UP2 (APL) compatible topologies. The algorithms are
ASRC, FIR, IIR, and SRC.

The test-all, capture, playback macros are updated to use
PIPELINE_PCM_ADD and set up DAI for SCHEDULE_TIME_DOMAIN_TIMER. The
duplication of TEST_DAI_PORT in macro call is replaced by 0 to
prevent topology load fail on device.

The test-equalizer-playback-ssp.m4 is removed as obsolete.

Pipelines are added for FIR and IIR playback and capture. SRC playback
pipeline is improved by making tokens instance specific. The SRC
capture pipeline macro is only cosmetically improved.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-26 22:29:10 +00:00
Seppo Ingalsuo 9cbd085c07 ASRC: Let ASRC access all available frames on the variable rate side
The previous copy() function frames computation code contained
a mistake that unnecessarily prevented the filter core to access
more than nominal amount of samples from source buffer in pull mode.
It have corrupted occasionally input PCM samples and possibly
could have stalled the algorithm with an impossible processing amount
constraint.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-26 22:27:54 +00:00
Adrian Bonislawski 21f1344862 probes: add probes to sof main context
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-02-26 16:25:02 +00:00