Commit Graph

4023 Commits

Author SHA1 Message Date
Karol Trzcinski 724617f282 kconfig: fir: 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 8e6661dc63 kconfig: fir: group functions by supported data type
It will be helpful in next step -
- selective function compilation by
supported data type

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 20dabd5f1e kconfig: selector: test only supported by configuration data format
Do not carry test on unsupported data format for a five firmware
version.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 85088ff193 kconfig: selector: selective code compilation according to data type
Compile support only for data types selected in configuration.
It may make footprint smaller.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski c5d7ecb2e2 kconfig: selector: group functions and callbacks by supported data type
It will be helpful in next step - conditional code compilation
according to configuration

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 34be3cec87 kconfig: mux: test only supported data types
Do not include data type test when it is not supported by
some platform or firmware version.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 0549c274e4 kconfig: mux: add selective data format compilation
Use introduced configuration option in mux component to make
firmware footprint smaller.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 2da5689bdf kconfig: mux: 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 3d60d936ce kconfig: add supported data format menu in Kconfig
It will be used to make footprint smaller by selective
compilation of supported data format in components

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Bartosz Kokoszko 6a0cf6740f dmic: change spin_lock to spin_try_lock in dmic_work()
In order to avoid dead locks in dmic_work I've replaced
spin_lock() with spin_try_lock(). In case when
spin_try_lock() fails we reschedule dmic work.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-11-11 12:00:10 +00:00
Bartosz Kokoszko b03e15a765 spinlock: add return value to spin_try_lock macro
Adds return to spin_try_lock() in order to retrieve status
from arch_try_lock() function.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-11-11 12:00:10 +00:00
Bartosz Kokoszko 6071fb8dbf dmic: add missing schedule_task_cancel() in dmic_stop()
After trigger stop we should cancel dmic task
from low latency scheduler.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-11-11 12:00:10 +00:00
Liam Girdwood 1fa037cc1e logger: fix build errors with gcc 9.1.x
Latest GCC does additional checks. This patch fixes the following build
error.

