Commit Graph

4563 Commits

Author SHA1 Message Date
Rander Wang fcb2d65bfc topology: tgl: add i2s in topology name
Rename topology file for 1308 in i2s mode according
to machine driver.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2020-02-10 10:47:09 +00:00
Rander Wang b90f4dd044 topology: sof-icl-rt711-rt1308-rt715: refine dai index setting
If mono is defined, dai index 3 is not used and DMIC uses index
4. Now sdw machine driver generates dai dynamically with consecutive
dai index. To align with machine driver, refine topology to also use
consecutive index.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2020-02-10 10:47:09 +00:00
Karol Trzcinski 7d5edbef13 wait: Remove unused completion_t with related functions
Unused code shouldn't be present in source code, it only makes system
more difficult to understand.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-07 15:01:07 +01:00
Marcin Rajwa d6fef4e4c3 memory: increase heap buffer size for ICL an JSP platforms
This patch increases heap buffer size for ICL and JSP platforms.
Therefore more pipelines can work simultaneously.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-02-06 08:51:40 +01:00
Tomasz Lauda 0469a018ba volume: make task dynamic
Makes volume ramping task dynamic meaning it will be
allocated only when needed. There is no need to have it
allocated statically unless the pipeline will be in fact used.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-04 14:47:22 +00:00
Ranjani Sridharan 55afcf5496 topology: graph: Add PIPELINE_ID to graph name
Add the PIPELINE_ID to the graph section name to
make them unique for the playback and capture pipelines
that are associated with the same SSP. Also fix the
comment while we're at it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-02-04 14:45:58 +01:00
Janusz Jankowski b5ec44b067 memory: change LP_SRAM to helper config
Having both LP_SRAM (bool) and LP_MEMORY_BANKS (int) is error prone.
It's better to make LP_SRAM just a helper config that is set
to true if there is any LP memory bank in use.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-02-04 11:30:02 +00:00
Marcin Rajwa 30cd56fa56 apl: fix LSPGCTL register define
This patch fixes wrong define to LSPGCTL
register.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-01-31 21:15:52 +00:00
Marcin Rajwa 10757a1d36 shim: remove unused, wrong offset
This patch removes unused and wrong offset
to SHIM register for CNL platform.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-01-31 21:15:52 +00:00
Marcin Rajwa 411b9377c8 boot_loader: fix lp_sram_init
This patch fixes LP_SRAM_INIT - this
procedure was reading wrong register.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-01-31 21:15:52 +00:00
Seppo Ingalsuo 5dcace1211 Testbench: Propagate fail from topology parse load widget
This patch avoids the testbench to crash when file read or write
file open was not successful. E.g. invoking testbench with
incorrect input file name caused a segfault.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-31 21:06:39 +00:00
Seppo Ingalsuo 24bbea3ef2 Testbench: Force scheduler to EDF
This patch adds force of scheduler type to EDF since it is the
only simplified scheduler version that is included to testbench.
The schedule_task_init_ll() stub is updated to call schedule_task_init()
to prevent a check for NULL run operation to fail. The patch also
changes the memory allocation to calloc() to clear the reserved data
to value NULL for similarity with rzalloc() in SOF.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-31 21:06:39 +00:00
Seppo Ingalsuo 5b89f29445 Testbench: Add pipeline trigger stop to test end
This patch adds the missing call to end of test run. It prevents
the pipeline reset to print error traces about illegal state
change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-31 21:06:39 +00:00
Seppo Ingalsuo 71d9dbe62b Testbench: Force core to zero to be able run the pipeline
This patch sets in topology parsing core to zero for file reader,
file writer, and buffer since it was left uninitialized and caused
the core check in pipeline run to fail.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-31 21:06:39 +00:00
Seppo Ingalsuo 1f09719260 Testbench: Fix file component data read and write
This patch retrieves the channels count either from sink or
source. The previous code failed for file read since source
is NULL. A similar kind of mistake also caused the period_bytes
to be calculated as zero.

Finally as code simplification the calculation of bytes is moved
to variable declaration to avoid duplicated statement.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-31 21:06:39 +00:00
Seppo Ingalsuo 40f7cf7a28 Testbench: Initialize system notify
This patch adds the initialization to testbench start code. Without
it the notification from buffer consume/produce causes segfault.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-31 21:06:39 +00:00
Lech Betlej 031ab223a0 cavs: enable power gating of unused memory banks for cavs 2.x hw
The change adds power gating of unused memory banks for cavs 2.0/2.5
hardware on top of previously enabled flow for cavs 1.8.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2020-01-31 10:48:38 +01:00
Lech Betlej 6d8940ce86 cnl: make boot loader code more readable
Boot loader code was modified to more readable by renaming functions that
are used to actually power up memory banks during memory initialization
routine.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2020-01-31 10:48:38 +01:00
Lech Betlej 51e3c36985 cnl: remove an obsolete constant
An obsolete constant is removed from CannonLake specific code.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2020-01-31 10:48:38 +01:00
Daniel Baluta 8db2b101ee topology: imx8: Use s32le format for wm8960 codec
wm8960 codec drivers the master clock and for s24le we cannot easily
derive the bitclk.

