Commit Graph

3739 Commits

Author SHA1 Message Date
Tomasz Lauda 16d1ca7c41 topology: sof-cml-demux-rt5682-max98357a: fix PCM and PIPELINE ids
Fixes ids for PCM and PIPELINE.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-16 10:54:47 +02:00
Tomasz Lauda ac27df9e70 topology: sof-cml-demux-rt5682: fix SSP index for CML
Builds CML demux topology with the correct SSP index.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-16 10:54:47 +02:00
Tomasz Lauda 5f539d9448 dai: fix rare case of xrun on release
Adds new start_position field based on which we assess whether
we should throw an xrun. It fixes rare cases of xruns on release
with timer scheduled pipelines.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-16 10:27:21 +02:00
Tomasz Lauda 6f26cfd8c4 dai: verify if DMA channel exists in dai_prepare
Checks if DMA channel exists in dai_prepare. This way we will
avoid exception in case DAI config hasn't been called before.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-16 10:26:36 +02:00
Tomasz Lauda 3fc0e27b06 topology: sof-icl-rt711-rt1308-rt715-hdmi: use 3 periods for ALH
Changes ICL topology to use 3 periods for buffer connected to ALH DAI.
This topology has been forgotten, when such changes were done.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-16 10:26:20 +02:00
Tomasz Lauda a53e12b8ea topology: cml: fix errors in topologies
Fixes SSP format and used pipeline macro in CML topologies.

Fixes: cfe81f5127 ("topology: cml: cnl: use 3 periods for SSP, DMIC and ALH DAIs")

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-16 09:57:22 +02:00
Tomasz Lauda 95a7c02041 topology: pipe-src-volume-playback: fix number of periods
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-16 09:57:22 +02:00
Lech Betlej b5982a46aa cnl: Access to HPSRAM power gating status register - macro updated
Macro modified for SRAM segments > 0 fixed by register offset
update to a proper value.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-10-15 13:10:13 +02:00
Pan Xiuli 947238ded8 rimage: keys: add new 3k key
New platforms like TigerLake will need 3k RSA key for signing.
Generate new keys for SOF public key.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-10-15 13:09:54 +02:00
Lech Betlej 79393f7c3e lib: Make sure shifted quantity is treated as 64bit type
Append type to constants in order to make sure they are
treated as 64 bit integers.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-10-15 12:37:35 +03:00
Tomasz Lauda 4839742c35 dw-dma: reload lli in irq_callback
For DW-DMA without hardware linked list support we need
to manually reload linked list items after every interrupt.
It's very time-sensitive and even the slightest drift can
cause glitches, so this patch moves lli reload routine
to be called from DMA domain as an interrupt callback.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-15 10:06:54 +02:00
Tomasz Lauda 6ec25256da dma: add irq_callback to dma_chan_data
Adds irq_callback to dma_chan_data. It's called by the
DMA domain right after receiving an interrupt, so should
execute very time-sensitive operations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-15 10:06:54 +02:00
Guido Roncarolo a1f80afe44 drivers: imx: Add SAI support
The SAI is a hardware DAI on the i.MX platform. This commit brings
the initial support for the SAI.

Current limitations:
 -> Hardware FIFO watermark is hardcoded to HALF FIFO size
 -> current codec only support stereo channels
 -> slot size hardcoded to 32 bit
 -> clock divider is set to 8

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
2019-10-15 09:25:34 +03:00
Paul Olaru 40bf5e070e drivers: imx: edma: Remove hardcoding of interrupt numbers
Initially I have hardcoded the specific values required for the ESAI.
That however is highly inflexible.

This commit refactors that to allow a more flexible declaration so that
other DMA clients can also get their proper interrupt numbers.

Only hardware which delivers its DMA interrupts via IRQ_STEER is
supported, however on this platform that is fine (all DMA channels
deliver their interrupts as shared interrupts via IRQ_STEER).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-14 15:12:14 +03:00
Paul Olaru a7d4690a92 drivers: imx: edma: Initialize DMA scheduling domain
On the pipelines which use EDMA, the EDMA interrupts are the ones which
schedule all the copies and processing happening inside a pipeline.

