Commit Graph

3974 Commits

Author SHA1 Message Date
Paul Olaru 9b5dc8c6ef sof: Align interrupt stacks
Xtensa ABI requires the stack to always be aligned to a multiple of 16
bytes. This commit aligns the stacks used for interrupt handling.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-21 16:45:33 +02:00
Janusz Jankowski a25d50eb64 clk: platform agnostic clocks
Create abstract interface for clocks and move platform specific
clocks code to platform folders.
It was also necessary to move SSP clocks declarations to
SSP driver code to decouple clocks logic from mandatory
SSP clocks.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-21 14:38:28 +00:00
Lech Betlej 07444f4b78 Remove doxygen warnings during documentation generation
The changes fix command unbalanced groupings and remove discrepancy
between parameters in function declaration & definition of
set_power_gate_for_memory_address_range() function.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-11-21 14:34:26 +00:00
Paul Olaru 0e1efdfaad platform: imx: Enable WAITI_DELAY
The description says that any LX6 Xtensa architecture revision DSP
should have this enabled, and the particular DSP in the i.MX8 does fit
this description.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-20 10:47:09 +00:00
Paul Olaru 75a6a8cce3 platform: imx: Update build script for compiling with XCC
The tools version and core must be correctly defined in order to be
able to compile for this platform.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-20 10:45:47 +00:00
Slawomir Blauciak c7b914dd14 ipc: channel map structures and api
This change adds stream map and channel map structures
used for channel re-routing and stream aggregation.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-11-20 10:44:51 +00:00
Tomasz Lauda 63a552992c topology: revert media pipes to 4000 scheduling period
Reverts all changed media pipelines to again have 4000 ms
scheduling period. Change was introduced in order to workaround
firmware scheduling limitation, but with pipelines scheduled
separately we can revert it back.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda e3ba648de0 pipeline: schedule pipelines separately
This patch enables separate scheduling of connected
pipelines. It allows for different scheduling periods
between connected pipelines and flexible controlling
of such topologies.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda 6de576c9d7 topology: fix connected pipelines' priorities
Fixes pipelines' priorities in multipipe topologies.
The highest priority is 0.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda f42ddc06fd ll_schedule_domain: use pipeline_task in DMA domains
Uses pipeline_task in DMA domains to check, if tasks should be even
registered on interrupts. Non registrable tasks are the one,
whose pipelines are not the owners of scheduling component e.g.
host pipelines connected to mixer pipeline. Such tasks are still
added to the scheduler's list and executed, but they are driven
by the pipelines with scheduling component.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda 5ead758e24 pipeline: use pipeline_task
Initializes and uses pipeline_task instead of regular task.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda 3de6844497 task: add pipeline_task
Adds definition of pipeline_task. It's a task type registered
by pipelines and used in DMA scheduling domains.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda 5dca048ed6 schedule: remove SOF_SCHEDULE_FLAG_SYNC/ASYNC flags
Removes SOF_SCHEDULE_FLAG_SYNC and SOF_SCHEDULE_FLAG_ASYNC.
They are no longer used nor needed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda 6ffcd61c19 ll_schedule: use domain property instead of sync/async flags
Changes ll scheduler implementation to use synchronous property
of domain to check if given task should be scheduled synchronously
or asynchronously. It makes sense, since it's heavily dependent
on particular domain functionality.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda 95ba01ebd2 ll_schedule_domain: add synchronous field
Adds new synchronous field to indicate if tasks registered
to this domain should be scheduled synchronously or asynchronously.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda d9aecd8498 ll_schedule_domain: describe structure
Describes ll_schedule_domain structure.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda b734091d63 ll_schedule_domain: pass task during unregistration
Changes domain_unregister operation to also receive task
being unregistered.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Tomasz Lauda cb5506f0b9 pipeline: cleanup header file
Removes unused pipeline_schedule() declaration and
not needed inclusion of task header.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-19 10:56:15 +00:00
Paul Olaru 1613f10689 drivers: imx: interrupt: Change how the cascade IRQ template is defined
Instead of taking the name from an array of strings (which is allowed by
GCC) I compose the name directly inside the IRQSTR_CASCADE_TMPL_DECL
macro. GCC is able to detect that the name is a compile time constant
and allows the old code, XCC does not and requires this change.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-19 11:15:16 +02:00
Paul Olaru aee8e0553a drivers: imx: edma: Make soff and doff signed
This allows the SGN macro to no longer generate a warning on the "-1"
case and thus allows building with XCC. GCC doesn't seem to care about
this one. No actual change in the logic itself.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-19 11:15:16 +02:00
Guido Roncarolo dbb70c840c imx: topology: Add capture pipeline for the wm8960 codec case
Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-18 15:55:18 +00:00
Paul Olaru 67ce20a5c2 imx: topology: Add capture pipeline for the CS42888 codec case
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-18 11:06:06 +00:00
Paul Olaru aa293bbe21 drivers: imx: esai: Remove PADC bit from rx configuration
PADC means to have ESAI pad samples with zeros instead of sign-extending
them when they are smaller than the (32-bit) container. This doesn't
make senseon capture and indeed that specific bit is hardware reserved.
So don't use it.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-18 11:06:06 +00:00
Paul Olaru 205b079253 drivers: imx: esai: Various cleanups
Generally comment cleanups but also moving the "|" operator to be at
the end so that the various options in dai_update_bits are aligned.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-18 11:06:06 +00:00
Paul Olaru d28278808a drivers: imx: esai: Set configurations for capture
The configurations will be mostly similar to those used for playback,
but while the ESAI is master on playback it must be slave on capture
as a workaround due to hardware limitations. These differences must be
hardcoded due to the topology not specifying these configurations for
each direction of the link.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-18 11:06:06 +00:00
Paul Olaru e17aa44c30 drivers: imx: edma: Correctly compute available data size on capture
Currently this just returned a zero and wasn't able to correctly
interpret the direction of the channel.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-18 11:06:06 +00:00
Paul Olaru ea6060c9ca drivers: imx: edma: Store direction from config into the channel data
This direction is to be used later.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-18 11:06:06 +00:00
Paul Olaru fa6206d47c platform: imx: dai: Get the direction from the component instead of the IPC
The direction was already configured correctly in the component during
dai_new, and the IPC data is shared for both instances of the DAI
component (playback and capture).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-18 11:06:06 +00:00
Bartosz Kokoszko 655d077f72 spinlock: spin_try_lock refinement
Use block expression instead of do {} while(0) macro
in spin_try_lock in order to return its value in a
safer way.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-11-15 14:17:01 +00:00
Jerome Laclavere f004d11f30 drivers : interrupt: alignment of cascaded IRQs
The base irq of the first created cascaded struct is currently equal to
PLATFORM_IRQ_HW_NUM, which is 32 on HIFI4.

