Commit Graph

4753 Commits

Author SHA1 Message Date
Karol Trzcinski 74fa3c0a09 tools: logger: Create log_err function
Error during conversion should be logged to stderr and to
output file by default. Such a approach will speed up debugging
process when some error with conversion occur in CI.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-20 11:16:54 +00:00
Karol Trzcinski 0f3d84ecea tools: logger: Align indentation in convert function
Content inside if statement should be indented with only one
tab more that if keyword.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-20 11:16:54 +00:00
Artur Kloniecki 564bae412b muxdemux: Properly assign processing function during mux_prepare() call.
Currently, after pipeline params propagation, mux/demux processing
function might not be properly set up, if current params mismatch
ones assigned with binary blob during instantiation.
Similar assignment was there originally, but was lost to the history.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-03-20 10:08:11 +01:00
Paul Olaru c639886ddc platform: imx8m: Add SAI FIFO definitions
Without these changes SAI is unusable on this platform.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-19 21:29:32 +02:00
Paul Olaru 48ad1b775e platform: imx8m: dma: Fix DMA interrupt handling
On i.MX8M we don't use SDMA which requires individual interrupts per
channel. Let dma_chan_irq and dma_chan_irq_name fallback to the
controller specific interrupt.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-19 21:29:32 +02:00
Paul Olaru 34cde56e2d platform: imx8m: Fix DMAC names
On i.MX8M we use SDMA instead of EDMA. This commit adjusts the comments
to reflect this.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-19 21:29:32 +02:00
Paul Olaru 02d37bbdef platform: imx8m: Add more heap memory
The extra memory blocks are required for SDMA proper functioning.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-19 21:29:32 +02:00
Paul Olaru 819a58667e drivers: imx: interrupt: Adjust IRQ_STEER registers for i.MX8
On i.MX8MP the interrupt registers are mapped in the following fashion:

* Interrupts 0-31 at register 0x14
* Interrutps 32-63 at register 0x10
* Interrupts 64-95 at register 0x0C
* Interrupts 96-127 at register 0x08
* Interrupts 128-159 at register 0x04

Interrupts 0-31 map to one of the IRQ_STEER lines, 32-95 to another
and 96-159 to another. To not change the in-driver logic we falsely
shift the interrupts by 32, so 32-63 map to a line, 64-127 to another
and 128-191 to another. Now the valid interrupt numbers are shifted
from 0-160 to 32-191.

We also update REGISTERS_NUM to 6 even though one of the registers will
never be accessed due to bounds checking with RESERVED_IRQS_NUM. In fact
accessing those registers would lead to incorrect behavior.

So we use this kind of reverse mapping similar to on 8QXP/8QM except
that the reserved interrupts, rather than being reserved in hardware,
don't actually exist.