So, switch to s32le. SAI supports s32le format. The initial s23le was
added because topology was based on sof-imx8qxp-cs42888.m4 which uses
ESAI and that's limited to s24le.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-01-30 17:07:59 +02:00
Daniel Baluta 03ddb48062 topology: imx8: Change DAI name
For now we are using generic simple-card as a machine driver, and
the DAI name must follow certain pattern <dai-name>-<codec-name>.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-01-30 17:07:59 +02:00
Janusz Jankowski 957916f8ef platform: intel: add clock switch for waiti
Platforms with cAVS version 1.8 & 2.0 have hardware requirement that
DSP should use LPRO as clock source in waiti.
This patch adds config for that and enables it for platforms that
need it.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-01-30 15:42:05 +01:00
Janusz Jankowski 76544f5a13 arch: xtensa: add waiti wakeup hook
On some platforms there is a need to perform tasks after
coming back from waiti.

There is no central interrupts processing function in SOF.
Every interrupt is registered separaterly, so we need to execute
'wake up' functions in xtos interrupts handlers.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-01-30 15:42:05 +01:00
Janusz Jankowski 82d8ba075d platform: intel: LP HP freq indexes
Add freq indexes for LPRO and HPRO, to be able to request
clock source by providing specific frequency index
instead of frequency in Hz.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-01-30 15:42:05 +01:00
Liam Girdwood c5c48fb1dc ipc: Add support for simple IPC polling
Add support for a simple IPC polling API that will allow clients to
poll IPC messages and status. This is runtime mutually exclusive to
the default IPC IRQ mode.

IPC polling mode is only intended for certain use case where simplicity
or reduced footprint are required like GDB stub and bootloader stub users.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-01-30 14:09:03 +00:00
Marcin Maka 922429a5f2 trace: dai: use dot as type and index separator
Follows the notation used for id's by the sof logger
tool. Type is followed by the index.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-30 14:48:09 +01:00
Marcin Maka 8e92eb1ef1 dmic: config: do parameter check first
Parameter verification should be done before any
expensive resource allocations happen.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-30 14:48:09 +01:00
Marcin Maka 9985b014d2 dmic: trace: use trace macros with ids
Dmic instance should be identifiable in traces.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-30 14:48:09 +01:00
Marcin Maka dee9b088ec trace: dai: add macros with ids (type, index)
Trace entry fields for IDs may be used by dai traces
for type and index to track down each trace entry to
a specific dai instance.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-30 14:48:09 +01:00
Marcin Maka c13aeb3a97 comp: dai: rename dai in trace macros to dai_comp
Since this is the code of 'dai component', the trace macros
are renamed to avoid collisions with names of 'dai'
(ssp, dmic, ...) trace macros.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-30 14:48:09 +01:00
Seppo Ingalsuo 6a3b2a9f46 Tune: Fix help text for SRC generator
This patch corrects the shown parameters orders for help text
and updates the copyright text style.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-29 14:30:53 +00:00
Seppo Ingalsuo 6f99d71d58 Tune: SRC: Fix rate exclusion in generator script
This patch fixes a mistake that forces generation of rate into
fs_inout matrix diagonal. The purpose of this test is to enable
SRC to pass equal input and output rate, so in case not equal
input and output rates the generator would not disable such
conversion if requested.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-29 14:30:53 +00:00
Karol Trzcinski bd5c275a92 audio_stream: Fill comments to each data field
Dispel possible doubts about content of struct fields by adding
descriptive comment to each one.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-29 15:16:58 +01:00
Karol Trzcinski a4b7201030 audio_stream: Use enum data type for frame_fmt field
Field frame_fmt is treated as sof_ipc_frame in code so data type
in declaration should be same. Update field comment to be more
appropriate with new data type.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-29 15:16:58 +01:00
Karol Trzcinski 1ffeda5499 pcm_converter: audio_stream: Pass offset to first sample to function call
During working with algorithms on special data types there may be need
to convert and store input samples before algorithm run in temporary
buffer. Same situation may happen on the algorithm output.
Size of this buffer may be big enougth to always convert source
data stream in one pass and converter interface doesn't need to be
changed but then capacity of this buffer must be same as source stream
(in samples). In this scenario memory management is very inefficient,
espially with grow of number of components with such a need.

There are also a few solution to use smaller buffers instead.
It can by achieved by:
1) manually moving r_ptr in source stream in component copy() routine,
   what shouldn't happen in such a place
2) calling buffer_consume() after each portion of samples, what leads
   to data fragmentation and performance issues
3) introducing offset argument in converter interface