This commit enables the EDMA controller to schedule copies on this
platform.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-14 15:10:14 +03:00
Paul Olaru 50dfa9c751 drivers: imx: edma: Copy is_scheduling_source field from config
This field is required for the DMA scheduling domain to work.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-14 15:10:14 +03:00
Tomasz Lauda 7eb051592e dma_single_chan_domain: add trace logs
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-14 12:28:08 +03:00
Tomasz Lauda fdc6fba36c dma_multi_chan_domain: add trace logs
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-14 12:28:08 +03:00
Tomasz Lauda 0eaa11495e timer_domain: add trace logs
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-14 12:28:08 +03:00
Tomasz Lauda c7d01494bb pipeline: fix tasks initialization
Fixes tasks initialization for connected pipelines.
If we play on pipeline, which is not the owner of
the scheduling component, then the pipeline_prepare()
is not called on pipe owning that component and tasks
stay unitialized.

Fixes: de7d4c95cf ("pipeline: allocate pipe_task only if needed")

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:49:07 +02:00
Jakub Dabek 66b0a0f0b8 memory: Add alignment option for allocation
Add alignment option for memory requests.
Fix alloc definitions for UT.
Function definitions were using defines in their body
which blocked usage of const values in said defines.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-11 14:26:08 +02:00
Jakub Dabek 0bc4e9fde9 host: Fix memory function definitions
Fix alloc definitions for host build.
Function definitions were using defines in their body
which blocked usage of const values in said defines.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-11 14:26:08 +02:00
Jakub Dabek 823e57a1b2 memory: adjust memory sizes for heaps
Adjust memory sizes for heaps to provide
enough memory for alignment in buffer heap.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-11 14:26:08 +02:00
Paul Olaru 51a6c9cdc5 drivers: generic: dummydma: Add config option
This config option also encapsulates a required dependency on
HOST_PTABLE.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-11 14:21:30 +02:00
Paul Olaru f1e249dd37 drivers: dummydma: Move the driver file to generic/
This driver can apply to any platform with the buffers in shared memory,
not just to i.MX.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-11 14:21:30 +02:00
Paul Olaru 4bee59c112 drivers: imx: dummydma: Change number of channels
This is to optimize memory consumption from this driver. With 32
channels we would have needed a memory block >1024 bytes in size to
allocate the dma_chan_data array. However 16 channels (which means
allocating a smaller block) should be enough for everyone.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-11 14:21:30 +02:00
Paul Olaru 9035c1f05c drivers: imx: Add Dummy DMA driver initial implementation
The dummy DMA is a software-based DMA which acts as a host DMA. This
one can be implemented in software alone because all host physical
address space (at least the RAM portion) is accessible directly from
the DSP on this platform.

The driver works by taking the physical addresses for both the source
and destination addresses from the elems. This works because no paging
is enabled on the DSP side, and because the page tables interpretation
allows these elements to actually have physical addresses on the host
side. Given these addresses, the copy itself is done synchronously on
the DSP within a memcpy_s call.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-11 14:21:30 +02:00
Paul Olaru d384b851db platform: imx: Implement page tables for DMA transfer.
Enabling this config option changes the way the SG elems are generated,
such that the host addresses in the elems are actual, physical
addresses.

This is required by the Dummy DMA driver, which can only operate with
said physical addresses.