The only remaining effect to consider is that the interrupt numbers
must be shifted from what the datasheet says in order to correctly
register them.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-19 21:29:32 +02:00
Tomasz Lauda cb5ab2ba2c kpb: fix potential exception while freeing buffer
Fixes potential exception while freeing history buffer.
Not all buffers in the linked list are always allocated.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-19 19:06:08 +01:00
Tomasz Lauda f8932f6fd9 icl: memory: increase heap buffer size
Increases heap buffer size on ICL platform to have
sufficient space for KPB allocation.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-19 19:06:08 +01:00
Janusz Jankowski e34a64d16a pipeline: move pipeline_posn shared data
Like other SHARED_DATA objects, this one should have limited visibility
just to pipeline compilation unit.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-19 16:20:27 +00:00
Artur Kloniecki cf96e76ce0 formatting: Reformat trace messages in src/ipc/ipc.c.
Our guidelines encourage pasting whole quoted string of trace messages
in one line, rather than splitting it across multiple lines, when it
exceeds the regular 80 chars per line limit.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-03-19 12:50:16 +02:00
Janusz Jankowski 162ca407eb test: fix pipeline tests
Initialize global objects that are required by pipelines
logic - pipeline_posn.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-19 11:30:03 +01:00
Adrian Bonislawski f1fa3be980 probes-app: add allocation check
This will check if the allocation succeeded

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-03-18 21:58:03 +00:00
Adrian Bonislawski 2765b22049 probe-app: assume probe packet aligned
Thats because probe packet struct is packed and aligned to 1
which will generate a warning (error) with pointer assigning

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-03-18 21:58:03 +00:00
Tomasz Lauda b144a02bdc cmocka: fix ut building
We don't support section .shared in unit tests,
so add appropriate flags to make files.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-18 21:25:56 +00:00
Artur Kloniecki 6749a36c3c ipc: buffer: Properly free buffer using buffer_free instead of rfree.
In case of lack of memory to allocate control struct for newly created
buffer, pointer to that buffer was rfree'd instead of proper buffer_free
call, which would have resulted in memory leak. This patch is to address
this issue.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-03-18 14:41:02 +00:00
Artur Kloniecki 6e43ab8ecd ipc: buffer: Remove obsolete rfree on NULL pointer.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-03-18 14:41:02 +00:00
Tomasz Lauda b20191b362 pipeline: implement proper position offset retrieval
Implements proper position offset retrieval in order to
update current stream position in mailbox. Previous one
was using pipeline_id in calculations, which has been
failing for bigger values. Lack of error handling has
also been a problem. This new solution uses predefined
list of available offsets and picks the first free from
the list. This way it will fail only if we exceed the
maximum number of simultaneously supported offsets.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-18 10:44:39 +01:00
Tomasz Lauda cff7ca4e4a apl: memory: decrease module memory pool
Decreases runtime heap size on APL in order to accommodate
enabling larger number of simultaneous features.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-18 10:44:39 +01:00
Tomasz Lauda 0825d2fbdd task: reduce default stack size for some platforms
Reduces default EDF task's stack size for some platforms,
which have less memory and aren't used for more serious
processing.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-18 10:18:51 +01:00
Tomasz Lauda b6b8c3f2a8 spinlock: remove double header inclusion
Removes double inclusion of trace header.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-18 10:18:03 +01:00
Tomasz Lauda 1df122dad1 trace: move struct definition out of header
Moves trace struct definition out of header.
It isn't used anywhere besides trace unit.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-18 10:18:03 +01:00
Adrian Bonislawski a133d5d52a probe: free extraction task in deinit and clear probe ptr
This will fix probe deinit and free all used memory

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-03-17 18:55:20 +01:00
Bard Liao 5e8de9fd52 topology: sof-icl-rt711-rt1308-rt715-hdmi: Merge two pipeline with demux
Now kernel expots one PCM with two CPU dais. So use demux to play
with two DAIs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-17 16:43:06 +00:00
Bard Liao 0a52c2e319 topology: add pipe-dai-endpoint
This will create a basic pipeline with a buffer only. Note that
we don't implement a SectionGraph to connect the buffer to its
starting component, we should define it manually.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-17 16:43:06 +00:00
Bard Liao da8ac71a29 topology: add pipe-dai-sched-playback
This is basically the same as pipe-dai-playback.m4, but use SCHED_COMP
instead of N_DAI_OUT.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-17 16:43:06 +00:00
Bard Liao 3ae3beffbc topology: dai: add DAI_ADD_SCHED to set scheduling component
So we can set scheduling component when adding a DAI.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-17 16:43:06 +00:00
Marcin Maka 6ed1d32f70 comp: dox: complete and clean up api documentation
Merged the documentation of the component api and
infrastructure helpers.

Removed unnesessary dox groups that did not improve readability.

Completed missing dox parts.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-17 16:13:29 +01:00
Marcin Maka ac01040efe comp: api: advanced and internal functions separated
The current content of component.h is a mix of basic api, common
basic helpers for every component developers as well as advanced
functions and macros used by infrastructure and very specialized
components like host, dai, kpb etc.

