Commit Graph

3995 Commits

Author SHA1 Message Date
Tomasz Lauda ed64f40935 dma: implement dma buffer copy functions
Implements copy functions from/to DMA buffer. They take care
of cache operations and also can perform custom processing
during copy. By default it will be usual buffer copy, but in the future
it can be replaced with pcm conversions, so we don't need volume
into the pipelines just for that operation.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-24 10:17:03 +02:00
Tomasz Lauda eaa0ad01f3 buffer: implement buffer copy functions
Implements simple buffer copy functions for 16 and 32 bit data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-24 10:17:03 +02:00
Tomasz Lauda 2e7d199c43 dma: add new attribute DMA_ATTR_BUFFER_PERIOD_COUNT
Adds new DMA attribute DMA_ATTR_BUFFER_PERIOD_COUNT and implements
it for every DMA. This attribute says how many periods should DMA
buffer consist of.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-24 10:17:03 +02:00
Tomasz Lauda a31d97671e buffer: extract allocation part to separate function
Extracts allocation part of buffer_new to separate function.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-24 10:17:03 +02:00
Tomasz Lauda df6017f950 buffer: add and init id, pipeline_id and caps fields
Adds and initializes id, pipeline_id and caps fields in buffer struct.
This is the only data needed after buffer creation. It allows us to
remove the whole sof_ipc_buffer struct from the buffers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-24 10:17:03 +02:00
Paul Olaru b6a863909b drivers: imx: esai: Enable the ESAI on the i.MX8 platform
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-24 10:55:45 +03:00
Paul Olaru c4d1408a6f drivers: imx: Add initial ESAI support
The ESAI is a hardware DAI on the i.MX platform. This commit brings the
initial support for the ESAI.

For now, the hardware FIFO watermark is hardcoded to 96 which means that
DMA transfers will be initiated when 96 of the 128 FIFO slots are empty.
IRQ handling is disabled (but possibly not needed anyway) and the clock
divider settings are hardcoded and correct for MCLK of 49152000 Hz,
48000 Hz sample rate, 2 channels, 32-bit samples (for the codec).

See https://www.nxp.com/docs/en/reference-manual/IMX8DQXPRM.pdf, pages
7435-7506 (ESAI).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-24 10:55:45 +03:00
Jakub Dabek f277189b3a build: Add config for Jasperlake build
Add defconfig file for Jasperlake platform.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-23 19:07:52 +02:00
Marcin Maka 40f7629f0b cnl: shim: fix typo in CLKCTL bits definition
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-10-23 19:07:34 +02:00
Jaska Uimonen 325f5d088e topology: add mute switch with led to eq capture pipe
Add mute switch with led control to capture playback pipeline's volume
component. This will show in user space alsa controls as 1 element with
2 controls (volume and mute switch). Some user space audio software like
this a lot.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-10-23 17:30:11 +02:00
Jaska Uimonen cc517edd48 topology: add mute led support to mixer control
Add optional mute led token support to mixer control. Optional
parameters at the end of mixer control macro will add mute led tokens
and related parameters to the private data section.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-10-23 17:30:11 +02:00
Jaska Uimonen bcf00a293a topology: add mute led tokens
Add tokens to topology for led use and led direction. Led use is true
for positive integers, false for 0. Led direction 0 corresponds to
playback and positive integers to capture.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-10-23 17:30:11 +02:00
Paul Olaru bea68b77d3 platform: imx: Enable caching on the i.MX platform
This improves the performance quite significantly -- pipeline_copy on
the simple ESAI pipeline (the cs42888 pipeline) took around 781us before
while with caching I got times of 15us at a minimum (a 50-fold
improvement).

