Commit Graph

4770 Commits

Author SHA1 Message Date
Adrian Bonislawski 6aef5b9134 probe: show correct dma in probe point info
This patch will ignore provided stream tag for extraction probe point.
It is used only for checking probe point info by the user and now for
all extraction points it will show the same and valid stream tag.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-03-28 12:07:57 +01:00
Janusz Jankowski e5a910d21b xtensa: cmake: use xt-ranlib
CMake should use ranlib that comes with toolchain.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-28 12:07:33 +01:00
Sebastiano Carlucci 521895e3a0 sof: dcblock: Fix unaligned pointer value issue
gcc-9 shows the following issue:
error: taking address of packed member of ‘struct sof_abi_hdr’ may
result in an unaligned pointer value [-Werror=address-of-packed-member]
   225 |   request = (int32_t *)cdata->data->data;
       |                        ^~~~~

This commit fixes the issue. The warning was introduced in GCC-9, and
was therefore not raised by previous compiler versions.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-28 12:03:23 +01:00
Tomasz Lauda de0d11c876 idc: wait for core to power up
Implements new IDC sending mode dedicated to powering up
the cores. Master core should wait until slave core reports
that is ready for further operations. Without such confirmation
there is a race possibility, where next IPC should be processed
by slave core, but it's not yet powered up.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-27 19:31:10 +01:00
Tomasz Lauda 978abac46e idc: wait for message receival using registers
Changes method of waiting for blocking IDC messages to
use appropriate IDC registers. This way we no longer
need additional boolean status variables and also
we don't need to enable IDC DONE interrupts.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-27 19:31:10 +01:00
Tomasz Lauda 3073aa5fc4 idc: extract waiting function
Extracts procedure for waiting in blocking mode for slave
core to receive the message.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-27 19:31:10 +01:00
Tomasz Lauda 85600db50f cpu: don't block interrupts on core power up
There is no need for blocking all the interrupts,
when powering up slave core. Only one path of execution
exists to do that anyway.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-27 19:31:10 +01:00
Tomasz Lauda 8e9eadcede trace: add trace point sw registers per core
Extends software registers to include trace point per core.
This way slave cores won't override boot status of one another.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-27 19:31:10 +01:00
Tomasz Lauda 1a01f7490f mailbox: add method for SW REG read
Implements method for software register read from mailbox.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-27 19:31:10 +01:00
Naveen Manohar bc5f3a6cde topology: add rt5682-sdw to TGL volteer configuration
Enable RT5682 located at SNDW LINK0, DMIC & HDMI Audio

Signed-off-by: Naveen Manohar <naveen.m@intel.com>
2020-03-27 15:19:19 +00:00
Fred Oh dc8cf3e4d5 topology: add equalizer to hda generic topology
Add EQIIR and EQFIR to first playback pipeline. This help to expand more
equalizer testing across platforms.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-03-27 11:49:08 +00:00
Fred Oh 890398a645 topology: add equalizer to cml rt1011 rt5682 topology
Add EQIIR and EQFIR to first playback pipeline. This help to expand more
equalizer testing across platforms.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-03-27 11:49:08 +00:00
Daniel Baluta 7341f43cad drivers: imx: sdma: Enhance channel status handling
Channel 0 is special. It goes from READY (at init) to ACTIVE (at run)
and then back to READY (at stop).

The rest of the channels go to PREPARE (at set_config) or they can be
SUSPENDED or PAUSED the same state machine as for EDMA.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-27 12:20:17 +02:00
Daniel Baluta 93dbbe2ca6 drivers: imx: sdma: Propagate some config info to channel
In particular we need to propagate is_scheduling_source and direction,
because later the fields from channel are used.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-03-27 12:20:17 +02:00
Payal Kshirsagar 090dd6ca3e src: platform: avoid NULL comparison
Replace NULL comparison with boolean negation.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:50:52 +01:00
Payal Kshirsagar ee45ce8b98 src: ipc: avoid NULL comparison
Replace NULL comparisons in the file to get rid of checkpatch warning.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:50:52 +01:00
Payal Kshirsagar 66fd8cefba tools: logger: avoid NULL comparison
Change suggested by coccinelle.
Avoid NULL comparison, compare using boolean operator.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:50:52 +01:00
Payal Kshirsagar 22be53b98a test: cmocka: src: avoid NULL comparison
Replace NULL comparison with boolean negation. Issue found using
Coccinelle.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:50:52 +01:00
Marcin Maka e197132dad comp: dox: correct old RZONE_RUNTIME name
Old name was overlooked in the component API documentation.
Corrected to SOF_MEM_ZONE_RUNTIME.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-27 10:43:23 +01:00
Marcin Maka 2d96e3978d alloc: dox: document the header
This header is an important part of API used frequently
by the developers and must be documented and referred
by the sof-docs.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-27 10:43:23 +01:00
Marcin Maka 36e58d279b alloc: replace r- macros with renamed functions
Once the debug version of allocation functions are removed,
macros may be replaced with functions declared without leading
_ which makes the documentation (and the header) more readable,
the defines section does not need to contain doubled documentation
of alloc api.