This patch moves the advanced part to component_ext.h and keeps
only basic part in component.h to avoid overloading effects
component developers with declarations and code they do not use.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-17 16:13:29 +01:00
Tomasz Lauda cd9a0d378d mux: add missing buffer locks
Adds missing buffer locks to mux_copy function.
demux_copy has already had them before.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-17 15:32:05 +01:00
Marcin Maka ae229b1df1 ll-scheduler: trace task activities using uuids
Replacing pointers that varies from build to build
with stable uuids makes analysis of traces much easier.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-17 15:11:42 +02:00
Marcin Maka 0529c141f4 tasks: add uuid based identification for tasks
Tasks activities may be traced and analysed easier if they
are identified by uuids and named.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-17 15:11:42 +02:00
Tomasz Lauda 30e6e9eb41 ipc: allocate correct msg size
Msg size should use its own structure's size.
Only payload should be allocated using passed one.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-17 10:43:20 +01:00
Seppo Ingalsuo df6c637e8f Topology: BYT: Adjust SRC pipeline for lower RAM consumption
This patch removes support for over 48 kHz sample rates and changes
scheduling to every 1 ms to save in buffers sizes. In pipe-pcm-media.m4
the buffers in the pipeline are reduced from 4 to 2 or 3 periods.
These changes should allow the media PCM to work in BYT platform.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-16 19:43:44 +00:00
Tomasz Lauda 08efd08b7d sai: remove duplicated values
Removes duplicated values from expression.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-16 11:00:32 +02:00
Tomasz Lauda 47420dc92c gdb: use mailbox_get_debug_base() macro
Changes ring buffer to use mailbox_get_debug_base() macro.
It points to the same memory region as previously, but it's
defined for all platforms.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-16 10:03:02 +02:00
Marcin Maka afd9770836 comp: fix api documentation formatting
Incorrect format of dox comments fixed.
Added missing parameter documentation.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-13 18:06:16 +01:00
Marcin Maka 32c5129bfc comp: update api doc for trace macros
Added missing documentation for the macros.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-13 18:06:16 +01:00
Marcin Maka 10191131e7 trace: doc: complete parameter documentation
Corrected doc format and provided doc for missing parameters
of the trace_dev_ macros.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-13 18:06:16 +01:00
Marcin Maka 0d79936c27 comp: update api doc for component endpoint type
Documentation completed.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-13 18:06:16 +01:00
Adrian Bonislawski 496845984f probes-app: build the app with sof tools
this will allow to build probe app from scripts/build-tools.sh

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-03-13 16:26:16 +00:00
Tomasz Lauda d735532cb5 mailbox: add missing header
Adds missing header needed for size_t.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-13 17:08:14 +02:00
Marcin Maka 15736c5766 uuid: doc: add more documentation for macros
More detailed uuid documentation should be useful for
component developers and others working on named fw
objects (like tasks).

Another patch to sof-docs that refers this API section
and provides detailed description on UUID use in component
overview section.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-13 09:24:03 +02:00
Marcin Maka 366aa67822 comp: update api documentation for component state
Removed the diagram duplicated in sof-docs, moved set_state
notes from sof-docs to the header to make it easier accesible
for component developers and added notes for infrastructure
developers to remember about the sof-docs updates.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-12 11:37:53 +00:00
Marcin Maka 33cc71216f uuid: use __section macro
Data that go to static uuids section should use __section
macro.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-12 12:37:00 +01:00
Tomasz Lauda 0d0e5b73d2 idc: fix payload getter
Fixes payload getter to use passed core instead of current core.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-11 18:09:35 +01:00
Tomasz Lauda 0628363c47 buffer: fix locking
Fixes buffer_lock function. We need to pass flags by pointer
to use it correctly later to restore correct interrupt level.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-11 18:09:35 +01:00
Paul Olaru ee0fac6e91 drivers: imx: sai: esai: Implement get_hw_params
Add proper implementation for [e]sai_get_hw_params. This function is
required for all DAI drivers and lacks even assert checks.

Without this implementation we would have a jump to address 0, which
manifested itself as a hang on i.MX8MP (did not test the other platforms
but they are all broken).

Fixes: 55866f28 "comp: dai: implement dai_get_hw_params() function"
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-11 15:12:13 +02:00
Tomasz Lauda aba0bb2051 pcm_converter: fix loops condition
Fixes loops condition in most of the PCM conversion functions.
Number of samples is unsigned, so current condition caused underflow.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-11 11:04:32 +01:00