Commit Graph

3387 Commits

Author SHA1 Message Date
Tomasz Lauda 357e47c49c buffer: improve traces
Improves traces for comp_update_buffer_produce
and comp_update_buffer_consume functions. Now
we will be able to easy identify failing components.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-02 18:17:30 +02:00
Tomasz Lauda b4fc677c70 dw-dma: change behavior for preload
Changes behavior for DMA_COPY_PRELOAD flag.
DW-DMA should just start transfer the same way
as for DMA_COPY_ONE_SHOT. It fixes playback
for platforms using DW-DMA for host transfers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-02 15:15:27 +02:00
Tomasz Lauda 19efb46109 dw-dma: change release handling for non HW_LLI
Changes DW-DMA release handling for configurations
not using hardware linked list support. We should
not make any additional copies in such case.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-02 11:15:50 +02:00
Keyon Jie 2b0935798d detect-test: refine model data management
Add struct model_data to manage model related stuff.

For set_model, re-allocate buffer at the 1st IPC, calculate crc after the
last IPC is handled.

For get_model, output the crc value at the 1st IPC.

Todo: add crc32 value to the struct sof_ipc_ctrl_data may be the next
step, it will require ABI change.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-06-29 17:08:58 +01:00
Keyon Jie 25a4c5b0db detect-test: allocate model data memory at set_model stage
We are aligned to use separate IPC for set_config and set_model, so
don't allocate model buffer at set_config stage, but do that in the
first IPC for model blob config IPC sequences.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-06-29 17:08:58 +01:00
Tomasz Lauda 440cd55f60 pipeline: change preload conditions
Changes pipeline's preload conditions to take into
consideration the situation, where we don't always
want to do playback preload, because the sink part
of pipeline is already running e.g. mixer topology.
However the host component still needs to perform
preload on its own, so for now we make the decision
based on stream's direction.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-29 16:44:04 +01:00
Tomasz Lauda 4c59ef3b87 handler: set host copy to one shot
Sets host copy mode to one shot for platforms
with CONFIG_HOST_PTABLE set. Note: this setting
shouldn't be dependent on CONFIG_HOST_PTABLE,
but rather should be set in platform specific code.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-28 16:37:31 +02:00
Tomasz Lauda 4151d902b7 host: ignore host_trigger() for one shot copy mode
Ignores host_trigger(), when host component is
configured in one shot copy mode. In such mode
the DMA is started every time in copy and stopped
automatically.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-28 16:37:31 +02:00
Tomasz Lauda eefe72c925 component: add new COMP_COPY_ONE_SHOT type
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-28 16:37:31 +02:00
Tomasz Lauda 912158e1f4 component: make copy type extendable
Changes component's copy attribute from bool to
enum, which makes it extendable. Now we can add
additional copy types and implement each component's
functionality based on selected type.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-28 16:37:31 +02:00
Bartosz Kokoszko 12a563fce0 host: correct typo in host.c file
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-28 21:16:33 +07:00
Bartosz Kokoszko c9ffb30c12 dma-trace: make dma-trace using dma_get_attribute()
I've removed PLAFORM_HDA_BURST_SIZE define since it is the
same as HDA_DMA_COPY_ALIGNMENT. In trace functions we
can retrieve alignment by using dma_get_attribute()
dma function.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-28 21:16:33 +07:00
Bartosz Kokoszko fbc6277d9b hda-dma: move HDA_ALIGNMENT defines to hda-dma.c
HDA_DMA_ALIGNMENT and HDA_COPY_ALIGNMENT are not platform
specific. I've moved them from specific platform.h files to
hda-dma.c.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-28 21:16:33 +07:00
Bartosz Kokoszko 03057d17cd host: add copy_bytes alignment in host_buffer_cb()
Amount of bytes we copied by host component should be
align to minimal possible chunk of data that can be
copied by hda-dma. In other case there is possibility of
occurrence mismatch between amount data we really copied
and buffer read and write pointers.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-27 18:49:00 +07:00
Bartosz Kokoszko ed1c9164f9 dma: add DMA_ATTR_COPY_ALIGNMENT to dma attributes
Add DMA_ATTR_COPY_ALIGNMENT attribute in order to
retrieve the smallest possible chunk of data that can
be copied by dma.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-27 18:49:00 +07:00
Jaska Uimonen 83b19454dd dma: add dma ops for getting attributes
Add ops to get dma attributes.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-06-27 18:49:00 +07:00
Bartosz Kokoszko fb10557575 host: remove using bytes argument in host_buffer_cb
We do not have to use bytes to count copy_bytes since
copy_bytes variable is calculated based on hda-dma and
host buffer pointers. Bytes variable is not useful here
- we should copy as much data as available in the host
buffer. Bytes variable gives additional unnecessary
limitation.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-25 19:26:49 +07:00
Keyon Jie f5186ece2c topology: pipe-detect: add kcontrol for model blob
We need to split detector config and model blob, create another bytes
kcontrol for model blob.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-06-25 18:44:19 +07:00
Adrian Bonislawski f5a78f3cd5 hda-dma-trace: remove unused variables if TRACE disabled
This will fix gcc "variable x set but not used" if TRACE disabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-25 13:32:48 +02:00
Adrian Bonislawski 8f589395f8 kpb-trace: use one variable to measure time
This will fix "variable x set but not used" gcc errors if TRACE disabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-25 13:32:48 +02:00
Tomasz Lauda fdd04e9bf5 host: unify component for all DMA types
Unifies host component for all DMA types.
We don't need to branch on CONFIG_DMA_GW anymore.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda 0b569413ff dw-dma: add support for one shot copy
Adds support for one shot copy to DW-DMA.
One shot means that transfer isn't circular,
so every copy is basically just restart of
DMA engine.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda 5bf0890f62 host: remove period_bytes from host_data
Removes period_bytes field from host_data struct.
This field is only used in host_params, so we
don't need it globally.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda a72226799c host: headers cleanup
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda e7d7ca0ca0 host: make host_buffer call a part of set_attribute
Changes host_buffer component ops to be a subtype of
component set_attribute ops. This change allows to
unify host implementation across different types
of DMA.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda 1820be6f7e dma: check if sg exists before cache operations
Checks if dma_sg_elem_array buffer is allocated
before performing cache writeback or invalidation.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda 76587ac98a hda-dma: do not configure DMA during transfer
Ignores request for HDA-DMA configuration if the
channel is in active state.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda bc10926d67 host: unify host_copy for all DMAs
Unifies host_copy implementation for all types
of DMA.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda 4549747e37 dw-dma: do nothing on preload
DW-DMA should ignore copy call if flags include
DMA_COPY_PRELOAD.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-25 11:37:13 +02:00
Tomasz Lauda 25bbc9f5cd schedule: extract schedulers to separate directory
Extracts schedule related implementations to the separate
directory to make it easier to locate and implement new
schedulers in the future.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-24 17:24:59 +01:00
Guennadi Liakhovetski 7a097ad3f5 SSP: (cosmetic) remove "inline"
Firstly, it is better to rely on the compiler to decide which
functions to inline, except in some special cases. Secondly,
functions called by reference, cannot be inlined. This patch removes
"inline" from functions used as .set_config() methods.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-06-24 19:08:35 +07:00
Guennadi Liakhovetski d677781974 Sue Creek: fix a regression: restore original SSP clock frequencies
Commit f5e78430ff ("cavs: ssp: generic ssp mclk configuration for
cavs" made Sue Creek unstable, IPC communication with it would often
fail. The reason for this is, that the Sue Creek uses the SSP clock
as its platform clock. This patch restores the original values.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-06-24 19:08:35 +07:00
Adrian Bonislawski a82b44043f rimage: change error to warning if section not found
Thats because this function is used also to find optional sections so it will be decided later (outside of this func) if this is actually error

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-23 22:55:32 +01:00
Adrian Bonislawski 6c908797c6 rimage: make .static_log_entries optional section
Thats because this section is optional in FW, it will be created only with TRACE enabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-23 22:55:32 +01:00
Keyon Jie 767a81bd9f topology: add sof-cml-rt5682-kwd m4 file for cml keyword detect
It is derived from sof-cml-rt5682.m4, keyword detect pipelines added to
it for Keyphrase Detection feature support.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-06-21 15:44:16 +02:00
Keyon Jie f5832aa273 Topology: sof-cml-rt5682: add dmic16k PCM and dai
Adding dmic16k PCM and dai, this is aligned with driver side.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-06-21 15:44:16 +02:00
Paul Olaru 9015098c99 include: ipc: Fix inconsistency in the comments
Use 'N' for the ID number

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-06-21 10:38:03 +02:00
Paul Olaru d7646b9d5a memory: Make buffers aligned to HEAP_BUF_ALIGNMENT in i.MX8
It provides better memory/cache performance since it aligns with cache
line size

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-06-21 10:37:36 +02:00
Paul Olaru bc529284d4 memory: Add static assert for heap_buf_alignment value
This will check if heap buffers alignment is valid

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-06-21 10:37:36 +02:00
Paul Olaru 5521ebb9fc memory: Add HEAP_BUF_ALIGNMENT define for i.MX8 platform
This value will determine the alignment for heap buffers

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-06-21 10:37:36 +02:00
Adrian Bonislawski 3e6bf7f8a9 memory: remove align to memory bank in APL
Due to small number of memory banks in APL it will be not possible to power down some of them
so there is no point in align to memory banks, this would significantly limit free memory for buffers

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-21 09:25:37 +01:00
Keyon Jie 333f15f363 topology: pipe-detect: enlarge the bytes kcontrol size for blob settings
For detector component, the size of configure blob can be up to 300KB,
here enlarge the max to meet this requirement.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-06-19 10:13:15 +02:00
Marcin Rajwa afbb2a6f53 memcpy: fix bug in memcpy_s for cmocka
memcpy_s has wrong check condition for
overlapping sections. The copy from adjacent memory
bloks will result in dsp panic while it should be
allowed. This patch fixes the issue for cmocka
tests.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-06-18 23:16:21 +02:00
Marcin Rajwa c357561ec9 memcpy: fix bug in arch_memcpy_s for xtensa arch
arch_memcpy_s has wrong check condition for
overlapping sections. The copy from adjacent memory
bloks will result in dsp panic while it should be
allowed. This patch fixes the issue for xtensa
architecture.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-06-18 23:16:21 +02:00
Marcin Rajwa 25c50fd443 memcpy: fix bug in arch_memcpy_s for host arch
arch_memcpy_s has wrong check condition for
overlapping sections. The copy from adjacent memory
bloks will result in dsp panic while it should be
allowed. This patch fixes the issue for host
architecture.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-06-18 23:16:21 +02:00
Marcin Rajwa e9b8c94879 kpb: fix wrong trace message
Correct trace message in kpb_clear_history_buffer().

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-06-18 23:16:21 +02:00
Adrian Bonislawski f8aa67ef81 memory: reorder heap defines to match order from SUE memory layout
This will make easier to analyse heaps in memory.h

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-18 16:11:07 +01:00
Adrian Bonislawski c8e957c0dd memory: reorder heap defines to match order from CNL memory layout
This will make easier to analyse heaps in memory.h

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-18 16:11:07 +01:00
Adrian Bonislawski a71aed4210 memory: reorder heap defines to match order from ICL memory layout
This will make easier to analyse heaps in memory.h

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-18 16:11:07 +01:00
Adrian Bonislawski 93c592cc89 memory: reorder heap defines to match order from APL memory layout
This will make easier to analyse heaps in memory.h

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-18 16:11:07 +01:00