Commit Graph

710 Commits

Author SHA1 Message Date
Seppo Ingalsuo d98e6ec4da DMIC: Move ceil_divide from numbers.c to numbers.h as static inline
The DMIC driver needs this function. This inline version is a
bit faster and the change does not increase code size.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-17 14:44:38 +01:00
Seppo Ingalsuo 1b0fc77f83 DMIC: Add for format.h conversion from fractional to float
Note: Use with care since this generic macro is currently used only in
host test bench for debug print commands so there are no speed or
precision optimized versions yet.The cast to int64_t is not necessary
for all integer types. Also float restricts precision of a 64 bit
int.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-17 14:44:38 +01:00
Seppo Ingalsuo 787b7d1a7b DMIC: Changes to CNL platform
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-17 14:44:38 +01:00
Seppo Ingalsuo c44bdd2f4d DMIC: Changes to APL platform
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-17 14:44:38 +01:00
Seppo Ingalsuo 2ebe1ab13e DMIC: DMIC: Add dmic.c to drivers Makefile.am
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-17 14:44:38 +01:00
Seppo Ingalsuo 447ac9b675 DMIC: Add configure command switch to disable DMIC
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-17 14:20:20 +01:00
Seppo Ingalsuo fdc0cf9451 DMIC: Add PDM microphones (DMIC) support to DAI
This patch adds the DMIC audio capture driver for SOF DAI component use.
The DMIC feature allows to directly attach one to (typically) four PDM
digital microphones into Intel SoC without a separate codec IC. This is
supported by APL and most successor platforms.

Corresponding patches are needed for kernel driver and topology to enable
this feature.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-17 14:20:20 +01:00
Liam Girdwood 7c5dd8cfdf Merge remote-tracking branch 'sof/master' 2018-05-14 15:12:38 +02:00
Pan Xiuli 8fbc230fbb rimage: openssl: add compatibility for openssl 1.1.0
Add compatibility support for openssl 1.0.2 support alongsid with
openssl 1.1.0

References:
https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
Compatibility Layer

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-05-14 15:12:13 +02:00
Liam Girdwood cafe43e3d8 ssp: hsw: Initial HSW SSP driver (WiP)
Needs completion.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-05-13 20:50:38 +02:00
Pan Xiuli 1e231b9dd2 rimage: add error handler for localtime call
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-05-11 10:18:43 +01:00
Pan Xiuli ffa3e84584 rimage: fix wrong error message
If keyname can not be open, error message should output keyname insert
of tmp path.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-05-11 10:18:43 +01:00
Liam Girdwood 6c96fd34fa rimage: openssl: fix build for openssl 1.1.0
Openssl 1.1.0 is latest stable version with minor API differences.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-05-11 10:11:51 +01:00
Ranjani Sridharan 28bddadbd3 scripts: remove prefix for host build
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-05-11 10:11:34 +01:00
Ranjani Sridharan 17943a6c26 host build: include arch/string.h
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-05-11 10:11:34 +01:00
Rander Wang a083b39783 cnl-dma: remove special dma code for cnl
These code is for CNL for it is not supported that two HW IPs share
one irq pin. Now it is resolved in new algorithm, so delete it.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
2018-05-10 21:35:32 +01:00
Rander Wang b9fc3f50df interrupt: core: refine irq structure and algorithm
The issue for original data structure and algorithm is that:
(1)it only support 2 level interrupt architecture.
(2)it doesn't support two HW interrupt triggered by one irq pin.

Unify irq parent and child to irq_desc. Now each irq_desc maybe
directly attach to xtensa core or another irq_desc.Each irq_desc
may have 32 child list instead of 32 child.

For CNL or later chips, a group of HW IP(like GP-DMA) share
the same IRQ value. Now add id in IRQ to identify each HW interrupt.
If no IRQ shared, call SOF_IRQ to get the IRQ value, and the default
id value would be zero. otherwise call SOF_ID_IRQ to record its id in
IRQ value.

