Tracing functions can sleep on some platforms, remove them out of
spin-lock protected areas, even though sometimes that can produce
inconsistent output. Since dw_dma_stop() can be called from an
atomic context, use a non-sleeping tracing function.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
On some versions of the DesignWare DMA controller IP the peripheral
ID field in CFG_HI is split into two parts. Fix this for Sue Creek,
other platforms will have to verify that field too.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Fixed flow issue in which channels would be invalid number
and being later used to stop dma. When freeing
stream that have not even started FW tried to stop dma
which should not be the case since it was not started.
Signed-off-by: Jakub Dabek <jakub.dabek@linux.intel.com>
Sue Creek uses SPI for IPC messages. This patch removes all DMA IPC
artefacts and makes necessary for SPI adjustments in sue-ipc.c. Note,
that it still uses the purely software IPC mailbox for uniformity
with other architectures.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The DesignWare SSI IP can perform as an SPI controller. This patch
adds a driver for the SSI's SPI slave mode and enable building it on
the Sue Creek platform.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Sue Creek uses a DesignWare GPIO controller IP for several functions,
including a line, used as an interrupt from the board to the host to
be used with the SPI communication. This patch adds a minimal generic
GPIO API and an implementation for the DW GPIO IP.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This driver has only one function: it can configure a pin for the
GPIO role.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch enables the FIFO B in addition to previously supported
FIFO A. It allows in topology to use in pipelines the DMIC DAI
type with indices 0 and 1. The DAI instances can be operated with
different sample rate and different PCM format. The other
topology parameters for microphones need to be the same (number
of channels and enabled microphones). If the request via topology
differs for those parameters the latter request overrides the
first request. Typical usage for this added feature is to provide
compact 16 kHz / 16 bit capture version for speech in addition to
normal 48 kHz / 32 bit media quality audio capture.
The DMIC HW actually provides a bit more freedom for FIR/FIFO A/B
usage difference but all of that is not exposed yet via the
driver due to added complexity.
Some trace prints for DMIC parameters and used configuration are
modified to print shorter lines for easier reading. The print
order is adjusted to be more logical.
The patch modifies two topologies to showcase the feature. The
sof-apl-dmic-2ch/4ch topologies for APL nocodec machine driver
are changed to instantiate in addition PCM7 set for 16 kHz 16 bit
format in addition to earlier PCM6.
Note: The required change to pipe-passthrough-capture.m4 PCM
capability to enable other than 48 kHz rate is not done to not
break important test cases. Another PR addresses the PCM
capabilities and after it is merged allowing 16 kHz PCM for DMIC
capture can be done safely.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Create a separate directory for DesignWare drivers and move dw-dma.c
into it with no changes.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add a configuration parameter "scatter" to specify, that the source
address should be reloaded while the destination address should be
incremented by the transfer length to contiguously fill destination
memory.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The DW DMA driver prepares configuration register values in linked
list elements. If linked lists of DMA descriptors are used for DMA
those registers are automatically read in by the hardware for each
transfer. The driver also uses those prepared values to explicitly
write them to respective registers. The DONE bit of the CTL_HI
field in linked list elements is automatically set by the hardware
when the respective transfer has completed. It has to then be
cleared by the software to re-use the entry. In the CTL_HI register
the DONE bit is writable, but setting it doesn't seem to be needed.
Remove the DONE bit manipulation at configuration time.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
if host params fails before dma channels are allocated
dma stop is called with invalid channel number and causes
eventually dsp oops.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
When calculating frame_end_padding with tdm_per_slot_padding_flag high,
imporper data size was used, yielding configuration errors.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Fixed non-APL specific handling of per-channel IRQs from GPDMA.
APL has per-channel IRQs handled by xtos, so similar functionality
was implemented for other platforms. Bitmask for tracking usage of
IRQs was added to dma structure, for non-APL only.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Adds start delay for timer driven capture streams.
External interface is enabled after DMA, so we need to compensate it.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This is legacy and was used to keep current
message from host.
It is now unused so remove it. Notice that we
also remove temp var msg.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
In C casts between "void *" and any other pointers aren't needed.
Remove several occurrances.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Instead of jumping out of a loop with a "goto" use break and test
the loop exit reason.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Replace multiple occurrances of assignment sequences like
a |= x1;
a |= x2;
with a simpler
a |= x1 | x2;
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Remove several occurrances of redundant variable initialisations
and remove some trivial variables, that are only initialised
and used once without ever being changed.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Simplify the DW DMA driver by using channel and LLI pointers instead
of repeating the same pattern multiple times within functions.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
In dw_dma_start() .lli_current cannot be NULL. If it were NULL, lines
following the check, would cause a NULL-pointer dereference. Remove
the superfluous check.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This is to prevent FW from getting stuck in case of anomalous
situations such as DMA taking too long to copy the data.
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
After commit 77dccad986 ("ipc: moving src/ipc/*-ipc.c files to drivers
dir") there is no need to use byt or hsw prefix because the file is
already in the platform specific directory.
Signed-off-by: Daniel Baluta <daniel.baluta@gmail.com>