bzero macro is not esasily removable due to include deps which
bring earlier declaration of non-inline prototype.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-27 10:43:23 +01:00
Seppo Ingalsuo 8320376ab4 Testbench: Fix segfault in pipeline_new() in topology parsing
This patch fixes the crash by adding initialize of sof->pipeline_posn
into pipeline initialization code.

Also the in load_pipeline() function the pipeline is initialized
to zeros to prevent random values to be passed in not set
struct fields. It didn't fix anything but makes debugging of crash
easier.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-27 10:40:37 +01:00
Payal Kshirsagar 4bbdef7c16 src: probe: fix line exceeding 80 characters
Fix checkpatch warning of line over 80 characters.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:39:14 +01:00
Marc Herbert 483c26e7a1 panic: add __attribute__((noreturn)) #if __GNUC__
Commit 9e1a2b251a ("panic: noreturn attribute for scan build")

 added ((analyzer_noreturn)) but only for clang.

Fixes at least these two -Werr CONFIG_PROBE=y build failures and
probably similar others with a different .config or in the future:

   sof/src/probe/probe.c: In function 'probe_cb_produce':
   sof/src/probe/probe.c:635:11: error: 'valid_bytes' and
   'container_bytes' may be used uninitialized in this function
   [-Werror=maybe-uninitialized]

Build failure reproduced with xtensa-apl-elf-gcc (crosstool-NG
1.23.0.440-3b8c) 7.3.0

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-27 10:26:56 +01:00
Marc Herbert ba38c7d750 Testbench: panic() calls abort()
... as opposed to doing nothing and returning.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-27 10:26:56 +01:00
Marc Herbert 9b1b6158e3 tplg_parser: fix -Werror=maybe-uninitialized source, sink
Fixes:

tplg_parser.c: In function ‘tplg_load_graph’:
tplg_parser.c:979:2: error: ‘sink’ may be used uninitialized
                     in this function [-Werror=maybe-uninitialized]
  979 |  printf("loading route %s -> %s\n", source, sink);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 21:00:19 +00:00
Marc Herbert e73344a736 scripts: build-all: warn when ignoring unknown arguments
Example:

 $ ./scripts/xtensa-build-all.sh -j3
 ./scripts/xtensa-build-all.sh: WARN: ignoring arg -j3

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 16:51:29 +00:00
Sebastiano Carlucci 60fc730003 tools: testbench: Include dcblock in testbench
This commit adds support for running test for dc blocker.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci 2a5d1c41b9 sof: configs: Default DCB to n for cht and byt
The memory size for cht and byt is too small to include the DC Block
module. If the user wants to use it, they will have to disable some
other components.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci 0cf80e2d32 tools: test: Add DC Block test case to tplg-build
This commit includes a new test case in tplg-build.sh. It also includes
the new simple pipelines pipe-dcblock-capture/playback. Those new
pipelines are used by tplg-build.sh to generate the test pipelines.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci c6f83acd0e tools: tune: Add tools to generate bytes control
This commits adds the scripts to generate the bytes control blob
for the DCB. It also provides some generic scripts to convert
valid binary blob to a csv or binary file (usable by sof-ctl)
or an m4 byte control topology file.

This commit adds two new folders under tools/tune
- dcblock: scripts to generate the blob in Octave
- common: scripts to convert any generic blob to a config file.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci eae636c4ff sof: dcblock: Add DC Blocking Filter Component
This change provides a DC Blocking Filter (DCB) component. A DCB is a
high-pass filter used to remove any DC offset from a signal. The
coefficients for the component can be set individually for each channel.

Currently, only the following formats are supported:

