Commit Graph

4727 Commits

Author SHA1 Message Date
Paul Olaru c941b0a9f1 platform: imx8m: Add SDMA definition
This commit adds the definition of the SDMA controller we use for SOF,
namely SDMA2 (the other instances of SDMA are used for non-audio-related
DMA in the system). This DMAC can serve the SAI.

A way to account for channel 0 being used internally needs to be added.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-23 14:17:27 +00:00
Paul Olaru b3420a5b1b platform: imx8m: sdma: Add SDMA definitions for i.MX8M platform
This includes interrupt number and a tweak used when probing the driver
(which must match hardware configuration).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-23 14:17:27 +00:00
Paul Olaru 87d79c48dd drivers: imx: sdma: Add SDMA support to SOF
Some i.MX platforms use SDMA (Smart DMA) controller for DMA related
operations. This commit adds the initial functionality for SDMA.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-03-23 14:17:27 +00:00
Diana Cretu 3dd843a46d scripts: qemu: Add qemu check for i.MX8M platform
Enable checks to i.MX8M platform of QEMU now.

Signed-off-by: Diana Cretu <dianacretu2806@gmail.com>
2020-03-23 10:52:58 +02:00
Janusz Jankowski 9da1fce247 test: audio: remove kpb
KPB tests don't work and it's better to remove it,
than keeping here disabled code.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-20 16:36:44 +01:00
Pan Xiuli bfa8bf7ba1 scripts: make verbose build into an option
Disable verbose build by default in build script.
It would be too annoying if we do not need to debug
with make systems.

Use -v option to enable verbose log if need.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-03-20 13:34:43 +00:00
Seppo Ingalsuo 26ea50ecd0 Topology: Fix in EQ only pipelines with macro PIPELINE_SINK
This patch fixes the buffer to define as PIPELINE_SINK. The
upper level topologies do not use these topologies so there has
not been related errors. However test pipelines were impacted.

Also the PIPELINE_PCM defined name is made more generic. It can
be whatever and not just high-pass type.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo ce1401f62a Tools: Test: Cleanup component run scripts
The src_run.sh is converted into a generic component run script
that is called by new simple component specific scripts asrc_run.sh,
eqfir_run.sh, eqiir_run.sh, src_run.sh, and volume_run.sh.

Note: The testbench does not yet have fully working capture support
so the direction is not exposed yet.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo 0c35f1efde Testbench: Build topology parser with debug symbols
This patch adds compilation with -g. Optimization -O was added to get
optimization that preserves sane debugging with gdb. This component
is not critical for speed in simulation.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo dc44384ea0 Testbench: Fix possible uninitialized use of variable ret
This patch fixes the read_samples_32() function in file component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo 0eeda80bdf Testbench: Add processing component load
This patch adds to testbench capability to run pipelines with EQ_IIR
and EQ_FIR components. The component is configured with the topology
embedded configuration blob when instantiated with new().

The load of volume component has been enhanced to parse volume tokens and
compute the min and max volume parameters.

The topology parsing and component library load has been changed to
support processing component load and extracting of control private
data. The testbench build has been changed to create libraries
for EQ components.

The testbench command line parsing has been improved to return
error for invalid library request.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Artur Kloniecki ae211e1f31 probe: Properly send response code for custom responses.
Status (error) code in custom Probe responses is now reported properly.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-03-20 12:20:41 +00:00
Artur Kloniecki c33b7a58d7 probe: Properly report size of arrays in INFO payloads.
Size of flexible arrays in Probe INFO responses is now reported properly.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-03-20 12:20:41 +00:00
Marc Herbert ff88cd03b7 test/kpb: fix tests[1] array out of bounds
As reported by gcc.

Fixes: 0b279e06bc. This is a partial, one-line revert of that commit
that decreased the size of this array for no obvious reason.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-20 12:14:52 +00:00
Marc Herbert 726dd545d6 cmocka/cmake: don't re-fetch (and change) cmocka.git on every build
Add "UPDATE_DISCONNECTED True" property in ExternalProject_Add() so:

- Unit tests can be rebuilt without a network connection
- The code can't change from one build to the next without the developer
  being aware.

Found by chance thanks to some network issue.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-20 12:07:44 +00:00
randerwang a33b9a208a dai: dma_buffer: fix pop noise issue when start playback
The pop noise is generated by invalid data in dma buffer.
Since all buffers are cleared by pipeline_comp_prepare except
dma buffer, so clear it to zero to avoid pop noise.

Signed-off-by: randerwang <rander.wang@linux.intel.com>
2020-03-20 12:06:30 +00:00
Marcin Rajwa 1033083200 kpb: add state change to kpb_free()
This patch logs state change in kpb_free() method.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-03-20 12:03:40 +00:00
Marcin Rajwa d3cd604e25 kpb: add missing initialization of new memory block
This patch initializes early the "next" pointer of
new memory block. This is important because if
further allocation fails (i.e due to not enough
memory available) this block will end up with missing
next pointer so every operatation on linked list of buffers
will likely fail (assuming there is no check for NULL pointer)

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-03-20 12:03:40 +00:00
Marcin Rajwa 94290b1eaa kpb: fix missing size of history buffer
This patch fixes missing history buffer size during
validation of host params.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-03-20 12:03:40 +00:00
Marcin Rajwa 477c8b0871 memory: decrease HEAP buffer block size
This change decreases heap buffer block size from 0x180
to 0x100 bytes. This improves memory usage as often single
block of 0x180 bytes exceeds allocation needs.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-03-20 12:03:40 +00:00
Marcin Rajwa e4f25015ec memory: increase heap buffer size for TGL platform
This patch increases HEAP_BUFFER_SIZE so more advanced pipelines
can be allocated. Also HEAP_BUFFER_BLOCK_SIZE has been decreased
to allocate buffers with better granuality

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-03-20 12:03:40 +00:00
Seppo Ingalsuo 25c1d0fef7 Topology: BDW, BYT, CHT: Reduce buffer size max for media PCM
This change prevents the IPC error that happens if aplay or
speaker-test uses larger than 64 kB buffer size. The buffer
setting in PCM_CAPABILITIES() is now the same as for low latency
PCM.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 11:56:56 +00:00
Seppo Ingalsuo eaf3794105 DAI: Remove spinlocks for timestamping registers access
This patch removes the spin_lock() and spin_unlock() calls
from DMIC, HDA, and SSP driver code. The removal avoids a pipeline
stall issue that has been seen to happen in ASRC capture pipelines.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 11:34:37 +00:00
Jairaj Arava 35e5b23f7f topology: add TGL tplg for Max98373 amp and ALC5682 Headset codec
This patch adds TGL topology for the DUT which has the
following audio configuration:
	Max98373 speaker (I2S), ALC5682 headset codec (I2S),
	DMIC, 4 HDMI devices.

Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
2020-03-20 11:30:40 +00:00
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