Commit Graph

5868 Commits

Author SHA1 Message Date
Guennadi Liakhovetski 4316f3c836 alloc: simplify align_ptr()
Simplify the align_ptr() function by re-using an existing ALIGN() macro.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-12-15 14:13:33 +00:00
Guennadi Liakhovetski da073fbf80 core: optimise ALIGN_UP() to only use 1 division
No need for two divisions for an alignment macro, one is enough.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-12-15 14:13:33 +00:00
Pan Xiuli 5ea80a51eb travis: add tgl-h build
Add tgl-h build check in Travis

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-12-15 14:08:54 +00:00
Seppo Ingalsuo 9c33333cf5 Math: IIR: Fix overflow in DF2T generic C version biquad output
With coefficients scaling that creates above 1.0 absolute value
internal biquad output before scaling gain and shift there's
overflow in variable tmp calculation that is used for output
and for recursive a1, a2 coefficients multiplication.

Fixes: #3678

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-12-15 14:07:54 +00:00
Curtis Malainey 918f22c206 dai: add fall through markers for clang
for some reason the clang version with oss-fuzz doesn't recognize the
comments so lets add this attributes in the meantime. XCC does not like
them so lets only use them with clang.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-12-15 13:44:02 +00:00
Seppo Ingalsuo 51b64f460a Tools: Tune: Add variable initialize to EQ blobs plotter
This fix adds initialization and declaration of variable f_single
to avoid a previously overlooked error when accessing it in the
end of script. It produces the plot but with a warning print.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-12-15 13:39:06 +00:00
Jaska Uimonen fc9b89ad8b topology: add enum control
Add m4 macros to generate enumerated control. Usage is similar to mixer
and bytes control except enumerated values are specified using separate
text section.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-12-10 22:30:42 +00:00
Curtis Malainey 6823206761 oss-fuzz: add seed corpus
There are simply a dump of a series of messages from the kernel of
messages sent to the firmware. This will be used by the fuzzer to infer
inputs to tests against the the firmware.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-12-10 22:26:25 +00:00
Curtis Malainey 0a7df45e87 library: add trace and shared memory region
Trace is enabled by default for library builds, but the module is not
included. This breaks the ipc handler. Therefore lets include it and
give it a mocked section of memory to write to.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-12-10 22:26:25 +00:00
Curtis Malainey 44c72a4f25 library: refactor init sequence
The fuzzer is makings its way into a lot places where we assume hw
configs exist. Therefore a refactor is needed make it easy to fill in
the missing configs.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-12-10 22:26:25 +00:00
Pin-chih Lin 9e0a560746 sof: multiband_drc: Add Multiband DRC component
Multiband DRC is a single-source-single-sink compound component which
consists of 4 stages: Emphasis Equalizer, Crossover Filter (from 1-band to
4-band), DRC (per band), and Deemphasis Equalizer of summed stream.

The following graph illustrates a 3-band Multiband DRC component:

                                 low
                                o----> DRC0 ----o
                                |               |
                      3-WAY     |mid            |
x(n) --> EQ EMP --> CROSSOVER --o----> DRC1 ---(+)--> EQ DEEMP --> y(n)
                                |               |
                                |high           |
                                o----> DRC2 ----o

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-12-09 13:52:14 -08:00
Pin-chih Lin 1e3adabd19 sof: crossover/drc: Expose algorithm functions
Some algorithm functions of crossover and drc are exposed to share the
usage from other components, e.g. a multi-band drc which includes
crossover and drc inside.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-12-09 13:52:14 -08:00
Pan Xiuli 316d4351e1 rimage: Update to commit d1f91efdc1
Use an upstream commit instead for developing commit.

