Commit Graph

3171 Commits

Author SHA1 Message Date
Marcin Maka 322e150080 trace: add uuid to trace entry and remove trace ids
New trace entry parameter is defined: uuid of the source.
Technically, this is an address of uuid entry linked
inside a special section in elf.

Has_ids is removed from the static log entry since eventually
all entries will use uuids and -1 detection is good enough
detection for those who still do not provide ids.

Note: both changes are done in a single patch to avoid two
major dbg-abi version bumps.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-06 10:15:04 +01:00
Marcin Maka 3100546463 uuid: add simple static uuids linked to ldc section
Unique identification in form of Guid is much more
scalable for fw parts (components, dais, ...) then
existing ids and trace class ids.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-06 10:15:04 +01:00
Karol Trzcinski 9ebb2881e5 dma: Add time unit in comment in dma_chan_data.period description
Time unit is crucial to properly use this field so it is convenient
to have it written in comment near field declaration.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-05 17:10:48 +02:00
Tomasz Lauda c60bcd0aa6 pcm_converter: enable HiFi3 version by default
Enables HiFi3 version of PCM converter.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-05 11:03:53 +00:00
Pan Xiuli b23ca03111 ipc: add error trace with size for page descriptors alloc
Add error trace with buffer size for heap to help debug
the page descriptor issue.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-03-05 11:01:42 +00:00
Karol Trzcinski d84629814b ipc: In channel ipc/channel_map.h remove dependency from sof/common.h
After introducing compiler_attributes.h it is possible to make
this dependence shorter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-05 11:33:14 +01:00
Karol Trzcinski a30c1d0f45 sof: Replace __attribute__((section(x))) to __section(x)
Use new standard in source code.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-05 11:33:14 +01:00
Karol Trzcinski 32e0b1d0b0 sof: Add __section macro
New introduced macro is much shorten, have less parethesiss and
create possibility to easy change __section behavior in future
what is relevant in cross-platform source code.
Using such a macro is preferred way to define target section
in used checkpatch version.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-05 11:33:14 +01:00
Karol Trzcinski ff1a981449 sof: Separate __packed and __aligned from sof/common.h
This part of source code is frequently used in IPC packets
definitions, so it shouldn't have any platform dependence.
After change this file may be include from mentioned place
without any doubt about ipc message dependances from used
sof build configuration.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-05 11:33:14 +01:00
Lech Betlej 034c54a16a cavs: clk: add Kconfig option to select default ro clock
The change allows to select at a configuration time default clock for
cavs 2.x platforms (Icelake, Jasperlake, Tigerlake) on top of already
enabled support for cavs 1.8. By default the LP clock is set (120 MHz
- platform dependent). In case of workloads that require HP clock
(400 MHz) system integrator shall select the right clock as a part of
FW configuration process.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2020-03-05 10:45:58 +01:00
Constantin Raducanu ab5be85cb9 alloc: Add spaces around operator '/'
This commit adds spaces around the operator '/', fixing the checkpatch
error: "spaces preferred around that '/'".

Signed-off-by: Constantin Raducanu <raducanu.costi@gmail.com>
2020-03-04 22:20:06 +00:00
Constantin Raducanu 89ae27e3f4 alloc: Remove empty line after open brace
This commit removes the empty line after the open brace,
fixing the checkpatch error: "Blank lines aren't necessary
after an open brace '{'".

Signed-off-by: Constantin Raducanu <raducanu.costi@gmail.com>
2020-03-04 22:20:06 +00:00
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
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 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 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
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
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
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
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
Adrian Bonislawski 8d7274e911 probes: Implement injection probe flow
Implement probes injection capability for several probe points

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-02-26 16:25:02 +00:00
Adrian Bonislawski 9d25e1984a probes: Implement extraction probes flow.
Implement buffer lifecycle callbacks to properly handle extraction
from probe. Implement probe data packet header generation and sending
it along with data from buffer via extraction DMA.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-02-26 16:25:02 +00:00