s16_le
s24_le
s32_le

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Payal Kshirsagar 9d9620ae05 src: drivers: intel: baytrail: replace bit shifting with BIT macro
Change suggested by coccinelle.
Replace bit shifting on 1 with the BIT(x) macro.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-26 14:45:19 +01:00
Iulian Olaru 0bd34f5486 math: Make binary gcd work with negatives
This patch makes the binary gcd algorithm work for negative
numbers by turning them into positive ones. Works since
gcd(a, b) = gcd(-a, -b) = gcd(-a, b) = gcd(a, -b)

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-03-26 12:12:55 +00:00
Iulian Olaru 303ed59e87 test: Add extra tests fot gcd
This patch adds extra tests for the gcd of
(0, 0), (a, 0), (0, b), (-a, -b), (-a, b), (a, -b)

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-03-26 12:12:55 +00:00
Iulian Olaru ea9aebfa7a math: Replace the gcd algorithm
This patch replaces the former gcd algorithm which was implemented with
repetitive divisions with Stein's algorithm, whitch is a faster gcd
algorithm. All operations are arithmetic shifts, comparisons and
subtractions.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-03-26 12:12:55 +00:00
Marc Herbert ffedf5be56 scripts: build-all: postpone VERBOSE decision to "make" time
CMAKE_VERBOSE_MAKE was sometimes "hardcoding" the decision in CMake's
cache. Move that decision to the make invocation.

After running xtensa-build-all.sh [-v], it's now possible to choose
again whether "make -C build_apl_gcc/" should be VERBOSE or not without
starting from scratch and with the exact same configuration.

Before this commit it was possible for make to decide again after a
non-verbose xtensa-build-all.sh but not possible to decide again after a
verbose xtensa-build-all.sh... very confusing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 12:10:38 +00:00
Karol Trzcinski 93f8859148 sof: trace: Remove error prefix from logs
This prefix is added in logger converter, so it shouldn't be
added manually.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 11:56:20 +00:00
Fred Oh f734991fbe topology: enable eq pipeline when EQ is enabled in makefile
Instead of making new files for audio equalizer topology, reuse existing
topology and replace only volume pipeline by macro replacement.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-03-26 10:18:11 +00:00
Marcin Maka 2627dd47d8 alloc: deduplicate allocation debug traces
There is no need for that many macros in the header.
The optional debug code can be inserted into the allocation
functions.

There is no need for dedicated debug trace functions for
runtime and buffer heaps. Merging the parameter setup
into switch inside a single alloc_trace_heap() function
reduces the debug ptr verification macros to a single
common one.

Once the debug code is moved from the header to .c file,
there is no need to expose memory unit trace macros that
should be internal.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-26 10:09:32 +00:00
Marcin Maka 0f88be3e1a mm: separate alloc api and heap mgmt api
All clients that just wants to allocate and free memory
does not need to know all the heap management api
and internals.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-26 10:09:32 +00:00
Marcin Maka 3a85a3d648 alloc: fix debug trace compilation
There was old RZONE_BUFFER symbol left in the debug code, not
changed to SOF_MEM_ZONE_BUFFER.
Went under the radar so far since the DEBUG config options are
not included in CI builds yet.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-26 10:09:32 +00:00
Seppo Ingalsuo 3ce54df7b8 Tools: Test: Audio: Add double quotes to shell scripts
This patch adds the double quotes to shell scripts to avoid fails
with arguments or shell variables when there are space characters.

The processing components run scripts are all edited for better
structure with functions usage() and main() and with local variables
within functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-26 10:03:16 +00:00
Payal Kshirsagar 8ce242b40b src: drivers: intel: baytrail: remove unnecessary parentheses
Remove unnecessary parentheses around the right hand side of an
assignment.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-26 09:55:48 +00:00
Payal Kshirsagar 6dd5e22f32 src: platform: intel: cavs: lib: remove unnecessary parentheses
Remove unnecessary parentheses around the right hand side of an
assignment.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-26 09:55:48 +00:00
Karol Trzcinski 7bf879b226 tools: logger: Add clock parameter in help message
help message should explicity show that -c flags needs parameter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski fc84534247 tools: logger: Add LDC dump option
Create dump options for logger to print important information from
LDC file, like DBG_ABI version and UUID with corresponding names.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski ee692abd97 tools: logger: Refactor format_uid()
Split this function to part responsible for pointer calculation
and string formatting. It make possibility to use same
string format with different pointer arithmetic.
Moreover introduce aprintf to make memory allocation for output
string more automated process.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski e087ed7aa4 tools: logger: Align logs header to content
Double space in formatting string led to little mismatch between header
and content in output logger file.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Bard Liao ae53aebcff topology: sof-icl-rt711-rt1308-rt715-hdmi: define NO_AGGREGATION mode
We will create individual PCM for each speaker when NO_AGGREGATION
is defined

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-25 13:10:48 -05:00