Included following feature:
rimage cavs 2.5 support
add verify feature
rimage support for TGL-H

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-12-09 11:06:31 +00:00
Pan Xiuli c46ed5df30 scripts: add tgl-h support
Add tgl-h build support.
It will generate sof-tgl-h.ri

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-12-09 11:06:31 +00:00
Pan Xiuli c65336f8f7 config: intel: set different fw_name for tglh
To support TGL-H build with different binary name, set
CONFIG_RIMAGE_SIGNING_SCHEMA to tgl-h to make sure
output file name matches requirement from Linux driver

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-12-09 11:06:31 +00:00
Keyon Jie aeea2b0935 topology: smart_amp: restrict channel number of PCM capabilities
Both the playback and capture PCMs should be restricted to the
corresponding SMART_PB_CH_NUM and SMART_REF_CH_NUM, as running them with
other channel numbers will not work correctly.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-12-07 11:44:16 +00:00
Guennadi Liakhovetski a68c756a30 dw-dma: align ILL allocations
ILL entries in the DW DMA driver are accessed both by the controller,
using DMA and by the DSP. For this to work the DSP has to force cache
synchronisation appropriately. Therefore the ILL area has to be
allocated with cache-line size alignment. This isn't the case with the
Zephyr allocator. This patch switches allocation from rmalloc() to
rballoc() to force such alignment. Eventually a generic fix will be
implemented in an SOF wrapper fpr the Zephyr allocator.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-12-07 10:58:36 +00:00
Seppo Ingalsuo cc1cd8a4af Tools: Test: Fix Matlab compatibility in process_test.m
The set of figure property in figure() command is not supported
in Matlab. The separate set() property works for both Octave and
Matlab.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-12-03 20:43:31 +00:00
Brent Lu 65217991dd topology: sof-tgl-max98357a-rt5682: support rt1011 amp
Add a macro 'CODEC' to generate topology for rt1011 speaker amp.
Add a macro 'FMT' to seperate speaker dai format: s16le, s24le
Modify both pcm name by 'Speakers'

Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2020-12-03 10:49:42 +00:00
Marcin Rajwa d08e7779d5 trace: fix missing trace variable for CONFIG_TRACEM
This patch adds missing trace variable for CONFIG_TRACEM.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-12-03 10:46:49 +00:00
Joseph Burt ddd3736634 ipc: Use DMA attribute for min. ptable copy size
This rounds up the page table DMA transfer size to DMA_ATTR_COPY_ALIGNMENT
instead of a hard-coded 4 bytes.

Signed-off-by: Joseph Burt <caseorum@gmail.com>
2020-12-03 10:40:01 +00:00
Joseph Burt 1edfe088ec ipc: Fix page table size calculation
This was too small, causing the ptable to be truncated and the
ptable DMA transfer to fail on BDW for small buffers, where the
minimum transfer is 4 bytes.