Scanning dependencies of target sof-logger
[  0%] Building C object logger/CMakeFiles/sof-logger.dir/convert.c.o
/home/lrg/work/sof/sof/tools/logger/convert.c: In function ‘serial_read’:
/home/lrg/work/sof/sof/tools/logger/convert.c:311:2: error: converting a packed ‘struct log_entry_header’ pointer (alignment 1) to a ‘uint32_t’ {aka ‘unsigned int’} pointer (alignment 4) may result in an unaligned pointer value [-Werror=address-of-packed-member]
  311 |  for (len = 0, n = (uint32_t *)&dma_log; len < sizeof(dma_log); n++) {
      |  ^~~
In file included from /home/lrg/work/sof/sof/tools/logger/convert.c:15:
/home/lrg/work/sof/sof/tools/../src/include/user/trace.h:94:8: note: defined here
   94 | struct log_entry_header {
      |        ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [logger/CMakeFiles/sof-logger.dir/build.make:76: logger/CMakeFiles/sof-logger.dir/convert.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:91: logger/CMakeFiles/sof-logger.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2019-11-11 11:55:14 +00:00
Jerome Laclavere fb068e6a7a drivers: imx: SAI : don't generate clocks in slave mode
The test determinating the current SAI mode (M/S) was buggy.
As a consequence SAI generated bit clock and FS clock when the codec was
in master mode (which is the default configuration for SAI currently with
SOF). This bug didn't prevent the DAI to function and to have good sound.

Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-08 16:42:23 +02:00
Marcin Maka de22810b0f pm: cavs: add lps flow
Use of low power sequencer lowers power consumption, since
DSP may be completely turned off when calling waiti and then
powered on interrupt, booting via restore vector installed in
lpsram.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-11-08 14:37:29 +01:00
Daniel Baluta b37ed9049d include: ipc: Update comment for type field of sof_ipc_comp_process
We need this in order to match the exact comment from the
similar file in the Linux kernel.

sof_ipc_effect_type was the old name of the component no longer
used now.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-08 13:21:11 +02:00
Paul Olaru 87f9a659bf platform: hsw: Do not call dai_probe() after dai_get()
dai_probe() is already called from within dai_get().

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-08 13:19:49 +02:00
Paul Olaru 7a0ee17f77 platform: byt: cht: Do not call dai_probe() after dai_get()
dai_probe() is already called within dai_get().

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-08 13:19:49 +02:00
Paul Olaru 73a70eddac platform: imx: Do not perform early get/init of the DAI
It isn't necessary to do a dai_get this early for the ESAI; the SAI
doesn't even have one.

Calling dai_probe() after dai_get() is pointless since dai_probe() was
already called from a previous dai_get() with CREAT flag (in particular
the one which incremented sref from 0 to 1).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-08 13:19:49 +02:00
Janusz Jankowski a366d378ba arch: xtensa: use optimization configs
Use optimization configs that come from Kconfig in CMake
to set appropriate compiler flags.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-08 10:28:21 +01:00
Janusz Jankowski 66ce9791fa kconfig: optimization levels
Add configs for optimization levels.
These configs should be used by build system to properly
tune compiler flags.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-08 10:28:21 +01:00
Janusz Jankowski 5211799133 cmake: trigger olddefconfig on kconfig changes
When there are changes made to Kconfig files it's better
to run olddefconfig automatically to prevent undesired behaviour,
like for example depending on added config that has some default value
that is not present because developer didn't run olddefconfig
after pulling changes.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-07 09:12:52 +01:00
Janusz Jankowski 98449205fb checkpatch: disable __func__ warning
Traces in SOF are used like trace("<func>() info"),
in that case __func__ is not convenient, because it is not literal
and it would be needed to use %s everywhere and change
all current traces.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-07 00:20:43 +01:00
Guido Roncarolo 7fe0dbd215 topology: Add topology for i.MX8QXP with wm8960 codec
This pipeline adds support for S24_LE, 2 channels, 48KHz playback.

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-06 17:25:00 +02:00
Guido Roncarolo b9fe87faed topology: Add nocodec SAI topology for i.MX8QXP
i.MX8QXP has one SAI interface. Create a simple topology
without a codec for playback of 2 channels, 16bits samples
at 48Khz.

Host -> Buffer0 -> Volume -> Buffer1 -> SAI1

This is useful for testing various components like Dummy DMA,
EDMA and SAI drivers.

For more information about SAI you can read i.MX8QXP RM at:
https://www.nxp.com/docs/en/reference-manual/IMX8DQXPRM.pdf

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-06 17:25:00 +02:00
Guido Roncarolo fde7781a42 ipc: Introduce SAI IPC parameters definition
SAI is one of the DAIs found on i.MX8 platforms. Introduce
sai_params used to pass configuration from topology via AP to DSP.

Only MCLK and TDM related params for now.

Because this is a new struct, increment only ABI MINOR version
which makes the SOF FW backward compatible with older kernel
versions.

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-06 17:25:00 +02:00
Guido Roncarolo 81482ca63a topology: Add SAI related utility macros
Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-06 17:25:00 +02:00
Guido Roncarolo 8c1549e0fc topology: Add SAI tokens
Only add SAI MCLK ID token for now

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-06 17:25:00 +02:00
Guido Roncarolo 41f3484010 topology: Extend DAI_CONFIG to allow SAI DAI
Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
2019-11-06 17:25:00 +02:00
Karol Trzcinski 6984e86b15 trace: Repair mux tracev argument name typo
To repair tracev_mux_with_ids macro.
Because with current macro definition
and enabled CONFIG_TRACEV macro code won't compile.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-06 16:30:37 +02:00
Pan Xiuli 77918e1e89 audio: src: fix void pointer arithmetic in HIFI2
Fix issue with void pointer arithmetic for BYT/CHT
on xcc build with hifi2.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-11-06 14:43:00 +02:00
Pan Xiuli 5eb668cc52 lib: alloc: fix block_map uninitialized warning
Fix build warning as error:
error: 'block_map' may be used uninitialized in this function

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-11-06 14:43:00 +02:00
Marcin Maka b5c8f83c48 platform: cavs: use pm-runtime api to power gate dsp cores
Power control hw programming should go through the pm_runtime
interface. It provides more granular control over the power
gating of each single dsp core.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-11-05 22:30:14 +00:00
Marcin Maka 14dcd128bd pm-runtime: cavs: add power gating control for dsp cores
get() operation called for dsp core resource disables
power gating of that core so it is locked in d0 state.
This is a default power state when the core is running.

put() operation enables power gating of the core, so
that the core goes to d3 every time it enters idle
(waiti is called and there is no interrupt to handle).
This handler should be called before the waiti is called
if pm-runtime for the core is enabled (see pm_runtime_enable()).

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-11-05 22:30:14 +00:00
Marcin Maka 9b6ad970af platform: cavs: make windows clear on init optional
There might be other flows defined in future, that would
need to reprogram hw registers only while preserving
the content of memory windows.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-11-05 22:07:31 +01:00
Marcin Maka e5d8a5c933 arch: xtensa: add getters for special registers
Access to vecbase, excsave2/3/4/5 is required for saving
the dsp core context while internal d0/d3 transitions
initiated by the low power sequencer.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-11-05 17:41:45 +01:00
Karol Trzcinski e59374e0fc buffer: trace: remove void pointer arithmetic
remove void pointer arithmetic in comp_update_buffer_produce function

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-05 16:21:09 +00:00
Karol Trzcinski acddb9ac1b trace: use UNUSED for disabled traces
This will prevent from compiler warnings when
local variables are used only in trace log and
trace is disabled.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-05 16:21:09 +00:00
Karol Trzcinski e9e19136c1 meta: introduced UNUSED macro
UNUSED macro should prevent compiler from throwing warnings
about unused wariables during conditional builds.
Usable for example in trace logs.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-05 16:21:09 +00:00
Karol Trzcinski 0282941d94 trace: Swap definition order in trace_
It Is done to achieve consistent trace definition order in project.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-05 16:21:09 +00:00
Karol Trzcinski 408433d32e trace: Avoid duplication of trace_ definitions
It was needed to define empty implementation of error and verbose
macros in two places what is not compliant with DRY methodology.
It is done by moving trace defs around, outside #if CONFIG_TRACE block.
After changes it is defined in only one place.
Also trace_*_comp should be defined once bacause it may be
independent from CONFIG_TRACE values.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-05 16:21:09 +00:00
Karol Trzcinski edc81c521f trace: remove trace_value
Because those functions was hardly used in source code.
Moreover it is better practise to add short trace
description, at least variable name instead of trace
with only variable value.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-05 16:21:09 +00:00
Marcin Maka 5e6ceb0829 ipc: cavs: read set d0ix request directly from ipc registers
cavs specific set d0ix message is read directly from ipc
registers and does not use mailbox located in SRAM which is
the only safe way to send a message to the cAVS DSP when
the DSP is in a lower power state.

The message is translated to SOF_IPC_PM_PWR_GATING message.

Response always use the mailbox since there is no way to write
the *T registers back with the current bi-directional communication
implemented using a single *T register set.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-11-05 15:31:53 +00:00
Marcin Maka bc0cbe2a27 ipc: add pm power gating message
A new message that may be used by the driver to configure
power gating and clock gating using platform specific method.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-11-05 15:31:53 +00:00
Dragos Tarcatu d98a7ed103 checkpatch: check ABI updates before warning on it
checkpatch is currently checking for changes that need ABI updates
and actual ABI changes in the same loop in process(). So if some
file that needs an ABI change comes first, a WARNING will be issued.

Look for an actual ABI change before starting to crunch the entire
patch line by line.

Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
2019-11-05 14:49:22 +01:00
Tomasz Lauda 0b7fd030b3 demux: return config on COMP_CMD_GET_DATA
Returns current config on COMP_CMD_GET_DATA. It fixes the problem
with wrong demux configuration after suspend. Kernel doesn't cache
initial kcontrol config and overwrites it with configuration returned
from component.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-11-04 17:01:05 +00:00
Paul Olaru 5c7a49af38 sof: build: Disallow void pointer arithmetic
Add compiler flags so that void pointer arithmetic is not allowed.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-04 15:26:20 +01:00
Janusz Jankowski e044194844 checkpatch: disable short fixed size types for SOF
Do not check for u/s* vs u/sint*_t in SOF,
because there is only the longer variant.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-04 14:41:27 +01:00
Janusz Jankowski d88ac84e54 checkpatch: restore MAINTAINER file check
It was previously removed from SOF, but it's better to just disable
it for SOF to make delta with original checkpatch as small as possible.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-04 14:41:27 +01:00
Janusz Jankowski 386abbe8bc checkpatch: add SOF constant
Introduce constant that enables SOF-specific behaviour of checkpatch.
Changes made to original checkpatch should be easily visible
to make merging updates easier.

If code that is not applicable to SOF is just removed, then
while updating it's hard to distinguish if it is new feature
in checkpatch or was removed for SOF. It's better to just disable
parts of code that do not work for SOF.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-04 14:41:27 +01:00