On IMX platform the number of children per such a struct is equal to 64
(as per IMX steer IRQ mapping).

Since steer irq in range [0-63] are not routed to the DSP on IMX8 it is
possible to create the cascaded structs only from 64.

Starting them from 32 creates a bias in the management of interrupts,
making the storing of the irq-handlers un-natural and complicated.

This commit wants to replace the initialization of cascade_root.last_irq
by a new constant PLATFORM_IRQ_FIRST_CHILD which would be defined at
platform level.

In the case of IMX it takes value 0, while in all other platform it takes
the value PLATFORM_IRQ_HW_NUM in order to keep things as they are.

Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
2019-11-14 16:36:49 +02:00
Seppo Ingalsuo decd206460 SRC: Fix pointer arithmetic in circular buffer wrap functions
The previously used cast of pointer to size_t (unsigned int)
has worked but it's horrible way to do it. Cast to uint8_t *
should be clean portable code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-11-13 14:48:42 +00:00
Bartosz Kokoszko 835d876b90 component: add min_sink/source_bytes to comp_dev struct
Add two parameters to comp_dev struct in order to allow
configuration of the component processing variable frames.
Added parameters are:
- min_sink_bytes - min free sink buffer size measure in bytes
  required to run component's processing;
- min_source_bytes - amount of data measured in bytes
  available at source buffer required to component's
  processing.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-11-12 16:29:34 +00:00