This commit enables the config option and fixes compile errors which
appeared after this enabling.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-11 14:21:30 +02:00
Tomasz Lauda 8e4d0c95d6 pipeline: trigger pipeline in non-atomic context
With new schedulers implementations we don't need to trigger
pipeline in atomic context anymore.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda 46d080dc21 pipeline: don't copy not active component
Doesn't copy sink component, if it's not active.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda 71d9ee4681 platform: cavs: switch to DMA single channel domain
Switches from DMA multi channel domain to single channel
as the scheduling source for one of the low latency schedulers
for cAVS platforms.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda b23a6cc277 topology: intel-generic-dmic: use 3 periods for DMIC DAIs
Changes number of DMIC DAI periods from 2 to 3. This way
we can support both timer and new single DMA channel
scheduling.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda 5a3546595b topology: tgl: use 3 periods for SSP and DMIC DAIs
Changes number of SSP and DMIC DAI periods from 2 to 3.
This way we can support both timer and new single DMA
channel scheduling.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda 9bf1f22dbf topology: icl: use 3 periods for SSP, DMIC and ALH DAIs
Changes number of SSP, DMIC and ALH DAI periods from 2 to 3.
This way we can support both timer and new single DMA
channel scheduling.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda cfe81f5127 topology: cml: cnl: use 3 periods for SSP, DMIC and ALH DAIs
Changes number of SSP, DMIC and ALH DAI periods from 2 to 3.
This way we can support both timer and new single DMA
channel scheduling.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda b9fbe7798f topology: apl: glk: use 3 periods for SSP and DMIC DAIs
Changes number of SSP and DMIC DAI periods from 2 to 3.
This way we can support both timer and new single DMA
channel scheduling.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda 1280987999 topology: use DAI_PERIODS in calculation of DAI buffer size
Uses DAI_PERIODS in calculation of DAI buffer size.
In case the DAI_PERIODS value is undefined, we use
DAI_DEFAULT_PERIOD value of 2.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda 3b90d1e9a5 topology: pipeline: add missing undefine
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda e56c517a5b topology: use passed DAI_PERIODS
Fixes pipe-dai-capture and pipe-dai-playback pipelines
to use passed DAI_PERIODS value instead of hardcoded.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda b7bb5b8539 schedule: implement dma_single_chan_domain
Adds implementation of DMA single channel scheduling domain.
This domain allows to schedule all the tasks on all the cores
on single DMA channel interrupt. This way we have only one
interrupt source and we don't need to worry about handling
many interrupts. We always select the channel with the lowest
period. This domain cannot be used with the DMAs, which require
to manually reload the next data to be transferred e.g. DW-DMA
on BYT or HSW.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda 6e48480165 ll_schedule: clear domain earlier
Some ll scheduling domains require to have interrupt cleared
right at the beginning of handler. Clear domain earlier to
fulfill that requirement.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda 2ce790d640 dma: add period to dma_chan_data
Adds DMA channel period value to dma_chan_data.
We can now easily retrieve the period value of
DMA channel transfers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda a91a396d5c notifier: add new NOTIFIER_ID_DMA_DOMAIN_CHANGE
Adds new NOTIFIER_ID_DMA_DOMAIN_CHANGE. This id will be used
by DMA single channel scheduling domain.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-11 14:17:29 +02:00
Tomasz Lauda e755494e7e timer: fix return values of platform_timer_set and arch_timer_set
Fixes return value of platform_timer_set and arch_timer_set functions.
Change was introduced for cAVS platforms, which accidentally broke
these functions for other platforms. The intention of this functions
is to return value of set ticks, so the timer scheduler can check
for delays.

Fixes: 75188e2243 ("timer: rework timer_set() so it verifies requested ticks")

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-10 17:14:05 +03:00
Paul Olaru 1a413d0b27 drivers: imx: edma: Set correct IRQ number
For the moment, the EDMA will only be used with one client -- the ESAI.
The IRQ number for both of the channels corresponding to the ESAI (as
well as the controller name) will be the same, and will map to interrupt
442 (which, according to the calculations required by IRQ_STEER, map to
interrupt 442 % 64 = 58 on controller 442 / 64 = 6).

In the future we should make this more flexible.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-10 17:04:45 +03:00
Paul Olaru 1a9ee6e453 drivers: imx: Add initial EDMA support
This is a hardware DMA controller on the i.MX platform. This one is
capable of doing mem-to-dev and dev-to-mem copies of any data.

This commit contains most of the initial implementation but a few things
related to IRQ handling (such as IRQ numbers).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-10 17:04:45 +03:00
Paul Olaru d21bba52e3 drivers: imx: edma: Remove specific register accessor functions
There are generic functions like dma_chan_reg_read and the rest which
can be used instead of these.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-10 17:04:45 +03:00
Paul Olaru 109d9f5bc9 lib: dma: Add support for different IRQ names for DMA per-channel IRQ
DMA controllers on the i.MX8 platform provide separate interrupts per
channel which may fall on different IRQ_STEER interrupt lines. Due to
the current architecture of the IRQ_STEER driver, this means the
channels may have their interrupts fall on different interrupt
controllers.

This commit allows setting an interrupt controller name per interrupt.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-10 17:04:45 +03:00
Paul Olaru d61a6b8e29 sof: lib: dma: Introduce {io,dma_chan}_reg_update_bits16
These functions are 16-bit counterparts to the preexisting 32-bit
functions io_reg_update_bits and dma_chan_reg_update_bits and are
intended to be used for general (in the former case) and DMA (in the
latter) 16-bit registers.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-10 17:04:45 +03:00
Paul Olaru 89ec81bc25 sof: lib: math: Add sign function
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-10-10 17:04:45 +03:00