(1)Add core id check in interrupt register setting.
(2)Check child list in interrupt function
(3)Extend root irq_desc to support 4 core on cnl.
(4)Refine macro for interrupt setting

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
2018-05-10 21:35:36 +01:00
Wu Zhigang c1f2682c21 FIX: Add dma_stop when receive trigger stop cmd in host
when ALSA lib detect xrun issue, it will send stop and start
command to DSP without reset. it will hit error in hds_dma_start,
if we did not add the dma_stop in the host_trigger function.

Signed-off-by: Wu Zhigang <zhigang.wu@linux.intel.com>
2018-05-09 19:50:59 +01:00
Seppo Ingalsuo 2927377c45 SHIM: Correction for the APL header file macro
The macro doesn't use the parameter x so better to remove it.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-09 19:48:49 +01:00
Seppo Ingalsuo 93f9cab7c6 DAI: Check DAI type in dai_get() in CNL platform
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-09 19:48:49 +01:00
Seppo Ingalsuo 94f023612e DAI: Check DAI type in dai_get() in APL platform
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-09 19:48:49 +01:00
Keyon Jie 09b97dccba byt-ssp: fix status transition for ssp_stop
This fix the regression(line missed when copying) introduced by
commit 0d6e17ed99ea 'byt-ssp: change and wrap status transition
into ssp_stop'.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Tested-by: Zhang Keqiao <keqiao.zhang@linux.intel.com>
2018-05-09 19:36:59 +01:00
Seppo Ingalsuo 6be7b1d26a DMIC: Add SOF DMIC trace definitions
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-08 16:02:37 +01:00
Keyon Jie 0b6e17ed99 byt-ssp: change and wrap status transition into ssp_stop
This will remove manual status change, wrap them into ssp_stop(),
where the status transition is protect by spin_lock.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-05-08 16:01:48 +01:00
Keyon Jie 72e63a467f apl-ssp: change and wrap status transition into ssp_stop
This will remove manual status change, wrap them into ssp_stop(),
where the status transition is protect by spin_lock.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-05-08 16:01:48 +01:00
Prashant Malani e3f45d2770 scripts: Modify Docker Ubuntu version
This ensures that the ubuntu version we use has the right
versions of Open SSL. Without this, the rimage compilation will
fail with the following error:

 pkcs1_5.c: In function 'pkcs_sign':
 pkcs1_5.c:117:20: error: dereferencing pointer to incomplete type 'RSA
 {aka struct rsa_st}'

Signed-off-by: Prashant Malani <pmalani@google.com>
Acked-by: Dylan Reid <dgreid@chromium.org>
2018-05-08 16:00:21 +01:00
Seppo Ingalsuo 8b664cee3f DMIC: Add decimator raw coefficients tables
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Seppo Ingalsuo 92dc65faa7 DMIC: Fix compilation issue with SRC
The MIN and MAX macros are provided by numbers.h.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Seppo Ingalsuo 40ed5ad121 DMIC: Fix compilation issue with SSP by removing duplicate macro
This macro is provided by io.h.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Seppo Ingalsuo ea5f722747 DMIC: Add min/max, ceil divide, find number, and normalize utils
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Seppo Ingalsuo 88488567ee DMIC: Change math library link order
Order is changed to let drivers library to be able to use functions from
math.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Seppo Ingalsuo d59654c25b DMIC: Add DMIC registers bit fields handling macros
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Seppo Ingalsuo aea16662ca DMIC: Add DMIC DMA setting to DAI
Note that this is hardwired to stereo for now to enable testing of
feature. It need to be updated to support any number of channels and
optimized DMA burst size.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Seppo Ingalsuo 0c6c12aa96 DMIC: Add SOF DMIC IPC definitions
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Seppo Ingalsuo 89a7af4473 DMIC: Add SOF DMIC definitions
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-05-07 12:18:30 +01:00
Pan Xiuli 8080070449 platform: panice: Send exception memory offset via IPC
Send the memory window offset with the panic IPC in case the panic
happen before DSP ready when the memory window info is sent.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-05-07 11:54:22 +01:00
Pan Xiuli 530ef2a213 mailbox: use mailbox function for SW_REG
SW_REG is in memory window and the cache is enabled, need to
writeback the SW_REG.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-05-07 11:48:48 +01:00
Dylan Reid 85ae8e7418 scripts: Add build-soft.sh
Make it easier to build the topology when working in sof.git. This
script automates the change of directory to and from soft.git.
It also makes building in a container easier because all scripts can
execute from the same working directory.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
2018-04-30 20:05:24 +01:00
Dylan Reid e3dfa4e1bd scripts: Add ability to build in a container
Having a docker container that contains the cross compiler and host
dependencies eases setup and maintenance of local builds.