As we can see, solution number 3 is best one.
Moreover introducing data offset for processing function is common
technique and doesn't introduce visible performance issues.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-29 15:10:21 +01:00
ArturX Kloniecki 939d01d4ff cleanup: Remove logger.exe binary that got accidentally added.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
2020-01-29 15:07:04 +01:00
Tomasz Lauda e025338813 memory: remove uncache macros from several platforms
Removes uncache macros from platforms, which don't support
uncached memory region.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-29 11:47:32 +01:00
Tomasz Lauda 9e4d1aae90 dw-dma: add method to retrieve lli from memory
Implements new platform specific method, which allows for
retrieving linked list item from memory. The best example
are cAVS platforms, which need read it through uncached
memory region. Rest of the platforms currently don't need
the implementation, since they don't support hardware linked list.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-29 11:47:32 +01:00
Tomasz Lauda e74ed8dc56 mailbox: move mailbox_sw_reg_write() to platform code
Extracts mailbox_sw_reg_write() function to platform specific code.
For cAVS platforms we want to have it go through uncached memory
region, which can be unavailable on other platforms.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-29 11:47:32 +01:00
Liam Girdwood c520326046 audio: compiler: GCC 9.x packed data alignment fixes
GCC 9.x introduces checks for packed data alignment when being passed or
cast as different types.

Add an alignment macro so that we can tell GCC that packed data alignment
is assumed to be valid for certain casts.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-01-29 10:31:17 +00:00
Liam Girdwood 4fc207e89f dma: dw: GCC 9.x packed data alignment fixes
GCC 9.x introduces checks for packed data alignment when being passed or
cast as different types.

Pass LLI by pointer instead of SAR* and DAR* which results in packed
alignment error.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-01-29 10:31:17 +00:00
Adrian Bonislawski 716bc4bdd8 probes: initial implementation, kconfig and IPC params
Probes are a feature that will allow user to extract and inject data
from/into buffers at runtime.

Basic flow is as follows:
1. Initialization of probes subsystem, allowing for simultaneous
   configuration of DMA for extraction. If extraction DMA is not setup
   during init, extraction probes will be disabled.
2. Configuration of probe points, preceded by DMA configuration in case
   of injection probes.
3. Probes are now in operation and will send single multiplexed stream from
   extraction probe points and inject data into specified buffers.
4. State of probes and associated DMAs may be retrieved via INFO functions.
5. Removal of probe points.
6. Removal of injection DMAs.
7. Deinitialization of probes subsystem.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
2020-01-29 11:26:58 +01:00
Bartosz Kokoszko 61a51bc789 kpb: fix buffered_data calculation
This commit introduces proper calculation of buffered_data,
which should not exceed buffer_size value. Firstly, we calculate
free space in history buffer and we add minimum value from
copy_bytes and hb_free_space.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-01-29 10:06:06 +00:00
Seppo Ingalsuo 971b513801 ASRC: Add pull mode to copy() functions
This patch adds the missing use and initialization of ASRC for
pull mode. Pull mode is used typically in audio capture where
the DAI is not synchronous with rest of SOF. The previous version
used push mode for both plaback and capture that can work only with
a synchronous DAI.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-28 11:00:35 +00:00
Seppo Ingalsuo acafb867b8 ASRC: Add asrc prefix to function names
While the functions were unused I missed to name them properly. With
the prefix the names are consistent with push mode functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-28 11:00:35 +00:00
Seppo Ingalsuo 0e83f7d094 Topology: Set ASRC asynchronous mode plus add WM8804 and HDA tests
This patch adds two new test topologies. One is for testing ASRC
timestamp retrieving from HDA and one for WM8804 slave SSP interface
for APL. It is useful with UP^2 board with HiFiBerry Digi+ SPDIF
interface.

The asynchronous mode token is switched on in ASRC capture and
playback pipelines. It switches on DAI skew tracking feature
in ASRC.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-27 16:47:34 +00:00
Seppo Ingalsuo 4c4d91ddbe ASRC: Add DAI skew tracking and control loop
This patch adds the DAI skew tracking and filtering to fine
adjust the conversion factor of the ASRC. The ASRC finds the
pipeline DAI from downstream in push mode (playback) and from
upstream in pull mode (capture).

To avoid code hang to infinite loop the modification to asrc_farrow.c
adds a safe bail out if skew factor related number of samples to
compute exceeds buffer space. The streaming continues but there
can be a glitch in audio if the skew is bad enough to exceed the
buffer margin. The error trace helps to see if such can happen in
real use cases.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-27 16:47:34 +00:00
Seppo Ingalsuo 3d4fc0fdd4 DAI: Add timestamping to DAI and HDA, SSP, DMIC drivers
This patch adds to the DAI component new operations dai_ts_config(),
dai_ts_start/stop(), and dai_ts_get() to support timestamp retrieving
from audio interface hardware for use of other components, especially
in the asynchronous sample rate converter.

The support for HW timestamps is enabled in Intel cAVS HW drivers for
SSP (I2S), HDA, and DMIC.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-01-27 16:47:34 +00:00
Karol Trzcinski f493e907a1 test: buffer: Replace memcpy to memcpy_s
Introduced change resolve checkpach issue related with edited lines
of code.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-23 22:04:42 +02:00
Guennadi Liakhovetski a40175724f topology: APL: add 2 DMICs to sof-apl-pcm512x
Up^2 boards have a DMIC connector. Add support for such DMIC add-on
boards. Also adjust iDisp interface DAI IDs to match the new
sof_pcm512x.c Linux machine driver.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-01-23 15:59:43 +00:00