Guido Roncarolo 778095e36c drivers: imx: sai: configure frame_bytes from format
Configure frame_bytes from topology format

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-12 16:40:30 +02:00
Guido Roncarolo 645e0aaaa8 drivers: imx: sai: correct clock divider
For stereo playback correct divider is 0x7

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-12 16:40:30 +02:00
Guido Roncarolo a9f2f85c35 topology: imx: sai: correct link name
Link name changed to be.wm8960-hifi align to that
Correct clocks too

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-12 16:40:30 +02:00
Pierre-Louis Bossart d1dcdfedf6 kmod_scripts: add support for soundwire_generic_allocation
new module added, needs to be listed in sof_remove.sh

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-11-11 18:40:08 -06:00
Pan Xiuli 7b75314dfb kmod_scripts: add support for common hdmi
The HDMI codec may also use snd_hda_codec_hdmi

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-11-11 18:21:18 -06:00
Seppo Ingalsuo b27b21a865 EQ IIR: Code style fixes for trace prints
This patch contains maintenance for module traces. Some redundant
traces are removed and some new traces with useful information are
added, especially if they are related to an error with configuration
request. The long trace strings are shortened to and split to
several lines at numbers print when possible.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-11-11 16:10:43 +00:00
Seppo Ingalsuo d80ed44790 EQ IIR: Add support for response reconfigure during streaming
This patch adds capability to equalizer to switch response during
audio playback or capture. The glitches are minimized by check
and apply of the filter configuration before each copy()
operation.

The existing only halfway implemented SOF_CTRL_CMD_ENUM for quick
stored presets switching during streaming is removed for now
since there is no driver support.

The internal code cleanup includes extract of two functions from
eq_iir_setup() for check and initialize of coefficients and
initialize of filter delay lines. It helps to better understand
the setup flow.

The extrapolation of channels to response assign map is changed
to use previous channel response instead of first if the stream
contains more channels than the response definition. The
procedure was changed to avoid a code static analysis issue. The
behavior is not specified so this simpler way was chosen.

To minimize number of duplicated functions in generic and HiFi3
version a new module iir_generic.c is created for the filter
core. After the change iir.c contains only the common code for
both implementations.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-11-11 16:10:43 +00:00
Janusz Jankowski 1d92e8e175 sof: use RELATIVE_FILE instead of __FILE__
Use RELATIVE_FILE because __FILE__ makes binary output
dependent on project location.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-11 12:50:30 +00:00
Janusz Jankowski 24f3160977 cmake: scripts: relative path define utility
Add helper function sof_append_relative_path_definitions that
defines RELATIVE_PATH per source file for given target.

__FILE is not always suitable as C standard states that __FILE__ expands to
input file name, that usually is absolute path what will cause f.e. .rodata
size to be dependent on where project is physically located on the disk.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-11 12:50:30 +00:00
Karol Trzcinski 2f8fb81495 kconfig: kpb: selective build by CONFIG_FORMAT
Include in footprint only support for selected
data formats. It may make footprint lighter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 405b6034d3 kconfig: mixer: selective build by CONFIG_FORMAT
Include in footprint only support for selected
data formats. It may make footprint lighter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 7003c1fb4e kconfig: keyword: selective build by CONFIG_FORMAT
Include in footprint only support for selected
data formats. It may make footprint lighter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 662e70964f kconfig: dai: selective build by CONFIG_FORMAT
Include in footprint only support for selected
data formats. It may make footprint lighter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 59a7e2819f kconfig: volume: test only supported data format
Do not run unit tests on unsupported by configuration
data types. See CONFIG_FORMAT_* macro.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski dca94d5da8 kconfig: volume: selective build by CONFIG_FORMAT
Include in footprint only support for selected
data formats. It may make footprint lighter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 33d11ad659 kconfig: volume: group functions by supported data type
It will be helpful during next step - conditional code
compilation depending on configuration

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 4f66db1ca6 kconfig: src: selective build by CONFIG_FORMAT
Include in footprint only support for selected
data formats. It may make footprint lighter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 6a80a46ce0 kconfig: iir: selective build by CONFIG_FORMAT
Include in footprint only code needed to support selected
data formats. It may make footprint lighter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00