The container setup procedure is based of the wiki instruction. A few
more dependencies were added.

In addition to the ct-ng and xtensa-newlib steps, this container builds
top of tree alsa-lib and alsa-utils as distros seem to be slow to update
them with the needed topology features.

The docker-run.sh script is used to automatically bind mount local
soft.git and sof.git directories in to the container. This provides
build artifacts in the same place as a local "make" would.

Use it like the following:

./scripts/docker-run.sh make
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh
etc...

The container only needs to be re-built when the toolchain or alsa
dependencies are modified.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
2018-04-30 16:24:56 +01:00
Dylan Reid 2470f8c0b3 scripts: Add #! headers to shell scripts
Use /bin/sh by default.  The lists used in xtensa-build-all.sh are a
bash feature, use bash for that script.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
2018-04-30 16:21:39 +01:00
Yan Wang 3ad69eb715 FIX: Remove unused variable.
The variable "i" shouldn't be used.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-04-24 08:09:52 -07:00
Zhang Keqiao 9a33490ce0 dist: fix make dist compiling issue
Signed-off-by: Zhang Keqiao <keqiao.zhang@linux.intel.com>
2018-04-24 08:09:43 -07:00
Pierre-Louis Bossart 29d4e8b126 apl-ssp: use macros instead of hard-coded shifts/masks
Missed those definitions in previous patch, fix.

Suggested-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-13 19:49:12 +01:00
Pierre-Louis Bossart 0cc866fde1 apl-ssp: allow for 19.2 MHz SSP reference
Don't hard-code MCLK source on ApolloLake, use settings provided over
IPC to select 24.576 MHz PLL or 19.2 MHz XTAL oscillator.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-13 15:45:15 +01:00
Pierre-Louis Bossart 36f23c6cc3 apl-ssp: fix padding bit issues in I2S/LEFT_J mode
The current code doesn't work for I2S/LEFT_J when the slot width and
number of valid bits don't match (e.g. 24 bit data in 32-bit slot).

In I2S/LEFT_J mode, the padding is not at the end of the frame but
at the end of each slot, and is evenly distributed between the two
left and right phases.

Fix by using DMYSTOP for I2S/LEFT_J, and only program SSPSP2 for DSP_A
and DSP_B modes

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-13 15:44:55 +01:00
Liam Girdwood a197715d09 configure: check for doxygen and graphviz to build docs
Documentation needs doxygen and graphviz so warn if they are not
installed.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-13 15:33:57 +01:00
Marcin Maka 6aee21bb42 Makefile support for doc target.
Builds uapi documentation in html format using doxygen.
See doc/sof_uapi/html/index.html
First dox samples in the source code provided by the patch.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2018-04-13 14:56:04 +01:00
Liam Girdwood 7e91484c26 uapi: ipc: Add executable memory flag
Add flag to mark memory as executable.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 21:50:38 +01:00
Liam Girdwood 7db25d8924 rimage: add support to build and sign runtime modules
Currently rimage only supports building ELF images with know TEXT, DATA
and BSS addresses. This patch adds support to build runtime relocatable
modules that can be loaded linked into the base SOF FW at runtime.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 21:49:19 +01:00
Liam Girdwood 78e7f30f42 ipc: page tables: Make page table API generic for use outside IPC core
Allow users outside of IPC to make use of compressed host page tables.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 20:45:47 +01:00