Values:
-> 0x40000000-0x5FFFFFFF: 2 (bypass, contains ADMA registers)
-> 0x80000000-0x9FFFFFFF: 1 (write-through, write allocate). This
contains almost all of the code in 0x92400000-0x92BFFFFF and all the
heaps in 0x92C00000-0x933FFFFF.
-> Everything else has cache bypass (Dummy DMA needs to be able to use
host buffers from wherever)

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-23 16:53:14 +02:00
Paul Olaru 44c1d9217f drivers: generic: dummydma: Make the Dummy DMA compatible with caching
The semantics of a DMA driver is to transfer data to/from RAM rather
than to/from the DSP cache. As such I need to flush the cache before
and after the copy (see comments inline).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-23 16:53:14 +02:00
Lech Betlej a564aa293a cavs: enable power gating for lp/hpsram on d3 entry
Power gating for HPSRAM & LPSRAM on D3 entry enabled for all cAVS
platforms (cAVS 1.5/1.8/2.x) except SueCreek. Implementation shared
between cAVS 1.8/2.0/2.5 is located in cavs lib, cAVS 1.5 specific
implementation remains in ApolloLake platform directory.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-10-23 12:16:02 +02:00
Lech Betlej c548489e38 cavs: deduplicate power down sequence for cavs platforms
cAVS power down sequence refactored by moving CannonLake (cAVS 1.8)
implementation to cavs lib as a base for cAVS 1.8/2.0/2.5 common
code. ApolloLake (cAVS 1.5) specific implementation remains as a
platform specific code.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-10-23 12:16:02 +02:00
Tomasz Lauda 6d3d5bcdad cpu: fix cache misalignment
Fixes cache misalignment of active_cores_mask value.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-23 09:47:16 +02:00
Guido Roncarolo 6cab99c729 drivers: imx: edma: fix bytes copied at each iteration
The number of bytes copied at each ieration must
match half the total size copied as we have an
interrupt at HALF and MAJOR loop

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
2019-10-23 10:08:22 +03:00
Guido Roncarolo d781385a91 drivers: imx: edma: translate burst size in bytes
burst_size represents the FIFO width in words, translate it
into bytes to have homogeneous quantities

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-10-23 10:08:22 +03:00
Marcin Rajwa 8b059f6566 kpb: make draining algorithm more secure
This patch slightly modifies draining speed algorithm.
Instead of copying half the buffer each period we
copy two periods. This slightly decreases draining
speed but avoids XRUNs in rare cases.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-10-22 20:33:41 +02:00
Paul Olaru 47b3050b3d sof: Fix compile errors when traces are disabled.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-22 20:27:55 +02:00
Ranjani Sridharan d01f1629be topology:cml/glk: name the graphs appropriately
Fix the copy/paste errors in naming the keyword-detect
pipeline connections for CML and GLK.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2019-10-22 20:26:58 +02:00
Ranjani Sridharan 4fa588e676 topology: sof-glk-da7219-kwd: fix compilation error
remove the extra closing bracket to remove the compilation error
ALSA lib parser.c:219:(tplg_parse_config) error: unknown section )

ALSA lib parser.c:219:(tplg_parse_config) error: unknown section
pipe-sof-apl-keyword-detect

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2019-10-22 20:26:58 +02:00
Tomasz Lauda 9d5a82e78a ll_schedule: fix race condition for multicore scheduling
Fixes race condition in low latency scheduler when multiple cores
are processing tasks on the same scheduling domain. Task's start
time is updated based on last_tick right after the task is finished.
Last_tick can be updated in the meantime by other core in the situation,
where it starts handling interrupt later, but finishes its tasks
earlier.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-22 13:25:33 +02:00
Seppo Ingalsuo 1dbd14b30d Testbench: Improve test begin and end marker tones find
Chirp test signals confused the test signal begin marker position
seek and caused false test fails. The test stimulus may produce
stronger cross correlation level than the actual marker. Also
the check omitted that the cross correlation max could be negative
so the test was changed into power domain and use first/last
cross correlation peak above threshold as test begin/end position.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-10-21 21:20:11 +02:00
Seppo Ingalsuo 0324516ec3 Testbench: SRC: Relax gain test tolerance
Gain of SRC varies by 1 dB due built-in attenuation in the filter
coefficients. It was added to avoid signal overshoots to distort
with some challenging music content. When a converter consists of
two filters in series the attenuation duplicates. While SRC is
missing the gain compensation the test criteria needs to be relaxed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-10-21 21:20:11 +02:00
Jakub Dabek bf11710734 memory: Fix DEBUG_HEAP build
Unify function naming to fix DEBUG_HEAP build

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-21 19:50:46 +02:00
Paul Olaru 3cec2101da platform: imx: Increase system runtime heap size
The introduction of the DMA multi channel domain made it so the cascaded
interrupt handling fails to allocate memory from this heap. Increasing
the size of the system runtime heap will allow the registering of
cascaded interrupts (and in particular the EDMA interrupt within the DMA
scheduling domain) to continue.

