Commit Graph

3935 Commits

Author SHA1 Message Date
Janusz Jankowski 1d92e8e175 sof: use RELATIVE_FILE instead of __FILE__
Use RELATIVE_FILE because __FILE__ makes binary output
dependent on project location.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-11 12:50:30 +00:00
Janusz Jankowski 24f3160977 cmake: scripts: relative path define utility
Add helper function sof_append_relative_path_definitions that
defines RELATIVE_PATH per source file for given target.

__FILE is not always suitable as C standard states that __FILE__ expands to
input file name, that usually is absolute path what will cause f.e. .rodata
size to be dependent on where project is physically located on the disk.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-11 12:50:30 +00:00
Karol Trzcinski 2f8fb81495 kconfig: kpb: 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 405b6034d3 kconfig: mixer: 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 7003c1fb4e kconfig: keyword: 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 662e70964f kconfig: dai: 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 59a7e2819f kconfig: volume: test only supported data format
Do not run unit tests on unsupported by configuration
data types. See CONFIG_FORMAT_* macro.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski dca94d5da8 kconfig: volume: 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 33d11ad659 kconfig: volume: 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 4f66db1ca6 kconfig: src: 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 6a80a46ce0 kconfig: iir: selective build by CONFIG_FORMAT
Include in footprint only code needed to support 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 a64bdddc81 kconfig: iir: group function pointer in arrays by data type
It will be helpful in next step - selective compilation.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
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