Commit Graph

287 Commits

Author SHA1 Message Date
Guennadi Liakhovetski 371cca6e63 dw-dma: do not sleep in atomic context
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>
2019-02-01 19:15:44 +00:00
Guennadi Liakhovetski fe7fe7874a dw-dma: fix peripheral handle field in CFG_HI
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>
2019-02-01 19:15:44 +00:00
Guennadi Liakhovetski a9224c9bd7 dw-dma: fail probing if setting up the controller fails
If the driver is unable to release the DMA controller, abort probing.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-02-01 19:15:44 +00:00
Jakub Dabek 1f1e693d46 hda-dma: Fixed flow in parameter set and stop
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>
2019-02-01 19:15:19 +00:00
Adrian Bonislawski 166477424a add dmic sources only if CONFIG_DMIC enabled
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-02-01 18:15:13 +00:00
Guennadi Liakhovetski ba7b7a6ce5 sue: enable IPC over SPI
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>
2019-02-01 16:47:21 +00:00
Guennadi Liakhovetski 74346b5c93 drivers: add an SPI driver for the DW SSI IP
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>
2019-02-01 11:12:08 +00:00
Guennadi Liakhovetski c69dfaab3b drivers: add a driver for the DW GPIO controller IP
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>
2019-02-01 11:12:08 +00:00
Guennadi Liakhovetski 5bded4fb1c drivers: add a simple driver for the Sue Creek IOMUX controller
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>
2019-02-01 11:12:08 +00:00
Seppo Ingalsuo 1c191a20fd DMIC: Enable capture from secondary FIFO
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>
2019-01-31 20:41:24 +00:00
Guennadi Liakhovetski 2f14a8782b dma: move the dw-dma.c driver to a new directory
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>
2019-01-31 20:25:00 +00:00
Guennadi Liakhovetski ab89914f2b dw-dma: support scatter DMA operation
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>
2019-01-31 20:25:00 +00:00
Guennadi Liakhovetski 7f374d27a4 dw-dma: do not set the DONE bit of CTL_HI
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>
2019-01-31 20:25:00 +00:00
Jaska Uimonen ce3626201b dma: check for invalid channel in dma stop
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>
2019-01-29 12:38:28 +00:00
ArturX Kloniecki c098d091ea SSP: Properly calculate frame end padding for 24/32 transport.
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>
2019-01-25 16:10:20 +00:00
ArturX Kloniecki 4405cd4721 GPDMA: Fix per-channel IRQ handling of GPDMA for non-APL platforms.
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>
2019-01-25 16:04:19 +00:00
Tomasz Lauda dec5c62bd1 dw-dma: use chan instead of p[chan]
Fixes DMA channel usage.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-01-25 15:59:10 +00:00
Bartosz Kokoszko fc19ee4208 cavs: ipc: platform_ipc_init refinement
Removing the allocation of page table buffer for cavs platforms.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-01-25 15:54:56 +00:00
Tomasz Lauda 724d267413 dw-dma: add start delay for timer driven capture streams
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>
2019-01-24 15:41:07 +00:00
Liam Girdwood 570ce06599
Merge pull request #877 from dbaluta/master
drivers: Remove unused unused host_msg field
2019-01-24 08:12:16 +00:00
Daniel Baluta 7c37501568 drivers: Remove unused host_msg field
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>
2019-01-24 00:20:08 +02:00
Guennadi Liakhovetski 4ff218b482 sue: use a symbolic name for a task priority
Use TASK_PRI_MED instead of a hardcoded 0 for the IPC task on Sue
Creek.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-01-23 19:58:02 +00:00
Guennadi Liakhovetski 44aa1193e7 dw-dma: (cosmetic) remove superfluous type-casts
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>
2019-01-23 17:08:03 +00:00
Guennadi Liakhovetski 9aff15f6cc dw-dma: (cosmetic) eliminate a goto
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>
2019-01-23 17:08:03 +00:00
Guennadi Liakhovetski 7fd51425f6 dw-dma: (cosmetic) simplify assignments
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>
2019-01-23 17:08:03 +00:00
Guennadi Liakhovetski bc5c1b49c8 dw-dma: (cosmetic) remove redundant variable initialisations
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>
2019-01-23 17:08:03 +00:00
Guennadi Liakhovetski 25739de839 dw-dma: (cosmetic) use pointer shortcuts
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>
2019-01-23 17:08:03 +00:00
Guennadi Liakhovetski e5bc088e04 dw-dma: remove superfluous check
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>
2019-01-23 14:23:11 +00:00
Janusz Jankowski d91be6da67 buildsystem: remove autotools from sof
This commit doesn't touch tools buildsystem.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-01-22 15:35:35 +00:00
Janusz Jankowski e0ba98d21a cmake: add CMakeLists for firmware build
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-01-22 15:35:35 +00:00
Janusz Jankowski 86cd1a9ac4 kconfig: add initial Kconfig files
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-01-22 15:35:35 +00:00
Slawomir Blauciak f9640aa170 dma: link tx timeout
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>
2019-01-17 14:09:46 +00:00
Pierre-Louis Bossart 1737993a1f src/drivers/intel/pmc-ipc.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 4aa1d9ab5b src/drivers/intel/haswell/timer.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart b3b04f6b7b src/drivers/intel/haswell/ssp.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 3e49cfea2e src/drivers/intel/haswell/ipc.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 71a594df7b src/drivers/intel/cavs/timer.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 151c338e2f src/drivers/intel/cavs/sue-ipc.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 2d6791ce76 src/drivers/intel/cavs/ssp.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 9f84f84b78 src/drivers/intel/cavs/ipc.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart ce676ddefc src/drivers/intel/cavs/hda-dma.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart f4aea9c9ba src/drivers/intel/cavs/dmic.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 87c01ffbc0 src/drivers/intel/baytrail/timer.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 920917bb7f src/drivers/intel/baytrail/ssp.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 55dc68385b src/drivers/intel/baytrail/ipc.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Pierre-Louis Bossart 27a168b297 src/drivers/dw-dma.c: fix style
Make checkpatch happy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-01-16 20:07:40 +00:00
Daniel Baluta 55e4c4097e ipc: Rename *-ipc.c to just ipc.c
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>
2019-01-14 13:01:57 +00:00
Guennadi Liakhovetski c17be235ba dw-dma: fix a comment
Fix an error in a comment.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-01-11 15:19:36 +00:00
Bartosz Kokoszko f6f23ec4cb dw-dma: dw-dma.c displacement to top driver dir
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-01-10 14:12:47 +00:00
Liam Girdwood a94bcfb447 trace: dai: Improve some DAI trace messages.
Use 0x%08x format for SSP registers and trace every dai_config()

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

fix
2019-01-10 14:10:01 +00:00