On this platform we have 8MB of total memory. Allocating 24kB instead of
12kB for the system runtime heap does not cause any noticeable change
besides removing the memory allocation failures.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-21 17:49:11 +03:00
Jakub Dabek 0234df5b4a buffer: Add alignment setting for DMA buffers.
Add seeting of alignment for DMA buffer that is required by
Hardware configuration.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-21 12:07:03 +02:00
Jakub Dabek b63f559bb4 memory: removed hp buffer heap
Merged hp buffer heap with normal buffer heap.
Since current buffer heap was actually using hp memory and it served
no purpose to have two heaps.
Removed extern capabilities and merged other capabiliteis to
buffer heap. Currently none of those buffer heaps supports extern.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-21 12:07:03 +02:00
Guido Roncarolo 3d5d314626 drivers: imx: edma: fix accessing register logic
channel must not be accessed when status *is* INIT
Fixes: 61b0b58

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-10-18 17:15:19 +03:00
Marcin Rajwa b717e0a0a1 host: fix wrong trace value
This patch fixes the trace message which logs always zero
value.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-10-18 13:48:22 +02:00
Seppo Ingalsuo 81cc31b4ab Topology: Add topology to test capture SRC
This patch adds topology sof-apl-src-dmic.m4 to test capture SRC.
The topology instantiates SRCs for 48 -> 8-48 kHz and 16 -> 8-48 kHz
capture. The volume component in pipeline handles PCM format
conversion from the fixed S32_LE DMIC DAI format. Also the bugs in
the earlier non-used pipeline macro are fixed.

The macro pipe-src-capture.m4 is renamed to pipe-src-volume-capture.m4
since it contains a volume component. A new macro pipe-src-capture.m4
is created to provide pipeline building block without volume.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-10-17 15:43:31 +02:00
Seppo Ingalsuo f4084551e5 SRC: Report properly the non-supported rates combination error
The earlier error message was hard to understand and could be
mistaken as internal fail. A redundant trace message about block
sizes is removed because the block sizes are set in each copy()
in current SRC version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-10-17 15:43:31 +02:00
Seppo Ingalsuo 703e8269f3 SRC: Fix sink and source PCM formats handling in prepare()
This patch avoids wrong configuration for PCM format and audio
corruption in capture pipelines usage if the pipeline requires
format conversion.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-10-17 15:43:31 +02:00
Pierre-Louis Bossart 5a9233033e topology: add rt711 to TGL RVP configuration
Now rt711 is in SDW mode and rt1308 is in I2S mode on TGL RVP

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-10-17 13:53:48 +02:00
Tomasz Lauda 6b22503e54 ipc: check whether pipeline id is already taken
When new pipeline is created we need to also verify whether
given pipeline id is already taken.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:41 +02:00
Tomasz Lauda 99c16a69e3 ipc: rename ipc_get_comp function
Renames ipc_get_comp function to ipc_get_comp_by_id.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:41 +02:00
Tomasz Lauda 089de0f6ab platform: remove unused PLATFORM_HOST_FINISH_TIMEOUT
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:11 +02:00
Tomasz Lauda d3ca5cb1c0 platform: remove unused PLATFORM_HOST_FINISH_DELAY
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:11 +02:00
Tomasz Lauda 276463d6dc platform: rename and move PLATFORM_HOST_DMA_TIMEOUT
Renames PLATFORM_HOST_DMA_TIMEOUT to HDA_DMA_TIMEOUT and
moves to hda-dma, where it belongs.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:11 +02:00
Tomasz Lauda 9b535ce1a2 platform: rename PLATFORM_DMA_TIMEOUT and move to dw-dma header
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:11 +02:00
Tomasz Lauda 19db14e55f platform: remove PLATFORM_SCHED_CLOCK
Removes PLATFORM_SCHED_CLOCK definition as it's the same
as PLATFORM_DEFAULT_CLOCK.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:11 +02:00
Tomasz Lauda a12d58d170 platform: rename and move PLATFORM_HOST_DMA_MASK
Renames PLATFORM_HOST_DMA_MASK to PLATFORM_DW_DMA_HOST_MASK
and moves to dw-dma header, where it belongs.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:11 +02:00
Tomasz Lauda 66f937dd52 platform: remove unused MAX_PRELOAD_SIZE
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:11 +02:00
Tomasz Lauda 557e3b7609 platform: remove unused PLATFORM_SCHEDULE_COST
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:11 +02:00
Jakub Dabek 089ddcc2b2 memory: fix DEBUG_HEAP build
Fixed issue with DEBUG_HEAP configuration not building correctly.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-17 13:35:22 +02:00
Janusz Jankowski ed9989ebbe pipeline: check task init result
In case of unsuccessful scheduler task init, the pipeline
task init should also fail.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-10-17 12:53:35 +02:00
Guido Roncarolo 54127b0374 drivers: imx: sai: add one word to FIFO
FIFO should be pre-filled with one word as per RM
recommendation after TRCE has been anabled

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-10-17 13:03:45 +03:00
Tomasz Lauda 063ecded7f src: fix frames calculation for capture stream
Fixes source_frames and sink_frames calculation for SRC
in the capture pipeline.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 11:28:34 +02:00