Commit Graph

4398 Commits

Author SHA1 Message Date
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
Guennadi Liakhovetski ea8055de14 topology: APL: add an SSP5 capture pipeline
HiFiBerry DAC+ADC codec card also contains a line-in jack for analog
audio recording. This patch adds support for it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-01-23 15:59:43 +00:00
Tomasz Lauda 25c9e3fcc0 idc: remove unnecessary IDCs and change order
Removes no longer implemented IDCs and changes order
of the one left.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda 2aa4f92968 arch: smp: remove unnecessary code
Removes no longer needed code, which was used in previous
implementation of SMP. With the latest implementation we are
going full SMP, so every core creates and configures its
own components. We no longer need to control cache in order
to synchronize data between cores.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda e22d6e940f dai: host: move notifier calls to valid locations
Moves notifier_register and notifier_unregister calls to original
valid locations. It has been moved previously to comp_trigger due
to the specific implementation of SMP. Now they can be moved back,
since every component is created on dedicated core.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda b0e9f91699 memory: don't alloc shared memory if not needed
DMA channel's private data and also DMIC's private data no longer
need to be allocated as shared. They're only owned by one core at
a time and holds data valid for this particular run.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda ea76f6eba6 cpu: remove cache alignment for active_cores_mask
Removes data cache line size alignment for active_cores_mask.
They are accessed only by master core and with shared data
implementation there is no risk of random data overwrite
in bss.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda 27592104ee cpu: writeback pointer to sof context
Writebacks pointer to sof context instead of the whole bss.
Every call to global structures is now going through this pointer
and static global data is implicitly shared.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda 3e7a8e9c32 ipc: forward IPC to slave cores
Checks what core should process current IPC message
and forwards it to given core. Every component, buffer
and pipeline are created directly on the chosen core,
so we have full SMP now. DAI config checks whether
there are matching components on all the cores and
redirects IPC accordingly.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda 77eb159653 library: add missing memory macros
Adds missing memory macros to host build.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda 99a2644e7b mailbox: add missing header
Adds missing header with definition of cache_to_uncache macro.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda ab30236521 ipc: implement method for forwarding IPC
Implements method for forwarding IPC message processing to
slave cores.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda 6c300e4aed mn: share M/N dividers across SMP code
Marks mn structure as SHARED_DATA, so it could be accessed
by all the cores.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda eab1cab174 mn: add M/N dividers to sof context
Adds pointer to mn struct to sof context. Also implements
getter, so it can be retrieved through one point of access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda bd6467b707 mn: put static variables into common struct
Puts all used static variables into common mn struct.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00
Tomasz Lauda ef89e7c2ad idc: add message for IPC processing
Implements new IDC message for IPC processing.
From now on master core can pass IPC message to be processed
on chosen slave core. Slave core is also responsible for
sending IPC reply.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-01-23 12:07:15 +00:00