Signed-off-by: Joseph Burt <caseorum@gmail.com>
2020-12-03 10:40:01 +00:00
Sathyanarayana Nujella 12ce388775 topology: sof-smart-amplifier: update speaker amp ssp DAI configuration
Speaker amp's SSP tdm & clock is configured for 32-bit, accordingly
update DAI configuration to s32_le.

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
2020-12-02 21:44:16 +00:00
Jaska Uimonen 67f3b06d69 mux: check individual channels and not entire matrix row
Currently we are checking if matrix row contains any 1's (popcount). In
mux case this doesn't tell us if channels are mixed. For example if we
have 2 input matrix in which first row's position 2 and 4 have value 1,
it means that both streams channel 1 is copied to output channels 2 and
4, so not mixed. So change the check to be channel specific.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-12-01 14:06:26 +00:00
Guennadi Liakhovetski a25cf0f1ba zephyr: fix breakage after a recent logging extention
Commit fee7d9c660 ("trace: Introduce adaptive
rate-limiting/suppression of repeated messages") broke Zephyr build.
Add the missing parameter.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-12-01 13:58:55 +00:00
Guennadi Liakhovetski c8ae78ab0e zephyr: fix a path to a header, build LPS conditionally
Use a correct path to the cAVS memory.h header, build cAVS LPS
only when the respective Kconfig option is selected.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-27 16:32:32 +00:00
Artur Kloniecki 4d4a9d7299 trace: Allow bursts of messages pass through flood filter.
Introduce TRACE_BURST_COUNT Kconfig setting, which allows to define amount
of messages that are allowed to pass through the filter before suppression
kicks in.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-11-27 15:10:46 +00:00
Artur Kloniecki 5d9ae0de93 logger: Decode %pQ format specifiers as log entries.
To allow proper display of suppressed message info traces, %pQ specifier
was chosen to decode pointers to log entries.
Helper function asprintf_entry_text() is used to handle the log entry
text for display.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-11-27 15:10:46 +00:00
Artur Kloniecki 524cf111f6 trace: Disable adaptive filtering, when user modifies filters settings
When user manually overrides trace filtering settings, adaptive trace
rate-limiting is disabled. This assures, that when user deliberately
changes filters, all trace messages are being delivered.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-11-27 15:10:46 +00:00
Artur Kloniecki fee7d9c660 trace: Introduce adaptive rate-limiting/suppression of repeated messages
Few recent messages are remembered by the filter, and repetitive messages
reported in short period of time are suppressed. Solution is compile-time
configurable via many Kconfig options, as documented in Kconfig.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-11-27 15:10:46 +00:00
Artur Kloniecki b07f2674cc trace: Rename trace_log() function to trace_log_filtered()
Also create trace_log_unfiltered() function, to be used internally
by tracing subsystem to emit information about suppressed trace messages.

The *unfiltered function could be also used as replacement
in _log_message() macro, to disable log filtering for debugging purposes.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-11-27 15:10:46 +00:00
Artur Kloniecki 9976fb2502 trace: Create vatrace_log() function taking variable argument list.
This separates trace filtering from actual sending of the message
and allows usage of sending function without filtering, when necessary.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-11-27 15:10:46 +00:00
Curtis Malainey 0ca92feb6d codec_adapter: add missing ifdefs for cadence
If you enable the adapter but disable the cadence codec this will break

Reported-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-11-26 15:42:16 +00:00
Curtis Malainey 7058c85fac codeowners: add codeowners for dcblock/drc/crossover
Add google code owners for google contributed processing code

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-11-24 22:14:35 +00:00
Daniel Baluta 3c5c7b848d drivers: imx: sai: Use rate from topology
So far we only used topologies with rate set
to 48KHz. This is no longer true now when
we enabled KWD pipelines.

So, use rate from parameters passed from kernel.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-11-24 13:11:02 +02:00
Daniel Baluta f5441a1cf7 ipc: dai: Align sof_ipc_dai_sai_params with kernel
We add fsync_rate, bclk_rate because now we
actually need them.

Also, notice that mclk_rate was moved near the other rates
fields.

I think this was broken from the beginning but didn't
show up as a bug because SAI is used in consumer mode
and the clock is provided by the codec.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-11-24 13:11:02 +02:00
Daniel Baluta d2ecb572e3 drivers: imx: sai: Add SAI private data
We allocate SAI private data to save config and
parameters and use them later.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-11-24 13:11:02 +02:00
Guennadi Liakhovetski 90955de93e hal: remove unused files
Prevent unused Xtensa XTOS files from building but keep them in the tree
until migration to Zephyr completes.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-23 10:54:33 +00:00
Guennadi Liakhovetski 1d39806f4e zephyr: extend the wrapper for generic architecture support
When building SOF with Zephyr for unsupported architectures
the following additional adjustments to the wrapper are required:
1. define HEAP_RUNTIME_SIZE
2. implement stubs for interrupt handlich code
3. remove arch_timer_get_system() as it's provided by a header
4. hardcode "return 0;" for platform_timer_get()
5. disable sys_module_init() which anyway isn't yet functional
   under Zephyr
6. add dummy platform_init() and platform_boot_complete()
7. add log_const_sof

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski 02222f41a5 dma: add missing symbols for Zephyr builds
When building with Zephyr for unsupported architectures several DMA
symbols are missing. Add them to the respective platform header.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski a652aad6e1 trace: provide a dummy trace_point() implementation for CONFIG_LIBRARY
trace_point() is only used in platform code and in init/init.c. None of
those are build for ordinary CONFIG_LIBRARY builds. However, when built
under Zephyr, init.c is included in the build. therefore a dummy
implementation of trace_point() is needed.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski 28210fa6f1 schedule: the cAVS timer requirement is only valid for Xtensa
The timer-domain driver requires the use of the cAVS timer driver,
but it only makes sense on Xtensa architectures.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski f4b6a54a77 init: make secondary_core_init() available to all single-core configurations
If MULTICORE is disabled secondary_core_init() should be a dummy on
all architectures, not only on Xtensa. This change also makes
arch/init.h redundant, remove it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski fe66007d4d testbench: file.c calls free(), it must include stdlib.h
Add the missing stdlib.h include to file.c.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski 2c4d8e981e debug: explicitly include ipc/trace.h where panic() is called
ipc/trace.h contains definitions for all the SOF_IPC_PANIC_* macros,
it should be included explicitly everywhere, where those macros are
used.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski 7b1d54087c xtensa: move register_exceptions() to init.c
register_exceptions() and exception() are only used in init.c, move
them there.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski baf061d5d8 debug: move arch_get_stack_*() functions to a separate header
arch_get_stack_*() functions are only used in panic.c. Move them to
a separate header to reduce dependencies.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski a219b97086 debug: move dump_stack() to panic.c
dump_stack() is only used in panic.c, move it there.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski ddbf5255d2 zephyr: set ARCH to "host" when not building for Xtensa
When building for unsupported architectures under Zephyr set ARCH
to "host" to use generic headers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski 4df89f5ff7 host: fix timer API
Add a required .id field to struct timer and update
arch_timer_get_system() prototype to return uint64_t.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00